My terabyte raid1 —15 October 2008
My raid1 array with two 120G disks was getting filled up lately, so when usage reached 90% I decided it’s time to upgrade. To my great surprise prices have gone much lower than I expected: I got two 1T disks for the same price as the old 120G disks – $100 apiece.
It’s been a long time since I setup my raid1 array so I had to read up on
man mdadm and
- Created a full backup of the old disks:
cd /storage; tar cvpf disk200/raid1.tar raid1
- Powered down the machine, replaced the disks, checked in BIOS they are recognized correctly.
- Started up the machine, created a single primary partition on the two new disks with
cfdisk, set the filesystem size to
1000G. This left a few hundred MB free space at the end of the disk, a safe thing to do in my experience.
- Created the raid1 md device:
mdadm --create /dev/md0 -l1 -n2 /dev/sdc1 /dev/sde1
- The resyncing of two 1T disks takes time. An easy way to monitor the progress is with
watch cat /proc/mdstat. It was more convenient for me to have a notification email sent to my mobile phone with
while cat /proc/mdstat | grep resync; do sleep 60; done; cat /proc/mdstat | mail -s mdstat email@example.com
- Once the resync is done I created filesystem on it:
/etc/fstabfilesystems are identified by UUID, not by traditional names like
/dev/md0. To follow this new practice I updated the UUID in
/etc/fstabfor the partition according to the output of
mount -acomplained about
/dev/disk/by-uuid/...missing. This is fixed by restarting udev:
- Mounted the partition with
mount -a, and restored the files:
cd /storage; tar xvpf disk200/raid1.tar