Skip to content

Home > GNU/Linux > Installing Mandriva 2007 Spring (and above ...) on a RAID 0 (...)

Installing Mandriva 2007 Spring (and above ...) on a RAID 0 configuration

Monday 20 August 2007, by Stéphane Téletchéa

I encountered some problems in setting up a RAID 0 partition under Mandriva Spring since it did not recognised my setup after the reboot.

I posted a bug report and this is now solved, the incoming 2008.0 does not have the problem any more.

This page is just a little help for those who have encountered this problem and may want some tricks for debugging and solving it (this is more or less distribution-agnostic).

I set up a RAID 0 stripe under the bios, this is called fake-RAID by some since this does not abstract all the RAID features, for my little personnal system, i can live with these shortcomings.

Here we go with the simplified debugging procedure:

Getting the dm partition

dmsetup table
isw_cbbchfdche_raidmainp6: 0 165742542 linear 253:0 41608413
isw_cbbchfdche_raidmainp5: 0 33238422 linear 253:0 8369928
isw_cbbchfdche_raidmainp3: 0 20482875 linear 253:0 207350955
isw_cbbchfdche_raidmainp2: 0 198981090 linear 253:0 8369865
isw_cbbchfdche_raidmainp1: 0 8369802 linear 253:0 63
isw_cbbchfdche_raidmain: 0 1250275840 striped 2 256 8:0 0 8:16 0

This is what i could extract from the linuxrc contained in the boot partition of a fedora installation:

rmparts sdb
rmparts sda
dm create isw_cbbchfdche_raidmain 0 1250275840 striped 2 256 8:0 0 8:16 0
dm partadd isw_cbbchfdche_raidmain

Creating a correct initrd

The only thing i had to do was extracting the initrd, patching the boot sequence in order to provide the missing module (dm_mirror for instance, and dmraid.static binary to detect and setup the mirror).

- Extracting the old initrd (as root)

mkdir /root/initrd_to_correct
cd  /root/initrd_to_correct
gzip -dc /mnt/Mandriva2007Spring64/boot/initrd-2.6.17-13mdv.img | cpio -i -d

- Add the missing programs and modules

cp /sbin/dmraid.static bin/dmraid (note i pruned the .static part)
cp /lib/modules/2.6.17-13mdv/kernel/drivers/md/dm-mirror.ko.gz lib/
cp /lib/modules/2.6.17-13mdv/kernel/drivers/md/dm-mod.ko.gz lib/
cp /lib/modules/2.6.17-13mdv/kernel/drivers/md/dm-zero.ko.gz lib
cp /lib/modules/2.6.17-13mdv/kernel/drivers/scsi/scsi_wait_scan.ko.gz lib/
cp /lib/modules/2.6.17-13mdv/kernel/drivers/scsi/sd_mod.ko.gz lib/
cp /lib/modules/2.6.17-13mdv/kernel/drivers/scsi/scsi_mod.ko.gz lib/
cd lib
gunzip *.gz

- the linuxrc script (here called init) needs to be updated:

##### <- this indicates some lines of context
##### (you should already have them without the starting dashes)

##### echo "Loading usbhid.ko module"
##### insmod /lib/usbhid.ko
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.ko
echo "Loading dm-mirror.ko module"
insmod /lib/dm-mirror.ko
##### echo "Loading scsi_mod.ko module"
##### insmod /lib/scsi_mod.ko
echo "Loading sd_mod.ko module"
insmod /lib/sd_mod.ko
##### echo "Loading libata.ko module"
##### insmod /lib/libata.ko

##### mount -t sysfs none /sys
##### echo Creating device files
##### mountdev size=32M,mode=0755
##### mkdevices /dev
##### Just after the above lines (no empty line), add this:
echo Making device-mapper control node
mkdmnod
echo Activating device-mapper raid devices
dmraid -ay -i
##### echo Creating root device
##### mkrootdev /dev/root

- recreate the correct initrd

find ./ | cpio -c -o > /boot/new-initrd.img
gzip /boot/new-initrd.img

- replace the old initrd by the new one

cp /mnt/Mandriva2007Spring64/boot/initrd-2.6.17-13mdv.img /mnt/Mandriva2007Spring64/boot/initrd-2.6.17-13mdv.img_orig
mv /boot/new-initrd.img /mnt/Mandriva2007Spring64/boot/initrd-2.6.17-13mdv.img

Will the problem be solved for next releases (and a fix provided for Spring)?

To get the maximum chances, i have opened a gug report on Mandriva’s brand new bugzilla at http://qa.mandriva.com/show_bug.cgi?id=30982.

Performances

Once correctly set up, i wanted to check rapidly if getting two hard drives was faster than only one on my cmputer:

- Testing the two drives simulnateously (RAID 0):

hdparm -Tt /dev/mapper/isw_cbbchfdche_raidmain

/dev/mapper/isw_cbbchfdche_raidmain:
Timing cached reads:   17900 MB in  2.00 seconds = 8967.88 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device
Timing buffered disk reads:  354 MB in  3.02 seconds = 117.39 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

- Testing one drive:

hdparm -Tt /dev/sda

/dev/sda:
Timing cached reads:   17144 MB in  2.00 seconds = 8588.77 MB/sec
Timing buffered disk reads:  202 MB in  3.00 seconds =  67.26 MB/sec

That’s an impressive 75% boost in read! (i did more extensive tests with various conditions/load with roughly the same result). This is not exactly twice the performance but that’s worth enough setting up a RAID partition.

