Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107171 - raidtools fails to initialize some md devices on devfs at startup
Summary: raidtools fails to initialize some md devices on devfs at startup
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-25 06:07 UTC by Laszlo Valko
Modified: 2005-09-25 15:10 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laszlo Valko 2005-09-25 06:07:59 UTC
There's a script called /lib/rcscripts/addons/raid-start.sh. In there,

create_devs() {
        local d
        for d in $@ ; do
                d=${d/\/dev\/}
                [[ -e /dev/${d} ]] && continue
                mknod /dev/${d} b ${MAJOR} ${d##*md} >& /dev/null
        done
}

is used to create any missing md device nodes at startup. It is assumed that the 
device name is /dev/md<number> where <number> is the minor number.

However, devfs is using /dev/md/<number>, so in case this function has to create 
the device node, it fails as it cannot use the string /<number> as a minor 
number.

Suggested fix:

create_devs() {
        local d
        for d in $@ ; do
                d=${d/\/dev\/}
                [[ -e /dev/${d} ]] && continue
                minor=${d##*md}
                minor=${minor##/}
                mknod /dev/${d} b ${MAJOR} ${minor} >& /dev/null
        done
}

This way it would work with both /dev/md<number> and /dev/md/<number>.


Reproducible: Always
Steps to Reproduce:
Use devfs, configure it to be mounted automatically at boot.
Create a RAID device that does not get auto-started.

For example use this configuration to create a RAID-0 stripe set - 9 - from two 
RAID devices (I used two RAID-1 groups - 7 & 8 - that do get auto-started):

raiddev /dev/md/7
        raid-level              1
        nr-raid-disks           2
        chunk-size              32k
        persistent-superblock   1
        device                  /dev/sda8
        raid-disk               0
        device                  /dev/sdc8
        raid-disk               1

raiddev /dev/md/8
        raid-level              1
        nr-raid-disks           2
        chunk-size              32k
        persistent-superblock   1
        device                  /dev/sdb8
        raid-disk               0
        device                  /dev/sdd8
        raid-disk               1

raiddev /dev/md/9
        raid-level              0
        nr-raid-disks           2
        chunk-size              32k
        persistent-superblock   1
        device                  /dev/md/7
        raid-disk               0
        device                  /dev/md/8
        raid-disk               1

Then reboot.

Actual Results:  
/dev/md/7 & 8 get auto-started (if the partition type is set correctly), however 
 /dev/md/9 does not exist, and if it is included in /etc/fstab, it will not be 
mounted.



*  sys-fs/raidtools :
        [   ] 1.00.3-r4 (0)
        [   ] 1.00.3-r5 (0)
        [  I] 1.00.3-r6 (0)
Comment 1 SpanKY gentoo-dev 2005-09-25 15:10:40 UTC
sync up and re-emerge raidtools

ive fixed this already