View previous topic :: View next topic |
Author |
Message |
Jarjar Apprentice
Joined: 21 Jul 2002 Posts: 265 Location: Sweden
|
Posted: Wed Dec 07, 2011 7:41 pm Post subject: Can my md-RAID setup be grown safely? |
|
|
I have a 3-disk RAID5 array managed by mdadm, with an XFS filesystem on top.
However, unlike many, I don't run LVM or such; I don't even have a partition table on the array, but rather a filesystem.
In other words, I didn't do:
mdadm --create ...
cfdisk /dev/md0
...
but rather did:
mdadm --create ...
mkfs.xfs /dev/md0
mount /dev/md0 /...
Can a setup like this be grown safely? I'd add a fourth partition (same size as the existing, of course), grow the array, then use xfs_growfs - AFAIK, that is. _________________ [Server etc. | C2D 2.2 @ 3.0 GHz / 4 GB RAM / 3x1 TB + 1x2 TB SATA disks + 1.5 TB ext. | Gentoo]
[Laptop | Macbook Pro 15" / Core i7 (Sandy) Quad 2.2 GHz / 16 GB RAM / Samsung 840 250 GB SSD + 1 TB + 2 TB HDD / 6750M 1 GB / OS X, Win 7] |
|
Back to top |
|
|
wildbug n00b
Joined: 07 Oct 2007 Posts: 73
|
Posted: Fri Dec 09, 2011 5:28 pm Post subject: |
|
|
Yes, you should be able to do this by adding the new disk as a hot-spare, growing the array, then growing the filesystem.
Code: | mdadm /dev/md0 --add /dev/sde
mdadm --grow /dev/md0 -n4
...
xfs_growfs /your-xfs-mount-point
|
I just double-checked this in a VM, and the following was successful:
Code: | (Create the test array)
# mdadm --create /dev/md0 --level=5 -n3 /dev/sd[bcd]
# mkfs.xfs /dev/md0
# mount /dev/md0 /mnt
# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/md0 394M 4.4M 390M 2% /mnt
(Add the new drive)
# mdadm /dev/md0 --add /dev/sde
# mdadm --grow /dev/md0 -n4
# xfs_growfs /mnt
# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/md0 595M 4.6M 590M 1% /mnt
|
|
|
Back to top |
|
|
Jarjar Apprentice
Joined: 21 Jul 2002 Posts: 265 Location: Sweden
|
Posted: Fri Dec 09, 2011 6:01 pm Post subject: |
|
|
Awesome, thanks for testing and everything! Amidst all the stress of yesterday's troubleshooting, I didn't even think about testing it in a VM (despite having a clone of that computer as a VM!). _________________ [Server etc. | C2D 2.2 @ 3.0 GHz / 4 GB RAM / 3x1 TB + 1x2 TB SATA disks + 1.5 TB ext. | Gentoo]
[Laptop | Macbook Pro 15" / Core i7 (Sandy) Quad 2.2 GHz / 16 GB RAM / Samsung 840 250 GB SSD + 1 TB + 2 TB HDD / 6750M 1 GB / OS X, Win 7] |
|
Back to top |
|
|
drescherjm Advocate
Joined: 05 Jun 2004 Posts: 2790 Location: Pittsburgh, PA, USA
|
|
Back to top |
|
|
Jarjar Apprentice
Joined: 21 Jul 2002 Posts: 265 Location: Sweden
|
Posted: Sun Dec 11, 2011 5:59 pm Post subject: |
|
|
In case someone finds this by searching:
I just finished this process, and it worked great for me as well. Adding the disk took a long time (a bit over 20 hours), but xfs_growfs finished in 1.9 seconds!
Capacity increased as expected (by 50% despite going from 3->4 disks, a very nice side effect of RAID5). _________________ [Server etc. | C2D 2.2 @ 3.0 GHz / 4 GB RAM / 3x1 TB + 1x2 TB SATA disks + 1.5 TB ext. | Gentoo]
[Laptop | Macbook Pro 15" / Core i7 (Sandy) Quad 2.2 GHz / 16 GB RAM / Samsung 840 250 GB SSD + 1 TB + 2 TB HDD / 6750M 1 GB / OS X, Win 7] |
|
Back to top |
|
|
Mad Merlin Veteran
Joined: 09 May 2005 Posts: 1155
|
Posted: Wed Dec 14, 2011 12:26 am Post subject: |
|
|
FWIW, non-partitioned mdadm arrays are actually quite common. It's far more common to have /dev/md{0..n} than a single /dev/md0 with partitions inside it. _________________ Game! - Where the stick is mightier than the sword! |
|
Back to top |
|
|
|