Installing grub on a /boot partition:

In case you messed up badly your grub configuration, this is what i picked from another web site. Beware, i provide it only for additionnal information since it is untested!!!

# Grub should not detect bios device names itself! Do this or be a fool!:
/sbin/grub --device-map=/dev/null

# (hd0,0) is the first partition on the first disk (from bios point of view!!)
grub> device (hd0,0) /dev/mapper/sil_adbibjadbcbab1

# (hd0) is the first disk (and thus containing (hd0,0) )
grub> device (hd0) /dev/mapper/sil_adbibjadbcbab

# That's it, the rest should be easy:
grub> root (hd0,0)
Filesystem type is fat, partition type 0x4

grub> setup (hd0,0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/fat_stage1_5" exists... yes
Running "embed /boot/grub/fat_stage1_5 (hd0,0)"... failed (this is not fatal)
Running "embed /boot/grub/fat_stage1_5 (hd0,0)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,0) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.

To go further


http://people.redhat.com/ heinzm/
http://tienstra4.flatnet.tudelft.nl/ gerte/gen2dmraid/
http://www.linuxquestions.org/linux/answers/Hardware/How_to_boot_from_RAID_using_dmraid
http://forums.gentoo.org/viewtopic-t-258981-highlight-gen2dmraid.html
https://bugs.launchpad.net/ubuntu/+source/mdadm/+bug/103177
http://qa.mandriva.com/show_bug.cgi?id=29989
http://qa.mandriva.com/show_bug.cgi?id=30639
http://tienstra4.flatnet.tudelft.nl/ gerte/gen2dmraid/dmraidinitrd
http://tienstra4.flatnet.tudelft.nl/ gerte/gen2dmraid/linuxrc
http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know-about-the-linux-kernel.html

Special thanks

To all who helped me in extracting the initrd, finding out the problem and solving it, most of them can be joined on irc, on #mandriva (or #mandrivafr).

P.S.

- 2008, January 16: updated the module list since scsi ones where missing.
- 2008, January 17: updated the module list AND added the -c option to the cpio parameters for recreating the archive, otherwise it does not boot.
- 2008, January 27: little update for cpio, in decompressing mode, -i -d is needed to create subdirectories.

6 Forum posts

  • Installing Mandriva 2007 Spring on a RAID 0 configuration 28 August 2007 at 23:55, by Scott Souter

    Hi Stephane,

    I suspect your experience can help me work through my issues with my attempts to use TMB kernels beyond the stock 2.6.17 version that Mandriva issues with 2007. I also use what now appears to be a software RAID using Nvidia nForce 570 SLi. I can’t get these newer kernels to boot. Here is the error I get:

    kernel (hd0,4)/boot/vmlinuz root=/dev/mapper/nvidia_gtaajjad5 acpi=off
    resume=/dev/mapper/nvidia_jfaajjad6 splash=silent vga=788

    Error 15: file not found

    As I am a newbie to Linux a more in depth howto as to what I need to modify would be very much appreciated. All other forum discussions have left me stranded.

    thx!
    Scott

    Reply to this message

    • Installing Mandriva 2007 Spring on a RAID 0 configuration 29 August 2007 at 09:56, by Stéphane Téletchéa

      It could be :-)

      Before getting very far in explanations, you could try using the mknitrd available in the devel directory, which is supposed to solve all issues (there should be somewhere a pending update waiting more feedback for being an official update, but i can’t find it atm).

      In order to install this new mkinitrd, urpme you kernel-tmb, install the new mkinitrd rpm, and reboot, it should be fine.

      In other words:

      1. urpme kernel--tmb
      2. wget mkinitrd from cooker (2008.0 to be) wget ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/cooker/media/main/release/mkinitrd-4.2.17-45mdv2008.0.i586.rpm
      3. reinstall the kernel-tmb and reboot on it, it should bes solved.

      If it does not work, feel free to contact me directly and i’ll try to provide more step by step procedure if it fails.

      Cheers,
      Stéphane

      Reply to this message

      • Installing Mandriva 2007 Spring on a RAID 0 configuration 11 May 2008 at 04:09, by Scott Souter

        Hi Stephane,

        How are you?

        I am looking to bump my storage by adding at least two more drives to my SATA RAID array. Right now I am using two drives in an RAID 1 mirror. I want to migrate to RAID 5. My system uses Nvidia MediaShield on an Nvidia NForce 570 SLI. It looks like one may have to use MS Window to do a migration using the NVidia software, but surely there is a method to do this in Mandriva 2008? Can you lend a few suggestions?

        Thx as always for your help.
        Scott

        Reply to this message

        • Installing Mandriva 2007 Spring on a RAID 0 configuration 21 May 2008 at 10:21, by Stéphane Téletchéa

          Ha, nice to see this works :-)

          I’m not sure of the question, if you need to fully migrate your data from RAID 1 to RAID 5, i’m afraid i do not have alot of information to provide to you. Diskdrake may do this correctly, but i would for sure do full backups before doing this ...

          If you mean by "MS Window to do a migration using the NVidia software" that an update of the driver may be needed, you’ll probably be able to do that using freedos (for instance) if you don’t have any windows partition.

          You can of course mail me privately if you need more precisions (i have some free time at the moment) :-)

          Cheers,
          Stéphane

          Reply to this message

        • Thanks for your good article.

          Reply to this message

Comment on this article