Bug 190274 - mkinitrd makes bad init nash script for lvm root fs
mkinitrd makes bad init nash script for lvm root fs
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
David Lawrence
bzcl34nup
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-29 19:06 EDT by Sharif Nassar
Modified: 2008-05-06 11:51 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-06 11:51:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Sample init script created by mkinitrd (1.75 KB, text/plain)
2006-04-29 19:06 EDT, Sharif Nassar
no flags Details
Last working init script from ramdisk for kernel 2.6.16-1.2069_FC4 (1.50 KB, text/plain)
2006-04-29 19:08 EDT, Sharif Nassar
no flags Details
Working, hand created init file (2.02 KB, text/plain)
2006-06-03 06:01 EDT, Sharif Nassar
no flags Details

  None (edit)
Description Sharif Nassar 2006-04-29 19:06:58 EDT
Description of problem:
When I upgraded to FC5 from FC4 (via yum update), mkinitrd is making bad 'init'
nash script.  I cannot boot FC5 kernels, because I'm unable to create a working
ramdisk.

Version-Release number of selected component (if applicable):
mkinitrd-5.0.32-1


How reproducible:
install a kernel RPM on my machine

Steps to Reproduce:
1. install new kernel RPM
2. reboot
3. no root fs!
  
Actual results:
I don't have the exact error message right now.

Expected results:
booting 

Additional info:

/boot is a software RAID-1 mirror.
/ used to be a RAID-5 volume inside of LVM2 (volgroup VG1).
I tried migrating VG1 to a single device, but mkinitrd is still confused.
I can't find any up to date documentation for nash .
Specifically, it has a command 'resume /dev/hda2' which is not documented.
I assume it's to try to resume from suspend, since this is a swap partition.

The init script doesn't have any raidautorun commans anymore which is odd as well.

I will try rebooting to get the specific complaint from kernel as it boots.

I will also atttach my working initrd init script.
Comment 1 Sharif Nassar 2006-04-29 19:06:58 EDT
Created attachment 128401 [details]
Sample init script created by mkinitrd
Comment 2 Sharif Nassar 2006-04-29 19:08:15 EDT
Created attachment 128402 [details]
Last working init script from ramdisk for kernel 2.6.16-1.2069_FC4
Comment 3 Sharif Nassar 2006-06-03 06:01:20 EDT
Created attachment 130446 [details]
Working, hand created init file

I finally fudged together an init script that works.
I had to:
Copy lvm.static to the ramdisk.
Copy raid1 and raid10 kernel modules to the ramdisk.
Add mkdmnod, raidautostart, and lvm commands to this script.
Comment 4 Mike Freemon 2006-10-19 16:38:06 EDT
How can I make "mkinitrd" generate a correct ramdisk image when the LVM volume
group names differ between the Dom0 and DomU?

The details:

In Dom0, the root filesystem is LVM in volume group "VGShark", as follows:

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VGShark-LogVol00
                      450G  119G  308G  28% /
/dev/sda1              99M   45M   49M  48% /boot
tmpfs                 1.9G     0  1.9G   0% /dev/shm

In the DomU, the root filesystem is LVM in volume group "VolGroup00".

Back in Dom0, I run the following to create the initrd...

#mkinitrd -f initrd-2.6.16.29-xen.img 2.6.16.29-xen

...which produces the following (snippet) in the generated "init" file in the
ramdisk image:

echo Making device-mapper control node
mkdmnod
mkblkdevs
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure  VGShark
resume /dev/VGShark/LogVol01
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/VGShark/LogVol00
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot

The DomU config file is:

kernel = "/boot/vmlinuz-2.6.16.29-xen"
ramdisk = "/boot/initrd-2.6.16.29-xen.img"
root = "/dev/VolGroup00/LogVol00 ro"
name = "minnow"
memory = "512"
disk = [ 'file:/var/vm/minnow/disk0.img,xvda,w' ]
vif = [ 'mac=00:16:3e:00:e6:8f' ]
uuid = "7e6aa8bb-37da-3a7f-e72e-63290fcf2713"

..which produces the following error at domU boot time:

Making device-mapper control node
Scanning logical volumes
  Reading all physical volumes.  This may take a while...
  Found volume group "VolGroup00" using metadata type lvm2
Activating logical volumes
  Unable to find volume group "VGShark"
Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

So --

Here is the /etc/fstab (in Dom0):

#cat fstab
/dev/VGShark/LogVol00   /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
/dev/VGShark/LogVol01   swap                    swap    defaults        0 0

I copy this file to create fstab.domU, and change the references to VGShark to
VolGroup00, which is:

#cat fstab.domU
/dev/VolGroup00/LogVol00   /                    ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
/dev/VolGroup00/LogVol01   swap                 swap    defaults        0 0

This matches exactly what DomU is expecting.

I rebuild initrd with the following command:

# mkinitrd -f --fstab=/etc/fstab.domU initrd-2.6.16.29-xen.img 2.6.16.29-xen

...which produces the following (snippet) in the generated "init" file in the
ramdisk image:

mkblkdevs
resume /dev/VolGroup00/LogVol01
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/VolGroup00/LogVol00
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot

I try again to boot the DomU with the same config file listed above and I get
this error:

Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

Next --

I modify the generated "init" file in the ramdisk image to the following
(replace VGShark with VolGroup00):

mkdmnod
mkblkdevs
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure  VolGroup00
resume /dev/VolGroup00/LogVol01
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/VolGroup/LogVol00
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot

I rebuild the initrd image, and change the ramdisk line in the domU config to:

kernel = "/boot/vmlinuz-2.6.16.29-xen"
ramdisk = "/boot/initrdDomU.img"
root = "/dev/VolGroup00/LogVol00 ro"
name = "minnow"
memory = "512"
disk = [ 'file:/var/vm/minnow/disk0.img,xvda,w' ]
vif = [ 'mac=00:16:3e:00:e6:8f' ]
uuid = "7e6aa8bb-37da-3a7f-e72e-63290fcf2713"

...and the DomU boots up!

The conclusion I draw is that mkinitrd is not creating a good ramdisk image.

How can I make mkinitrd generate a correct ramdisk image when the volume group
names differ between the Dom0 and DomU?

Comment 5 Bug Zapper 2008-04-03 22:47:29 EDT
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
http://fedoraproject.org/wiki/LifeCycle/EOL

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers
Comment 6 Bug Zapper 2008-05-06 11:51:36 EDT
This bug is open for a Fedora version that is no longer maintained and
will not be fixed by Fedora. Therefore we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen thus bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.