Index: lvm2create_initrd.sh =================================================================== --- lvm2create_initrd.sh (revision 70) +++ lvm2create_initrd.sh (working copy) @@ -77,7 +77,7 @@ # include in the path some dirs from the real root filesystem # for chroot, blockdev -PATH="/sbin:/bin:/usr/sbin:/usr/bin:/lib/lvm-200" +PATH="/sbin:/bin:/usr/sbin:/usr/bin:/lib/lvm-200:/initrd/bin:/initrd/sbin" PRE="initrd:" echo "$PRE Remounting / read/write" @@ -144,6 +144,26 @@ echo "$PRE Umounting /proc" umount /proc +# make /rootvol/proc if it doesn't exist +if [ ! -d /rootvol/proc ]; then + mkdir /rootvol/proc +fi + +# remove old /dev/mapper directory +echo "$PRE Removing old /dev/mapper directory on $rootvol" +rm -rf /rootvol/dev/mapper + +# create /dev/mapper/control device on /rootvol +if test -n "$MAJOR" -a -n "$MINOR" ; then + echo "$PRE Creating /dev/mapper/control device on $rootvol" + mkdir -p -m 755 /rootvol/dev/mapper + mknod -m 600 /rootvol/dev/mapper/control c $MAJOR $MINOR +fi + +echo "$PRE Creating LVM2 devices on $rootvol" +cd /rootvol +( chroot . sh -c 'mount -t proc none /proc; /sbin/vgmknodes; umount /proc' ) + echo "$PRE Changing roots" cd /rootvol mkdir -p initrd