Skip to contentSkip to conversation

RAID 5 questions

DISCUSSION Ninti Systems 10 participants 15 messages Aug 1, 2004 – Aug 6, 2004 MD RAID

lore
Share & tools
lore
#0 lore raw

I'm about to embark on building a RAID 5 Linux software array with 4 disks (I've only ever built 2 disk RAID 1 arrays before).

Q1: Is it true that Linux can't/shouldn't boot off a RAID 5 array?

Q2: The four disks have identical manufacturer, model and size, but two are brand new while two have had NTFS filesystems on them. Accordingly, if I run hdparm -g on them, two disks have these specs:

geometry = 2498/255/63, sectors = 40132503, start = 0

while the other two disks have these specs:

geometry = 39813/16/63, sectors = 40132503, start = 0

Is this an issue with software RAID?

Thanks
Michael Hall

#1 lore raw
Quoted 4 lines · Ninti Systems

I'm about to embark on building a RAID 5 Linux software array with 4 disks (I've only ever built 2 disk RAID 1 arrays before).

Q1: Is it true that Linux can't/shouldn't boot off a RAID 5 array?

Grub certainly can't boot of a software RAID-5 array, and I don't believe that lilo can either. This is because of these tools not understanding the RAID-5 disk layout, not any other limitation.

Quoted 11 lines

Q2: The four disks have identical manufacturer, model and size, but two are brand new while two have had NTFS filesystems on them. Accordingly, if I run hdparm -g on them, two disks have these specs:

geometry = 2498/255/63, sectors = 40132503, start = 0

while the other two disks have these specs:

geometry = 39813/16/63, sectors = 40132503, start = 0

Is this an issue with software RAID?

No. Software RAID, unlike hardware raid, cares only that you have enough blocks on the disk. You don't need to match *any* other characteristic of the disks, and not even that if you don't mind wasting a few bytes.

Daniel

Signature · 2 lines
The PC is the LSD of the '90s.
        -- Timothy Leary, __Guardian_ (June 1, 1996)
#2 lore raw
In reply to Ninti Systems
Quoted 1 line

Q1: Is it true that Linux can't/shouldn't boot off a RAID 5 array?

LILO does not support booting off of RAID 5, and I don't think GRUB does either. I usually make a small RAID-1 partition to boot from (mirrored across all four drives), since LILO does handle that just fine.

Quoted 1 line

geometry = 2498/255/63, sectors = 40132503, start = 0

..

Quoted 2 lines

geometry = 39813/16/63, sectors = 40132503, start = 0 Is this an issue with software RAID?

No.

-jim

#3 lore raw
Quoted 4 lines · Jim Paris
Quoted 1 line

geometry = 2498/255/63, sectors = 40132503, start = 0

..

Quoted 2 lines

geometry = 39813/16/63, sectors = 40132503, start = 0 Is this an issue with software RAID?

no but it'd be better/faster/easier to put 1 disk per ide cable
- its $20 or less to get a promise ide controller

- or if you're brave, to disable the onboard raid in the bios and use its connectors as regular ide

1 disk per ide cable if you can ...

c ya
alvin

#4 lore raw
In reply to Jim Paris

