dmraid works with my TX-2000

Molle Bestefich molle.bestefich at
Wed Apr 20 16:57:39 UTC 2005

Dick wrote:
> I've also switched to udev, which brought some problems, what is the preferred
> way to get the device nodes from initrd its /dev/mapper to the
> root /dev/mapper? Rerunning dmraid -ay doesn't seem to work, any tips on
> this?

Good question, I was wondering myself.

I used my own modified version of Gerte's dmraidinitrd to create the
initrd - basically just added some device nodes for hdi and hdk and
removed all the compilation stuff.

I also modified Gerte's linuxrc and Gentoo's /sbin/rc.  Probably only
useful if you're running Gentoo, don't know if this will apply
anywhere else.

I modified linuxrc to copy the device-mapper nodes from the initrd
filesystem (where dmraid "created" them) to the "static" /dev, eg. a
/dev/mapper folder in the root filesystem (line 163, just before

echo -e "${GOOD}>>${NORMAL}${BOLD} Copying device-mapper nodes...${NORMAL}"
rm -rf /newroot/dev/mapper
mkdir /newroot/dev/mapper
cp -dpr /dev/mapper/* /newroot/dev/mapper/

Also, I modified Gentoo's /sbin/rc script to save the device-mapper
nodes before it mounts udev and restore them afterwards (line 184):

        if [ "${udev}" = "yes" ]
                ebegin "Backing up device-mapper nodes"
                rm -rf /tmp/dm_stuff
                mkdir /tmp/dm_stuff
                cp -dpr /dev/mapper/* /tmp/dm_stuff/
                rm -f /tmp/dm_stuff/control
                eend 0
                # <ramfs stuff here>
                # <populate /dev with device nodes here>
                ebegin "Removing stale device-mapper nodes"
                for file in /dev/mapper/*; do
                        short=`basename $file`
                        if [ "$short" != "control" ]; then
                                rm -f $file
                eend 0
                ebegin "Restoring device-mapper nodes"
                cp -dpr /tmp/dm_stuff/* /dev/mapper/
                rm -rf /tmp/dm_stuff
                eend 0

Works like a charm.

Gentoo also has a /etc/dmtab that could perhaps be used - I avoided it
because I like my system to discover the RAID configuration at each
bootup instead of having hardcoded somewhere.

More information about the Ataraid-list mailing list