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 mdadm --help
.
- 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 to1000G
. 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 withwhile cat /proc/mdstat | grep resync; do sleep 60; done; cat /proc/mdstat | mail -s mdstat titan2x@mysupersecretmobile.com
- Once the resync is done I created filesystem on it:
mkfs.ext3 /dev/md0
- In
/etc/fstab
filesystems are identified by UUID, not by traditional names like/dev/md0
. To follow this new practice I updated the UUID in/etc/fstab
for the partition according to the output ofblkid
. mount -a
complained about/dev/disk/by-uuid/...
missing. This is fixed by restarting udev:/etc/init.d/udev restart
- Mounted the partition with
mount -a
, and restored the files:cd /storage; tar xvpf disk200/raid1.tar