Umm, I maybe writing on complitely different setup (can't check the original post), but our server with software raid 5 (3 disks) is booting with lilo just fine.

BR,
Jarmo

Quoted 24 lines · Jim Paris
Quoted 1 line

Q1: Is it true that Linux can't/shouldn't boot off a RAID 5 array?

LILO does not support booting off of RAID 5, and I don't think GRUB does either. I usually make a small RAID-1 partition to boot from (mirrored across all four drives), since LILO does handle that just fine.

Quoted 1 line

geometry = 2498/255/63, sectors = 40132503, start = 0

..

Quoted 2 lines

geometry = 39813/16/63, sectors = 40132503, start = 0 Is this an issue with software RAID?

No.

(quoted diff) +0 -2
-jim
-

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

#5 lore raw
Quoted 1 line · Jarmo Järvenpää

Umm, I maybe writing on complitely different setup (can't check the original post), but our server with software raid 5 (3 disks) is booting with lilo just fine.

check your setup, but your kernel is not on a raid 5 device.

L.

Signature · 10 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \
-
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
#6 lore raw

Hmm, we have 3 SW raid5 devices (md0, md1 and md3), with kernel on md0. Lilo.conf has root and boot=/dev/md0. Lilo v22.3.1.

Quoted 8 lines · Luca Berra
Quoted 1 line · Jarmo Järvenpää

Umm, I maybe writing on complitely different setup (can't check the original post), but our server with software raid 5 (3 disks) is booting with lilo just fine.

check your setup, but your kernel is not on a raid 5 device.

L.

-
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

#7 lore raw
In reply to Jarmo Järvenpää
Quoted 3 lines

Umm, I maybe writing on complitely different setup (can't check the original post), but our server with software raid 5 (3 disks) is booting with lilo just fine.

README.raid from lilo-22.5.9 (the latest version) states:

"Only RAID1 is supported. LILO may be used to boot a system containing other RAID level partitions, but it may not be installed on any RAID partition other than RAID level 1."

so I don't believe you. You may be confusing "booting off RAID-5" with "having a RAID-5 root".

-jim

#8 lore raw
Quoted 8 lines · Jim Paris

README.raid from lilo-22.5.9 (the latest version) states:

"Only RAID1 is supported. LILO may be used to boot a system containing other RAID level partitions, but it may not be installed on any RAID partition other than RAID level 1."

so I don't believe you. You may be confusing "booting off RAID-5" with "having a RAID-5 root".

Hmm, I'm not sure how to convince you :-)

The only possibility I can think of is that the lilos.conf's raid-extra-boot= -line affects the booting, thus it's silently booting from /dev/hdX and not from /dev/md0. I'm not sure how to test this though.

BR,
Jarmo

#9 lore raw
Quoted 5 lines · Jarmo Järvenpää
Quoted 3 lines · Jim Paris

README.raid from lilo-22.5.9 (the latest version) states:

"Only RAID1 is supported. LILO may be used to boot a system

yep. and even that may go wrong.

Quoted 1 line

Hmm, I'm not sure how to convince you :-)

try running lilo with -v -v -v

Then you might see the BIOS drive number, geometry it assumes etc. You will probably see only _one_ disk and in that case your system boots by sheer luck.

With -v -v -v I discovered why my system refused to boot from raid 1. It appears to actually boot from the first disk in the raid set, e.g:

	md1 : active raid1 hdg1[1] hda1[0]
				   ^^^^^^^

This is mounted on /boot and lilo will boot from hda1 (bios disk 0x80). I had to reassemble the raid set in opposite order to get this because hdg is unbootable (lilo assumed bios drive 0x81). But maybe my lilo is old (21.4-4).

Signature · 5 lines
Frank
-
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
#10 lore raw
Quoted 9 lines · Frank van Maarseveen

try running lilo with -v -v -v

Then you might see the BIOS drive number, geometry it assumes etc. You will probably see only _one_ disk and in that case your system boots by sheer luck.

With -v -v -v I discovered why my system refused to boot from raid 1. It appears to actually boot from the first disk in the raid set, e.g:

Quoted 10 lines
	md1 : active raid1 hdg1[1] hda1[0]
				   ^^^^^^^

This is mounted on /boot and lilo will boot from hda1 (bios disk 0x80). I had to reassemble the raid set in opposite order to get this because hdg is unbootable (lilo assumed bios drive 0x81). But maybe my lilo is old (21.4-4).

You can do this sort of thing to override lilo's idea of which linux device maps to which BIOS disk number e.g. I use this on one box:

disk=/dev/hda

       bios=0x80

boot=/dev/hda

#disk=/dev/hdf
# bios=0x80
#boot=/dev/hdf

# Specifies the device that should be mounted as root. (`/') #
root=/dev/md3

I run lilo twice (once with the hda lines uncommented, and once with the hdf lines uncommented) - so that the system will still boot with hda pulled from the machine - with hda broken, the machine still won't boot, but at least you can disconnect hda at that point, or disable it in the BIOS (so that hdf becomes 0x80)...

You can do a similar thing with grub, but with the advantage that you don't have to play around with the config file every time you upgrade the kernel (you could use two different lilo.conf's I suppose)...

I'm not sure if this has already been stated (Frank just implied it), but a simple workaround to the original problem is to make a small RAID1 /boot partition on a couple of the disks, and have the rest of the drives carved up as RAID5, and I think that if you're using lilo to load the kernel off RAID5, then you're being lucky (AFAIK).

e.g. I sometimes do this:

drive1 drive2 drive3 drive4
[ boot(raid1) ] [ swap(raid1) ]

[     more-swap (raid5)        ]
[        /root  (raid5)        ]
[        /other (raid5)        ]

Tim.

#11 lore raw
In reply to Ninti Systems
Quoted 1 line · Ninti Systems

Q1: Is it true that Linux can't/shouldn't boot off a RAID 5 array?

it cannot no boot loader can load the kernel from a striped (or raid 3/4/5/6) device
create a small raid 1 array spanning the 4 disks and use it for /boot

Quoted 5 lines

Q2: The four disks have identical manufacturer, model and size, but two are brand new while two have had NTFS filesystems on them. Accordingly, if I run hdparm -g on them, two disks have these specs:

geometry = 2498/255/63, sectors = 40132503, start = 0

...

Quoted 3 lines

geometry = 39813/16/63, sectors = 40132503, start = 0

Is this an issue with software RAID?

no, nevertheless if you wipe the partition table on the to 'used' disks linux will see them just like the 'new' ones.

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \
#12 lore raw
In reply to Ninti Systems
Quoted 2 lines · Ninti Systems

Q1: Is it true that Linux can't/shouldn't boot off a RAID 5 array?

From software RAID it can't.

USB storage devices (memory stick) are incredibly useful for this -- I've even booted a webserver from a digital camera ;-). The only catch may be the latency of the USB code when you don't want to use initrd:
The kernel panics (no root dev) because it takes noticeable time before the kernel sees an USB storage device. But there are several tiny patches for this, it's merely a nuisance.

Signature · 1 line
Frank
#13 lore raw
Quoted 4 lines · Frank van Maarseveen
Quoted 2 lines · Ninti Systems

Q1: Is it true that Linux can't/shouldn't boot off a RAID 5 array?

Quoted 8 lines
Quoted 1 line

From software RAID it can't.

USB storage devices (memory stick) are incredibly useful for this -- I've even booted a webserver from a digital camera ;-). The only catch may be the latency of the USB code when you don't want to use initrd:
The kernel panics (no root dev) because it takes noticeable time before the kernel sees an USB storage device. But there are several tiny patches for this, it's merely a nuisance.

Personally I use sw raid5 as my /, and as I messed up and now can't fix it to work with a /boot, I instead use a lilo'ed 3.5 inch bootdisk, which loads the kernel and mounts root. *shrugs* it works fairly well, I can't complain much.

Tim McGrath

#14 lore raw
In reply to Frank van Maarseveen
Followup to:  <20040801102430.GC28625@janus>
By author:    Frank van Maarseveen <[email protected]>
In newsgroup: linux.dev.raid
Quoted 7 lines · Ninti Systems
Quoted 2 lines

Q1: Is it true that Linux can't/shouldn't boot off a RAID 5 array?

From software RAID it can't.

Actually, it should be able to if the firmware can see all the drives, AND you're not running it in degraded mode. Obviously not a good solution. Use RAID-1 for /boot.

-hpa