Never Partition Part of an Active RAID Array

21 02 2009

Repeat after me: I will never change the partition table on a disk that’s part of an active RAID array. I will never change the partition table on a disk that’s part of an active RAID array. I will never change the partition table on a disk that’s part of an active RAID array. I will never change the partition table on a disk that’s part of an active RAID array…

I should’ve known this, but naturally all these lovely device aggregation technologies such as LVM, RAID, and ZFS have to store their meta-information somewhere, and that ends up being in the little holes between partitions and at the beginning and end of the disk. Changing the partition table while a RAID array is known by the system to exist on a device is likely to earn you all kinds of pain, and apparently partitioners are likely to stomp on these little areas; I found this out the hard way.

So if your root directory is on RAID and you even need to partition some free space on one of those disks, reboot the system from a rescue disk and do your work with all the RAID arrays stopped. You might even need to destroy the arrays (i.e. lose the array metadata, but not the data on the RAID partitions) and re-construct them after partitioning. And if you are going to re-partition and format the disks: explicity destroy all the RAID, ZFS, and LVM structures first—that information can hang around and come back to bite you if you don’t tell the system that your pools and volume groups are no more.

Lesson learned.

Advertisements

Actions

Information

2 responses

16 04 2009
Johan

You shouldn’t even partition a RAID array in de first place!

If you require multiple partitions, create your partitions first, and then you need to make eacht partition a different RAID array.
That’s the only right way.

With partitions, I mean “real” paritions as made by “fdisk”, not logical paritions as LVM makes.

16 04 2009
Dave Abrahams

Hi Johan,

Just to be clear, I never suggested partitioning a RAID array. I’m talking about changes to the partition table on a device that hosts part of a RAID array. For example, take a look at Hydra’s partitioning scheme. The first time I set that up, I didn’t bother to create the partitions for those last few free 100M stripes until after I already had RAIDed up the other partitions; it was all simply free space. Needless to say, when I went back with fdisk and tried to add the partitions later, with the RAID arrays running, all heck broke loose.

I still think it should be possible to change partition tables with RAID stopped without losing data, as long as you’re willing to rebuild the arrays (e.g. using mdadm) out of their constituent partitions. However, I must admit, I haven’t tested that hypothesis.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: