Today i had the need to rearrange my root disks in my Solaris work station. I really hadn’t put much thought into the initial layout and was starting to suffer for it. I moved slice5 out the way which left slice4 with the potential to expand by more than 100gb.
Part Tag Flag Cylinders Size Blocks
0 root wm 61305 - 65532 15.00GB (4228/0/0) 31456320
1 swap wu 0 - 563 2.00GB (564/0/0) 4196160
2 backup wm 0 - 65532 232.49GB (65533/0/0) 487565520
3 var wm 60177 - 61304 4.00GB (1128/0/0) 8392320
4 unassigned wm 571 - 14664 50.00GB (14094/0/0) 104859360
5 home wm 14665 - 28758 50.00GB (14094/0/0) 104859360
6 unassigned wm 46084 - 60176 50.00GB (14093/0/0) 104851920
7 unassigned wm 564 - 570 25.43MB (7/0/0) 52080
Do some work:
Part Tag Flag Cylinders Size Blocks
0 root wm 61305 - 65532 15.00GB (4228/0/0) 31456320
1 swap wu 0 - 563 2.00GB (564/0/0) 4196160
2 backup wm 0 - 65532 232.49GB (65533/0/0) 487565520
3 var wm 60177 - 61304 4.00GB (1128/0/0) 8392320
4 unassigned wm 571 - 46083 161.47GB (45513/0/0) 338616720
5 unassigned wm 0 0 (0/0/0) 0
6 home wm 46084 - 60176 50.00GB (14093/0/0) 104851920
7 unassigned wm 564 - 570 25.43MB (7/0/0) 52080
/dev/dsk/c1t1d0s4 51635799 23594933 27524509 47% /mnt
df -k shows the change is not registered, and that’s where the growfs command enters. I will umount this file system as it is only a data slice, and on the broken part of the mirror.
heineken:/ # growfs /dev/rdsk/c1t1d0s4
Warning: 3696 sector(s) in last cylinder unallocated
/dev/rdsk/c1t1d0s4: 338616720 sectors in 55114 cylinders of 48 tracks, 128 sectors
165340.2MB in 3445 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
…………………………………………………………..
super-block backups for last 10 cylinder groups at:
337679776, 337778208, 337876640, 337975072, 338073504, 338171936, 338270368,
338368800, 338467232, 338565664
/dev/dsk/c1t1d0s4 166745210 23609269 141468489 15% /mnt
File systems are intact, no loss of data, no downtime. Of course this work was done on the broken mirror, in case of catastrophy my data would be intact on the other side. I will now commit this work to the other side and then mirror it back. As it is just a data slice this is possible - for root obviously downtime would be required. For that, you could look at Live Upgrade, which has more uses other than updating root safely. That will be for another time.