Skip to contentSkip to conversation

No Subject

linux-lvm trylinux 4 participants 6 messages Jan 14, 2004 – Jan 16, 2004

lore
Share & tools
lore

trylinux

author
#0 lore raw

First things first. Is there a FAQ for this group?

Now then, I'm running Fedore Core/1 (Red Hat 9) with LVM 1.0.3-13 (or at least RPM says it's 1.0.3). I have a single volume group containing a single disk. While /boot is NOT in the volume group (for obvious reasons), everything else, include / is. / is a ext3 filesystem.

I recently used vgrename to rename the volume group (from rootvol to rootvg -- just a test to learn some more), and it seemed to succeed. I was able to run afterwards with no problems. On the first reboot after this, though, my system can no longer boot. Here's a rough transscription of what's going on:

...kernel booting/initializing...
Loading lvm-mod.o module
LVM version 1.0.5+(22/07/2002) module loaded
Loading jbd.o module
Journalled Block Device driver loaded
Loading ext3.o module
Mounting /proc filesystem
Creating block devices
Scanning logical volumes
vgscan -- reading all physical volumes (this may take a while...) vgscan -- found inactive volume group "rootvg"
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created vgscan -- WARNING: This program does not do a BGDA backup of your volume group

Activating logical volumes
vgchange -- volume group "rootvg" successfully activated

Mounting root filesystem
mount: error 2 mounting ext3
pivotroot: pivot_root(/sysroot,/sysroot/initrt) failed: 2 umount /initrd/proc failed: 2
Freeing unused kernel memory: 136k freed

Kernel panic: No init found. Try passing init= option to kernel.

I'd be happy to provide more info if it would help anyone. (grub.conf, fstab,
etc.)

Cheers,
Rob

#1 lore raw
Quoted 1 line · trylinux

First things first. Is there a FAQ for this group?

http://www.tldp.org/HOWTO/LVM-HOWTO/index.html

It covers LVM 1 and has been recently updated for verion 1.0.8.

Quoted 4 lines

Now then, I'm running Fedore Core/1 (Red Hat 9) with LVM 1.0.3-13 (or at least RPM says it's 1.0.3). I have a single volume group containing a single disk. While /boot is NOT in the volume group (for obvious reasons), everything else, include / is. / is a ext3 filesystem.

This is a Red Hat patched version of LVM 1.0.3, but the problem is not version related.

Quoted 11 lines

I recently used vgrename to rename the volume group (from rootvol to rootvg -- just a test to learn some more), and it seemed to succeed. I was able to run afterwards with no problems. On the first reboot after this, though, my system can no longer boot. Here's a rough transcription of what's going on:

Mounting root filesystem
mount: error 2 mounting ext3
pivotroot: pivot_root(/sysroot,/sysroot/initrt) failed: 2 umount /initrd/proc failed: 2
Freeing unused kernel memory: 136k freed

Kernel panic: No init found. Try passing init= option to kernel.

Was "root=/dev/rootvol/root" changed to "root=/dev/rootvg/root" in the /boot/grub/grub.conf file?

Quoted 2 lines

I'd be happy to provide more info if it would help anyone. (grub.conf, fstab, etc.)

Of course the volume group name change must be done in /etc/fstab also.

Sincerely,

Ken Fuchs <[email protected]>

#2 lore raw
In reply to trylinux

On Wed, Jan 14, 2004 at 08:27:18AM -0800, trylinux wrote:

[...]

Quoted 4 lines

I recently used vgrename to rename the volume group (from rootvol to rootvg -- just a test to learn some more), and it seemed to succeed. I was able to run afterwards with no problems. On the first reboot after this, though, my system can no longer boot. Here's a rough transscription of what's going on:

[...]

Quoted 9 lines

Activating logical volumes
vgchange -- volume group "rootvg" successfully activated

Mounting root filesystem
mount: error 2 mounting ext3
pivotroot: pivot_root(/sysroot,/sysroot/initrt) failed: 2 umount /initrd/proc failed: 2
Freeing unused kernel memory: 136k freed

Kernel panic: No init found. Try passing init= option to kernel.

You need to rebuild the kernel initrd if you change your root device, as the linuxrc script in the initrd has the root device hard-coded.

#3 lore raw
Quoted 16 lines · trylinux
Quoted 15 lines

