Solaris Volume Manager (SVM) : Growing concat metadevice
In the example below, we have a 3 column RAID5 metadevice d10 [ size – 1GB ] with 3 disks – c5t23d0s1, c5t24d0s1, c5t25d0s1. The high level steps to grow the RAID 5 metadevice d10 are :
1. Attaching a new disk to the RAID 5 metadevice as a concatenated device.
2. Growing the file system online.
Once we have done growing the RAID 5 metadevice, we would still have a 3 column stripe, but across 4 disks.
We start off with a 3 disk (3 column) RAID 5 metadevice.
# metastat d10 d10: RAID State: Okay Interlace: 32 blocks Size: 4161536 blocks (2.0 GB) Original device: Size: 4193600 blocks (2.0 GB) Device Start Block Dbase State Reloc Hot Spare c5t23d0s1 330 No Okay Yes c5t24d0s1 330 No Okay Yes c5t25d0s1 330 No Okay Yes
# df -k /data Filesystem kbytes used avail capacity Mounted on /dev/md/dsk/d10 2017455 1904833 10883 96% /data
Growing the metadevice
First thing is to partition the new disk similar to other disks in the d10 metadevice :
# prtvtoc /dev/rdsk/c5t25d0s2 | fmthard -s - /dev/rdsk/c5t26d0s2 fmthard: New volume table of contents now in place.
Now we can grow the metadevice d10 by attaching this new disk to it :
# metattach d10 c5t26d0s1 d10: component is attached
Check for the new metastat output. You can see the newly attached concatenated device at the end.
# metastat d10 d10: RAID State: Okay Interlace: 32 blocks Size: 6258688 blocks (3.0 GB) Original device: Size: 4193600 blocks (2.0 GB) Device Start Block Dbase State Reloc Hot Spare c5t23d0s1 330 No Okay Yes c5t24d0s1 330 No Okay Yes c5t25d0s1 330 No Okay Yes Concatenated Devices: Size: 2096800 blocks (1023 MB) Device Start Block Dbase State Reloc Hot Spare c5t26d0s1 330 No Okay Yes
Growing the file system
Now we can grow the file system. Note that file system is write locked until grow completes (reads are allowed).
# growfs -M /data /dev/md/rdsk/d10 /dev/md/rdsk/d10: 6258688 sectors in 191 cylinders of 128 tracks, 256 sectors 3056.0MB in 64 cyl groups (3 c/g, 48.00MB/g, 11648 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32......................6209312
Verify the file system size in the df -h output.
# df -k /data Filesystem kbytes used avail capacity Mounted on /dev/md/dsk/d10 3035199 1904833 1130366 67% /data
Solaris Volume Manager (SVM) : Growing concat metadevice