Bug 80902 - mkinitrd does not create working initrd.img file when using raid1
mkinitrd does not create working initrd.img file when using raid1
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: mkinitrd (Show other bugs)
8.0
athlon Linux
medium Severity medium
: ---
: ---
Assigned To: Erik Troan
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-01 20:01 EST by Heinz Ruffieux
Modified: 2007-04-18 12:49 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-14 17:22:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Working version of initrd file (177.00 KB, application/octet-stream)
2003-01-01 20:06 EST, Heinz Ruffieux
no flags Details
Non working version of initrd file created with mkinitrd (136.35 KB, application/octet-stream)
2003-01-01 20:12 EST, Heinz Ruffieux
no flags Details

  None (edit)
Description Heinz Ruffieux 2003-01-01 20:01:49 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.0.1) Gecko/20021003

Description of problem:
Hi,

Apparently the mkinitrd command does not create the initrd file (the ramdisc)
correctly to reflect the "root on raid" situation. Problems found:

1) /dev/md0 devices was missing in the initrd file
2) raidautorun /dev/md0 statement was missing in linuxrc file
3) mount --ro -t ext3 /dev/root /sysroot was not correct
   (--default option was used in addition, don't know
    if this is important)
4) umount /proc statement was missing. umount /initrd/proc
   was used in stead.

Please find below the working and the non-working files.

----ATTACHEMENTS------------------------------------

#Working linuxrc file 


#!/bin/nash

echo "Loading raid1 module"
insmod /lib/raid1.o
echo "Loading jbd module"
insmod /lib/jbd.o
echo "Loading ext3 module"
insmod /lib/ext3.o
echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Creating root device
mkrootdev /dev/root
raidautorun /dev/md0
echo 0x0100 > /proc/sys/kernel/real-root-dev
echo Mounting root filesystem
mount --ro -t ext3 /dev/root /sysroot
umount /proc
pivot_root /sysroot /sysroot/initrd

---------------------------------------------

# Linuxrc file with problems created by mkinitrd

#!/bin/nash

echo "Loading jbd module"
insmod /lib/jbd.o
echo "Loading ext3 module"
insmod /lib/ext3.o
echo "Loading raid1 module"
insmod /lib/raid1.o
echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Creating block devices
mkrootdev /dev
echo Creating root device
mkrootdev /dev/root
echo 0x0100 > /proc/sys/kernel/real-root-dev
echo Mounting root filesystem
mount --defaults --ro -t ext3 /dev/root /sysroot


-------------------------------------------
[ruffieux@locarno tmp]$ cat /etc/fstab
/dev/md0                /                       ext3    defaults        1 1
/dev/hdb1               /boot                   ext3    defaults        1 2
/dev/md1                /home                   ext2    defaults        1 2
/dev/md2                /opt                    ext3    defaults        1 2
/dev/md3                /var                    ext3    defaults        1 2
/dev/md4                /tmp                    ext3    defaults        1 2
/dev/hdb9               swap                    swap    defaults        0 0

none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0

/dev/cdrom              /mnt/cdrom              iso9660 noauto,owner,kudzu,ro 0
0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0
/dev/sda1               /mnt/camera             vfat    noauto,owner 0 0
/dev/cdrom1             /mnt/cdrom1             iso9660 noauto,owner,kudzu,ro 0
0
[ruffieux@locarno tmp]$

---------------------------------------------------------

[ruffieux@locarno tmp]$ cat /etc/raidtab

raiddev /dev/md0                        # /
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/hdb2
        raid-disk       0
        device          /dev/hda2
        raid-disk       1

raiddev /dev/md1                        # /home
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/hdb5
        raid-disk       0
        device          /dev/hda5
        raid-disk       1

raiddev /dev/md2                        # /opt
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/hdb6
        raid-disk       0
        device          /dev/hda6
        raid-disk       1

raiddev /dev/md3                        # /var
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/hdb7
        raid-disk       0
        device          /dev/hda7
        raid-disk       1

raiddev /dev/md4                        # /tmp
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/hdb8
        raid-disk       0
        device          /dev/hda8
        raid-disk       1
[ruffieux@locarno tmp]$



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


How reproducible:
Always

Steps to Reproduce:
1. using command: mkinitrd -v -f --fstab=./fstab --with=raid1
/boot/initrd-2.4.18-19.8.1.img 2.4.18-19.8.0
2.
3.
    

Actual Results:  According to my list "Problems found"

Expected Results:  - linuxrc file should be created according to my posted
working version
- /dev/md0 should be included in initrd.img

Additional info:
Comment 1 Heinz Ruffieux 2003-01-01 20:06:57 EST
Created attachment 89041 [details]
Working version of initrd file

This version of file has been manually changed in order to work.
Comment 2 Heinz Ruffieux 2003-01-01 20:12:58 EST
Created attachment 89042 [details]
Non working version of initrd file created with mkinitrd

File created with command and output like below:

[root@locarno etc]# mkinitrd -v -f --fstab=./fstab --with=raid1
/boot/initrd-2.4.18-19.8.x.img 2.4.18-19.8.0
Using modules:	./kernel/fs/jbd/jbd.o ./kernel/fs/ext3/ext3.o
./kernel/drivers/md/raid1.o
Using loopback device /dev/loop0
/sbin/nash -> /tmp/initrd.B1ZOK6/bin/nash
/sbin/insmod.static -> /tmp/initrd.B1ZOK6/bin/insmod
»/lib/modules/2.4.18-19.8.0/./kernel/fs/jbd/jbd.o« ->
»/tmp/initrd.B1ZOK6/lib/jbd.o«
»/lib/modules/2.4.18-19.8.0/./kernel/fs/ext3/ext3.o« ->
»/tmp/initrd.B1ZOK6/lib/ext3.o«
»/lib/modules/2.4.18-19.8.0/./kernel/drivers/md/raid1.o« ->
»/tmp/initrd.B1ZOK6/lib/raid1.o«
Loading module jbd
Loading module ext3
Loading module raid1
[root@locarno etc]#
Comment 3 Erik Troan 2003-01-14 17:22:17 EST
you're right - this should be fixed in mkinitrd > 3.4.43 -- I can send you an
rpm if you'd like to test it

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