I recently used vgrename to rename the volume group (from rootvol to rootvg -- just a test to learn some more), and it seemed to succeed. I was able to run afterwards with no problems. On the first reboot after this, though, my system can no longer boot. Here's a rough transcription of what's going on:

Activating logical volumes
vgchange -- volume group "rootvg" successfully activated

Mounting root filesystem
mount: error 2 mounting ext3
pivotroot: pivot_root(/sysroot,/sysroot/initrt) failed: 2 umount /initrd/proc failed: 2
Freeing unused kernel memory: 136k freed

Kernel panic: No init found. Try passing init= option to kernel.
Quoted 2 lines · Brant Katkansky

You need to rebuild the kernel initrd if you change your root device, as the linuxrc script in the initrd has the root device hard-coded.

lvmcreate_initrd(8) can be used to do this, but one might learn more by using the following manual approach.

To better understand how LVM 1 is used in mounting the root device, one can loop mount the initrd and at least look at the current linuxrc script and change it as needed. Assuming the kernel has built-in ext2 support (almost always; lvmcreate_initrd creates an ext2 initrd), here are the steps to do this (only for anyone reading who isn't sure how):

# cd /boot
# mkdir /initrd-tmp
# cp -p initrd<remainder of filename> initrd-tmp
# file initrd-tmp

If the file is gzip compressed data do the following two steps (filesystem is probably ext2), otherwise skip them:

    # mv initrd-tmp initrd-tmp.gz
    # gunzip initrd-tmp.gz
# mount -o loop initrd-tmp /initrd-tmp
# mount | grep initrd-tmp

If the filesystem is cramfs, the following addition steps are needed to convert the cramfs initrd to an ext2 initrd (this step shouldn't be required since lvmcreate_initrd creates ext2 and not cramfs):

    # dd if=/dev/zero of=initrd-ext2 bs=1024 count=4096
    # mke2fs initrd-ext2
    ...
    Proceed anyway? (y,n) y
    # mkdir /initrd-ext2
    # mount -o loop initrd-ext2 /initrd-ext2
    # (cd /initrd-tmp; tar cf - .) | (cd /initrd-ext2; tar xvf -)
    # rmdir /initrd-ext2/lost+found     <initrd doesn't need it.>
    # umount /initrd-tmp
    # umount /initrd-ext2
    # mv initrd-ext2 initrd-tmp         <replace cramfs with ext2.>
    # mount -o loop initrd-tmp /initrd-tmp

Edit the /initrd-tmp/linuxrc or other parts of the initrd such as copying filesystem modules from / to /initrd-tmp (do insmod in linuxrc):

    # emacs /initrd-tmp/linuxrc
    # cp -p /lib/modules/<version>/kernel/fs/<potential new root fs>.o \
      /initrd-tmp/lib/modules/<version>/kernel/drivers/fs/

Red Hat may use a shorter directory structure for modules in its initrds.

Duplicate the grub/lilo boot entry that uses the original /boot/initrd* and replace the original initrd reference in the new boot entry with /initrd-tmp (or /boot/initrd-tmp if there is no /boot filesystem and thus no lvm / logical volume). Boot via the new boot entry.

Sincerely,

Ken Fuchs <[email protected]>

author
#4 lore raw
Quoted 2 lines · Ken Fuchs
Quoted 1 line · trylinux

[...]

Quoted 8 lines
Quoted 2 lines · Brant Katkansky

You need to rebuild the kernel initrd if you change your root device, as the linuxrc script in the initrd has the root device hard-coded.

lvmcreate_initrd(8) can be used to do this, but one might learn more by using the following manual approach.

[...]

Thanks!

Cheers,
Rob

#5 lore raw
In reply to trylinux
Quoted 10 lines · trylinux

Activating logical volumes
vgchange -- volume group "rootvg" successfully activated

Mounting root filesystem
mount: error 2 mounting ext3
pivotroot: pivot_root(/sysroot,/sysroot/initrt) failed: 2 umount /initrd/proc failed: 2
Freeing unused kernel memory: 136k freed

Kernel panic: No init found. Try passing init= option to kernel.

it is possible that initrd has hardcoded the device name for the root fs? i do not know what exactly is the code in fedora's initrd. try remaking the initrd (and be sure the fstab is correct before that)

L.

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \