[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: root (/) on raid 5 /boot on CF card



On 25/07/12 12:01 AM, Bob wrote:
On 07/25/2012 11:25 AM, Gary Dale wrote:
On 24/07/12 09:50 PM, Bob wrote:
Hi I'm trying to upgrade my personal web server & I have a 4 port
SATA2 PCI card with the 4 Hard Drives connected, I'm putting a 1GB
swap partition at the front of each of the 4 500GB drives and the rest
is / in an mdadm software RAID5 configuration.

I know you cant boot a RAID5 system directly so I've tried having
/boot on a 4GB CF card connected to the on-board IDE bus, and also on
2 in a RAID1 configuration,

8< snip my woes

Actually, you can boot directly into a RAID5 array using Debian/Wheezy.
However, depending on your disk drives, it may not happen automatically.

The problem I've encountered is that the Debian installer doesn't
install Grub on all the disks in the array. It may not be on the one
that your machine tries to boot from.

The solution is simple - boot into a rescue console and install grub on
all the disks.

I've found this to be preferable to the older standby of creating a
RAID1 /boot partition. With kernels getting larger, you need every
larger /boot partitions to handle more than a couple. That ends up
causing problems fairly quickly if people aren't used to removing old
kernels.

So my advice is to just try to boot directly into RAID5 using a single /
partition (although I would advise having a separate /home partition).
Simply upgrade to Wheezy, which is becoming pretty stable now, install
grub on all 4 drives, and enjoy.

NOTE: with Wheezy there is no problem booting into a partitioned RAID5
array either. It works. I know because I have a machine that does it. So
have /dev/md0p1 as / and /dev/md0p2 as /home. That way there is less
chance of a file system corruption wiping out everything.

I look forward to booting directly into a RAID5 array on my workstation, I'll give it a go next week so thanks for your advice on that, the problem is this is my gallery web server & I'm reluctant to run testing on an internet exposed box.

Because the motherboard doesn't have anything connected to the IDE bus I thought it would be good to put a spare CF card in and boot off that, this also means the CF card is nearly always /dev/sda so grub goes onto the MBR there by default.

I'm never convinced by the need for separate partitions for / and /home, if you have a decent backup strategy and you're a little careful doing updates I'm not sure it adds much, particularly on a single purpose box like this, I don't usually even partition drives in my RAID5 arrays, the only reason I am this time is because I want a swap partition or 4.

I'd've thought that with boot on /dev/sda1 and grub on the MBR of that drive a RAID5 array /dev/sd(b,c,d,e)2 for / should be pretty easy to boot but so far I've been proven wrong.

With Squeeze you may still be able to boot into a RAID5 array. I haven't tried it. However, I will note that Squeeze does have a problem with partitioned RAID5 arrays as /. It uses the wrong UUID even when /boot is on RAID1, making booting a bit of a problem.

I've had to resort to a script to run sed against /boot/grub/grub.cfg to correct the UUIDs after grub is updated.

Since you're using an unpartitioned array, that shouldn't be a problem.

re. testing on an Internet box: shouldn't be a big issue. You just have to run updates every day until it becomes stable.

re. partitioning RAID5 arrays: it just seems more logical to do the partitioning. /dev/md0 is a logical device. Few people run a file system directly on a physical device. They partition it instead, even when they only have one partition. Most tools expect partitions even when the drive is logical instead of physical. Mdadm has picked up on this.

If you have separate / and /home partitions, you can reformat / for a clean install. Otherwise you may have garbage left over from an old install. Also, / is more likely to become corrupt from misbehaving programs than /home is. You can check the smaller / partition more frequently than /home.


Reply to: