Solaris Volume Manager (SVM) : Growing concat metadevice
The example shown below uses metadevice d3, which is a 33Gb mirror with a mounted file system. The high level steps to grow the mirrored metadevice d3 includes :
1. Attaching 2 more sub-mirrors (bigger ones – d32 and d33) to the parent metadevice d3.
2. Detaching the older sub-mirrors d30 and d31 after sync.
3. Growing the parent metadevice d3 to reflect new size.
4. Growing the file system.
Attaching 2 new sub-mirrors (bigger size)
The parent metadevice d3 is of size 33 GB with 2 sub-mirrors d30 and d31.
# metastat d3 d3: Mirror Submirror 0: d30 State: Okay Submirror 1: d31 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 70574080 blocks (33 GB) d30: Submirror of d3 State: Okay Size: 70574080 blocks (33 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c3t0d0s0 0 No Okay Yes d31: Submirror of d3 State: Okay Size: 70574080 blocks (33 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c3t0d1s0 0 No Okay Yes
To grow the metadevice, we will be adding 2 more large submirrors d32, d33 (from disks c4t0d0 and c4t0d1), making it a 4 way mirror, sync it and then remove the original 2 submirrors.
# metainit d32 1 1 c4t0d0s0 # metainit d33 1 1 c4t0d1s0 # metattach d3 d32 # metattach d3 d33
Now we have a 4-way mirror :
# metastat d3 d3: Mirror Submirror 0: d30 State: Okay Submirror 1: d31 State: Okay Submirror 2: d32 State: Okay Submirror 3: d33 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 70574080 blocks (33 GB) d30: Submirror of d3 State: Okay Size: 70574080 blocks (33 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c3t0d0s0 0 No Okay Yes d31: Submirror of d3 State: Okay Size: 70574080 blocks (33 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c3t0d1s0 0 No Okay Yes d32: Submirror of d3 State: Okay Size: 141148160 blocks (67 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c4t0d0s0 0 No Okay Yes d33: Submirror of d3 State: Okay Size: 141148160 blocks (67 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c4t0d1s0 0 No Okay Yes
Detaching the older sub-mirrors
We would let the new sub-mirrors to sync up and then detach the original submirrors d30 and d31.
# metadetach d3 d30 d3: submirror d30 is detached # metadetach d3 d31 d3: submirror d31 is detached
# metastat d3 d3: Mirror Submirror 2: d32 State: Okay Submirror 3: d33 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 70574080 blocks (33 GB) d32: Submirror of d3 State: Okay Size: 141148160 blocks (67 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c4t0d2s0 0 No Okay Yes d33: Submirror of d3 State: Okay Size: 141148160 blocks (67 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c4t0d1s0 0 No Okay Yes
The key step is to use “metattach mirror”. This tells the parent mirror to grow to the size of its smallest current sub-mirror.
# metattach d3
Notice how the parent size has changed.
# metastat d3 d3: Mirror Submirror 2: d32 State: Okay Submirror 3: d33 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 141148160 blocks (67 GB) d32: Submirror of d3 State: Okay Size: 141148160 blocks (67 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c3t0d2s0 0 No Okay Yes d33: Submirror of d3 State: Okay Size: 141148160 blocks (67 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c3t0d3s0 0 No Okay Yes
Growing the file system
You can now use growfs to make the new space available to the file system.
# growfs -M /d3 /dev/md/rdsk/d3 /dev/md/rdsk/d3: 141148160 sectors in 68920 cylinders of 64 tracks, 32 sectors 68920.0MB in 1407 cyl groups (49 c/g, 49.00MB/g, 6144 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 100416, 200800, 301184, 401568, 501952, 602336, 702720, 803104, 903488, 140595008, 140695392, 140795776, 140896160, 140996544, 141096928,
Verify the new size of the file system :
# df -k /d3 Filesystem kbytes used avail capacity Mounted on /dev/md/dsk/d3 69470954 34730557 34393047 51% /d3
Solaris Volume Manager (SVM) : Growing concat metadevice