Skip to contentSkip to conversation

Making bootable SATA RAID1 array in Mandriva 2006

DISCUSSION andy liebman 4 participants 7 messages Aug 13, 2006 – Aug 15, 2006 MD RAID

lore
Share & tools
lore
#0 lore raw

Hi,

I have spent the better part of this weekend struggling to get a SATA RAID1 array to boot in Mandriva 2006. I have read EVERYTHING I can find that's related. I'm stuck. Maybe somebody can point me in the right direction.

First, let me say it's not practical for me to compile all necessary drivers into the kernel. I realize that might make like easier.

So, here's the story in summary:

-- I have a motherboard with an ICH5 SATA chipset
-- My normal Mandriva installation boots off of SATA (in real SATA mode, not pretending to be IDE).
-- A while back, when I installed the bootloader on the single SATA drive, I chose to put it in the MBR and NOT on the first partition (I fear that might be part of the problem)
-- I added a second SATA drive, /dev/sdb, which came up fine.
-- I copied the partition layout from /dev/sda with sfdisk
-- I created two RAID1 devices from /dev/sdb1 and /dev/sdb6, with their counterparts "missing" (using mdadm)
-- I formated the two md devices with ext3
-- I rebooted with a LIVE CD version of Mandriva
-- I copied the contents of /dev/sda1 (/ partition) and /dev/sda6 (/home partition) to /dev/sdb1 and /dev/sdb6 using rsync.
-- I edited fstab and lilo.conf on the the RAID1 "/" partition so that they would refer to /dev/md1
-- I ran chroot on the /dev/md1 partition
-- I set up an /etc/mdadm.conf file (using mdadm --detail --scan>>/etc/mdadm.conf -- that's where Mandriva puts it)
-- I added to lilo.conf "raid-extra-boot= and tried both "mbr" and "/dev/sda,/dev/sdb"
-- I ran mkinitrd and created a new initrd in /boot on /dev/md1. I got an error about not finding the 3w_9xxx driver, but I don't need to load that in the initrd anyway so I reran with --builtin=3w_9xxx so that mkinitrd would skip that driver that I don't need.

BUT, after all of this, I get a bunch of errors when I try to run lilo:

    Fatal: Trying to map files from unnamed device 0x0000

or

trying map files unnamed

I tried putting an MBR on /dev/sdb with:
lilo -M /dev/sdb

I tried booting without /dev/sda and of course there's no bootloader on /dev/sdb so nothing happens.

Does anybody see a solution or see what I'm missing? Help would be appreciated. I can't believe this is so complicated! :(

Regards,
Andy Liebman

#1 lore raw
Quoted 2 lines · andy liebman

-- I copied the contents of /dev/sda1 (/ partition) and /dev/sda6 (/home partition) to /dev/sdb1 and /dev/sdb6 using rsync.

this is not really important, but you should have used the raid devices as a target.

Quoted 3 lines

-- I edited fstab and lilo.conf on the the RAID1 "/" partition so that they would refer to /dev/md1
-- I ran chroot on the /dev/md1 partition

did you mount /dev, /proc and /sys before chrooting? i.e
mount --bind /dev /newroot/dev
mount -t proc /proc /newroot/proc
mount -t sysfs /sys /newroot/sys

Quoted 4 lines

-- I set up an /etc/mdadm.conf file (using mdadm --detail
--scan>>/etc/mdadm.conf -- that's where Mandriva puts it)
-- I added to lilo.conf "raid-extra-boot= and tried both "mbr" and "/dev/sda,/dev/sdb"

mbr should do

Quoted 5 lines

-- I ran mkinitrd and created a new initrd in /boot on /dev/md1. I got
an error about not finding the 3w_9xxx driver, but I don't need to load that in the initrd anyway so I reran with --builtin=3w_9xxx so that mkinitrd would skip that driver that I don't need.

BUT, after all of this, I get a bunch of errors when I try to run lilo:

    Fatal: Trying to map files from unnamed device 0x0000

Regards,
L.

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \
#2 lore raw
Quoted 5 lines · Luca Berra
Quoted 2 lines · andy liebman

-- I copied the contents of /dev/sda1 (/ partition) and /dev/sda6 (/home partition) to /dev/sdb1 and /dev/sdb6 using rsync.

this is not really important, but you should have used the raid devices as a target.

Just a question. Did you copy the file system or the block device? I am not familiar with rsync but I can think that it is a problem to sync the file system so the block devices become 1:1 with each other.

Henrik Holst

#3 lore raw
In reply to andy liebman

Hi Andy,

I did the same a few times (!) with a Debian stable. I found two pages with "recipes" that were convenient to me. For what could be related to you, I had to modify the "/etc/mkinirtd/mkinitrd.conf" file :

Quoted 14 lines

If you are using a SATA drive you pay attention!

edit /etc/mkinitrd/mkinitrd.conf and change:

MODULES=most

to

    ###MODULES=most
    MODULES=dep

and

Quoted 8 lines

ROOT=probe

to

    ###ROOT=probe
    ROOT="/dev/md2 jfs"

This tells init to use what it takes to boot off of a raid device not the /dev/sda device currently used.

(modify according to your specs) The first part (mo=dep) is not mandatory (it just makes a smaller image), but the second is!

I took this form this page :
http://www.xtronics.com/reference/SATA-RAID-debian-for-2.6.html

this other page is useful if you want to use grub instead of lilo (but part of it is about IDE drive, which is not useful here) :
http://www.epimetrics.com/topics/one-page?page_id=421&topic=Bit-head%20Stuff&page_topic_id=120

hope that helps.

Laurent

Quoted 55 lines · andy liebman

Hi,

I have spent the better part of this weekend struggling to get a SATA RAID1 array to boot in Mandriva 2006. I have read EVERYTHING I can find that's related. I'm stuck. Maybe somebody can point me in the right direction.

First, let me say it's not practical for me to compile all necessary drivers into the kernel. I realize that might make like easier.

So, here's the story in summary:

-- I have a motherboard with an ICH5 SATA chipset
-- My normal Mandriva installation boots off of SATA (in real SATA
mode, not pretending to be IDE).
-- A while back, when I installed the bootloader on the single SATA
drive, I chose to put it in the MBR and NOT on the first partition (I fear that might be part of the problem)
-- I added a second SATA drive, /dev/sdb, which came up fine.
-- I copied the partition layout from /dev/sda with sfdisk
-- I created two RAID1 devices from /dev/sdb1 and /dev/sdb6, with
their counterparts "missing" (using mdadm)
-- I formated the two md devices with ext3
-- I rebooted with a LIVE CD version of Mandriva
-- I copied the contents of /dev/sda1 (/ partition) and /dev/sda6
(/home partition) to /dev/sdb1 and /dev/sdb6 using rsync.
-- I edited fstab and lilo.conf on the the RAID1 "/" partition so that
they would refer to /dev/md1
-- I ran chroot on the /dev/md1 partition
-- I set up an /etc/mdadm.conf file (using mdadm --detail
--scan>>/etc/mdadm.conf -- that's where Mandriva puts it)
-- I added to lilo.conf "raid-extra-boot= and tried both "mbr" and
"/dev/sda,/dev/sdb"
-- I ran mkinitrd and created a new initrd in /boot on /dev/md1. I
got an error about not finding the 3w_9xxx driver, but I don't need to load that in the initrd anyway so I reran with --builtin=3w_9xxx so that mkinitrd would skip that driver that I don't need.

BUT, after all of this, I get a bunch of errors when I try to run lilo:

    Fatal: Trying to map files from unnamed device 0x0000

or

trying map files unnamed

I tried putting an MBR on /dev/sdb with:
lilo -M /dev/sdb

I tried booting without /dev/sda and of course there's no bootloader on /dev/sdb so nothing happens.

Does anybody see a solution or see what I'm missing? Help would be appreciated. I can't believe this is so complicated! :(

Regards,
Andy Liebman

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 19 lines · [email protected] wrote:

Hi Andy,

I did the same a few times (!) with a Debian stable. I found two pages with "recipes" that were convenient to me. For what could be related to you, I had to modify the "/etc/mkinirtd/mkinitrd.conf" file :

Quoted 16 lines

If you are using a SATA drive you pay attention!

edit /etc/mkinitrd/mkinitrd.conf and change:

MODULES=most

to

    ###MODULES=most
    MODULES=dep

and

ROOT=probe

Quoted 8 lines
Quoted 6 lines

to

    ###ROOT=probe
    ROOT="/dev/md2 jfs"

This tells init to use what it takes to boot off of a raid device not the /dev/sda device currently used.

(modify according to your specs) The first part (mo=dep) is not mandatory (it just makes a smaller image), but the second is!

Thank you Laurent. I saw that in the same "how to" document. The problem is, Mandriva does NOT have a mkinitrd.conf.

I could create it, but I don't know if mkinitrd will use it! In Mandriva, it probably just has to be in /etc/ if if's useful at all.

Andy

#5 lore raw

Hi Andy,

there are options for the "mkinitrd" command, that are like the parameters in "mkinitrd.conf" (this is the case in "Debian"). did you use the -root=xxx option?

Laurent

Quoted 36 lines · andy liebman
Quoted 19 lines · [email protected] wrote:

Hi Andy,

I did the same a few times (!) with a Debian stable. I found two pages with "recipes" that were convenient to me. For what could be related to you, I had to modify the "/etc/mkinirtd/mkinitrd.conf" file :

Quoted 16 lines

If you are using a SATA drive you pay attention!

edit /etc/mkinitrd/mkinitrd.conf and change:

MODULES=most

to

    ###MODULES=most
    MODULES=dep

and

ROOT=probe

Quoted 8 lines
Quoted 6 lines

to

    ###ROOT=probe
    ROOT="/dev/md2 jfs"

This tells init to use what it takes to boot off of a raid device not the /dev/sda device currently used.

(modify according to your specs) The first part (mo=dep) is not mandatory (it just makes a smaller image), but the second is!

Thank you Laurent. I saw that in the same "how to" document. The problem is, Mandriva does NOT have a mkinitrd.conf.

I could create it, but I don't know if mkinitrd will use it! In Mandriva, it probably just has to be in /etc/ if if's useful at all.

Andy

#6 lore raw
Quoted 3 lines · Laurent Lesage

Hi Andy,

there are options for the "mkinitrd" command, that are like the parameters in "mkinitrd.conf" (this is the case in "Debian"). did you use the -root=xxx option?

Laurent, mkinitrd in debian and mandriva are two completely different beasts, there is no relation between those two.

besides that, i believe that all Andy has to do for mkinitrd is mounting /sys on the chroot before running mkinitrd.

there is no mkinitrd.conf on mandriva.
mkinitrd will use fstab to find the root filesystem, so the change Andy did is correct.

and please, please, stop top-posting and try to quote relevant parts of messages when answering, or the thread will become unreadable.

L.

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \