Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 80902

Summary: mkinitrd does not create working initrd.img file when using raid1
Product: [Retired] Red Hat Linux Reporter: Heinz Ruffieux <ruffieux>
Component: mkinitrdAssignee: Erik Troan <ewt>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: athlon   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-14 22:22:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
Working version of initrd file
none
Non working version of initrd file created with mkinitrd none

Description Heinz Ruffieux 2003-01-02 01:01:49 UTC
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-02 01:06:57 UTC
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-02 01:12:58 UTC
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 22:22:17 UTC
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