http://www.jross.org/recreation/computers/linux/linux-raid-5-guide/
http://www.allmyit.com.au/mdadm-growing-raid5-array-ubuntu
It is prudent to mention that all credit to any accuracy I am able to represent should be directed to one or both of these sources, and that any errors should be attributed to my amateurish attempt at reconstructing the procedure for my particular system. Also, the reader should keep in mind that I haven't yet taken any of my required Unix courses. I've been using Linux for about seven years, but my Terminal proficiency is still admittedly that of a n00b.
This procedure is for the growing of a software RAID 5 array with mdadm in Fedora 18. It assumes an existing, functioning, RAID 5 array on a Fedora 18 system using the ext4 filesystem. (The procedure is similar for Debian and Ubuntu derivatives, but the location of 'mdadm.conf' is different, and they use the 'apt-get' software management package instead of Fedora's 'yum'.) This entire blog entry has the singular function as my personal reference for what works on my system, and I am NOT RESPONSIBLE for any problems (data loss, etc.) associated with any attempts at replicating this procedure, all of which are strongly discouraged.
Background:
The system consists of:
Hardware:
- CPU: Intel Core2Quad Q6600 @ 2.4 GHz
- RAM: 3x 2GB Corsair XMS3 DDR3 1600 MHz (I recently had a 4th stick test bad in PC-Check and Memtest, though this is unrelated)
- GPU: NVidia GeForce GTX 650 (2GB GDDR5) on PNY XLR8 PCIe x16 card (1x 6pin PCIe power connection)
- PSU: BFG 550W (modular)
- Board: Intel Extreme Edition DP45SG
- HDDs: 4x WD Green 500GB 7200rpm (3.5" SATA)
- 1x WD Black 500GB 7200rpm (3.5" SATA)
- 1x WD Blue 500GB 7200rpm (2.5" SATA)
- Additional Hardware:
- Rosewill RC-209-EX (w/ 4x internal SATA connections for (3x of the Green-series drives) and (the Blue-series drive.))
- Chipset: Silicon Image SiI3114 SATA controller chip
- ASUS SATA DVD-RW drive
Applicable Software:
- OS: Fedora 18 x86_64
- Software RAID (/ FakeRAID): mdadm (current as of 05/22/2013)
Prodecure:
- Physically install new drive (It is generally recommended, but not strictly required, that all drives be of the same size and speed)
- Boot
- Open a Terminal window and type (each line followed by [Enter]):
- su
- [Type Password]
- yum install gparted
- y
- yum update
- [Close Terminal after update is complete]
- Open GPartEd
- Format new drive with the same filesystem as used when the array was initially created.
- (I'm using ext4, which I understand is recommended over ext3 for arrays within the >1TB range)
- Once complete, close GPartEd and Open another Terminal Window and type (each line followed by Enter):
- su
- [Type Password]
- mdadm /dev/md[X] --add /dev/sd[Y]1
- Where: "[X]" is the number of the md-device. Mine is [X]=127.
- And Where: "[Y]" is the letter of the new drive that was just formatted. Mine is [Y]=b.
- So: my command is "mdadm /dev/md127 --add /dev/sdb1"
- mdadm /dev/md[X] -- grow --raid-devices=[Z]
- Where "[Z]" is the number of drives that will be involved in the array AFTER the new one is fully added. Mine is [Z]=6.
- So: my command is "mdadm /dev/md127 --grow --raid-devices=6"
- This typically takes a very long time (in my case, when adding the sixth drive the grow operation took approximately 8 hours).
- The progress can be monitored with the (recommended) following command:
- cat /proc/mdstat
- [When complete, I left the Terminal window open and opened a new tab ((File -> New Tab) (or) ([Ctrl] + [Shift] + [T])) and typed (each line followed by [Enter]):]
- su
- [Type Password]
- e2fsck -f /dev/md127
- resize2fs /dv/md127
- mdadm --detail --scan > /etc/mdadm.conf
- Then close Terminal
- it asked whether I was sure, so, since both Terminal tabs had returned to the "$" line where its ready for a new command, I was confident in my decision to continue closing Terminal)
- Reboot
- Open Terminal and type (followed by [Enter]):
- mount /dev/md[X]
- [/end]