| Building my new disk array |
- Reliable: be that mirrored or RAIDed
- Expandable: I want to be able to drop in a new disc when I run out of space. I don't mind needing to add two identical discs if that makes point 1 easier
- Rethingable: I want to be able to remove unreliable discs from the set. If there are paired discs, then I can handle having to cycle out both at the same time.
- Non-sucky
I have an opportunity to build a new disk array for when I move house. I made a few mistakes when I built the last one (although perhaps they were because it was the best that could be done at the time), and I don't intend to repeat those mistakes. I put out a call for suggestions a little while ago, and now I've built an array I'm pretty happy with. Let's walk through it.
First off, let's start with a reminder of the requirements. Here's what I said in the previous post:
The hardware
I now have two identical USB 2.0 external hard disk enclosures, each with a 250gb Seagate Barracuda drive in it. I picked USB 2.0 because I want the disks to be easy to move, and I picked external enclosures in the hope that this would ruggedize the disks for the trip to the US just a little. They'll be travelling in my carry on luggage.
The mirroring
Both of the disks are part of a MD mirror pair, and I must say that MD is a lot nicer than last time I played with it. Here's all I needed to do to set it up (sdb2 and sdc2 are the partitions with the MD on them):
mdadm --create /dev/md1
--raid-devices=2
--spare-devices=0
--level=1
/dev/sdb2 /dev/sdc2
mdadm --detail /dev/md1
No config files in /etc like you used to. No need to do more configuration. It just works. What happened to the first partitions on the discs? They're each an 8 megabyte FAT partition with nothing in it but a meaningful name. This is so that I can tell which disk is which no matter what if they end up falling out of their labelled cases or something.
So, we have redundancy... Let's make it expandable and shrinkable
Then I used LVM to create a volume group and a logical volume on md1, which is where I will store the data. This is so I can expand and shrink the filesystem as my storage needs grow and disks fail. I currently get a disk failure per year with the current disk array (which is currently four disks), and I currently consume a little over 230gb. Yes, I know I'm going to need to buy more disk real soon, but I thought I would wait until I am in the US.
Creating the LV:
pvcreate /dev/md1 vgcreate data /dev/md1 lvcreate -L<size> -ndatalv data vgdisplay data mkfs -text3 /dev/data/datalv
And we're done. Any comments?
Tags for this post: linux(
posted at: 00:49 | path: /linux | permanent link to this entry
Comment on this post.
