Growable Linux hardware RAID?
March 1, 2008 2:36 PM Subscribe
How can I make a growable hardware RAID-5 Linux system? Is LVM the right choice, or am I setting myself up for trouble? Lots of geeky details follow.
I'm setting up a home file server / project box. Consistent with my budget, I'm using only the finest, most sophisticated hardware … from 1998.
What I have is a Dell PowerEdge 2300. It has a PCI hardware SCSI RAID card, called the "PERC2/SC" (known to people outside Dell as the "AMI MegaRAID 466"), attached to a six-slot SCAII drive bay. Right now I have 4 74GB SCSI disks in the bay set up as a RAID-5. I want to have the option of adding more drives later on, bringing it up to 6x74GB in a RAID-5.
The card's BIOS configuration utility supports expanding the array volume by adding disks later on -- that's not a problem. But what I'm concerned about is the filesystem that I might build on top of that volume. Obviously I don't want to hose all my data when I install an additional drive and expand the array.
I've been doing some reading and it seems like LVM might be part of the answer, so to that end I installed Ubuntu-server, creating a small ext3 /boot partition and giving the rest of the free space to LVM as a physical volume. In fdisk, this looks basically like: (cutting block numbers)
Disk /dev/sda: 219.8 GB 26724 cylinders
/dev/sda1 1 26274 Extended
/dev/sda5* 1 31 Linux
/dev/sda6 32 26724 Linux LVM
I have this gut feeling that this won't work when I expand the array, and the "disk" that the LVM PV is sitting on (/dev/sda) suddenly increases in size. The fact that I can't find much information on growing a LVM physical volume isn't reassuring, either.
So, is this really the way to go? And if not, what's the best option? Should I forget LVM and just put the filesystem right down on the RAID volume directly? (I'm planning on using JFS for low CPU usage and easy online resizing, but I'm open to other suggestions.) Should I eliminate the /boot partition and turn the whole RAID volume into an LVM PV somehow?
posted by Kadin2048 to technology (10 answers total) 7 users marked this as a favorite
Anyway, here's my solution:
I've got all the drives in a RAID 5EE array, to which I can add drives hot and grow the device live (I do have to force linux to rescan the scsi devices when I do that, however).
Using pvcreate, I've written the PV signature direct to disk - no partition table. I'm booting off of another device, so it's not a problem. Basically, I can't figure out a way to resize a partition without bringing the disk down. Using pvresize, I can grow the PVs at will. On that, I've created my VG and LV. Pretty straightfoward.
I went with XFS since it was designed to allow filesystem expansion and is well-supported in Linux. xfs_growfs is the command you'll need.
I've tested all of this live, and it works a treat. The only part I haven't tested is dropping disk-level encryption on top of it using LUKS, but it's still a work in progress. I also haven't found a decent NAS appliance setup (ala FreeNAS, OpenFiler, etc) that allows me to resize disks hot, so I'm going to probably end up rolling a DIY solution.
I wouldn't try to boot an LVM - if I were you, I'd mirror the boot volume, install Linux on that with ext3, and do file storage on the raid 5 array.
posted by TheNewWazoo at 3:19 PM on March 1, 2008