This is a procedure that might be useful if you ever have to grow a Solaris VTOC /SMI partition containing a rpool.
Change zfs volume from 20G to 25G
# zfs set volsize=25G rpool/ldoms/sol11_gold/disk0# zfs get volsize rpool/ldoms/sol11_gold/disk0NAME PROPERTY VALUE SOURCErpool/ldoms/sol11_gold/disk0 volsize 25G localProcedure if existing label is a VTOC / SMI
Inside the guest record the current VTOC. You could possibly recover using fmthard.
root@solaris:/root# prtvtoc /dev/rdsk/c2d1s0
* /dev/rdsk/c2d1s0 partition map** Dimensions:* 512 bytes/sector* 768 sectors/track* 96 tracks/cylinder* 73728 sectors/cylinder* 568 cylinders* 566 accessible cylinders** Flags:* 1: unmountable* 10: read-only** Unallocated space:* First Sector Last* Sector Count Sector* 0 73728 73727** First Sector Last* Partition Tag Flags Sector Count Sector Mount Directory0 2 00 73728 41656320 417300472 5 01 0 41730048 41730047Use format > verify and record the output
Primary label contents:
Volume name = < >ascii name =pcyl = 568ncyl = 566acyl = 2nhead = 96nsect = 768Part Tag Flag Cylinders Size Blocks 0 root wm 1 - 565 19.86GB (565/0/0) 41656320 1 unassigned wm 0 0 (0/0/0) 0 2 backup wu 0 - 565 19.90GB (566/0/0) 41730048 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0Change label to EFI using format -e
root@solaris:/root# format -eformat> label[0] SMI Label[1] EFI LabelSpecify Label type[0]: 1Warning: This disk has an SMI label. Changing to EFI label will erase allcurrent partitions.Continue? yChange label back using format -e
format> label[0] SMI Label[1] EFI LabelSpecify Label type[1]: 0Next recreate the initial partitions. Check that the cylinder size of the disk geometry hasn”t changed. If it has changed then you will be unable to recreate the initial partitions.
Run format > verify and check that “nhead” and “nsect” are the same as before the geometry was changed (from the format > verify output that was initially saved)
Partition table before fixing it
format> verifyWarning: Primary label on disk appears to be different fromcurrent label.
Warning: Check the current partitioning and 'label' the disk or use the 'backup' command.
Primary label contents:
Volume name = < >ascii name =pcyl = 711ncyl = 709acyl = 2nhead = 96nsect = 768Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 3 144.00MB (4/0/0) 294912 1 swap wu 4 - 7 144.00MB (4/0/0) 294912 2 backup wu 0 - 708 24.93GB (709/0/0) 52273152 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 usr wm 8 - 708 24.64GB (701/0/0) 51683328 7 unassigned wm 0 0 (0/0/0) 0Recreate the partition table based on your original verify. Leave slice 2 as is.
partition > pr
Current partition table (unnamed):Total disk cylinders available: 709 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks0 root wm 1 - 565 19.86GB (565/0/0) 416563201 unassigned wu 0 0 (0/0/0) 02 backup wu 0 - 708 24.93GB (709/0/0) 522731523 unassigned wm 0 0 (0/0/0) 04 unassigned wm 0 0 (0/0/0) 05 unassigned wm 0 0 (0/0/0) 06 unassigned wm 0 0 (0/0/0) 07 unassigned wm 0 0 (0/0/0) 0
partition > labelReady to label disk, continue? ypartition > q**** I think I should have made slice the full 24G not the original 19G. I will verify his is a future test.
root@solaris:/root# syncroot@solaris:/root# reboot**** Could not get the rpool to see the larger slice. Booted DVD and changed slice to the full size 24GB of the disk. That still did not fix it so l****ets try booting a Solaris 11 DVD and import/export the rpool.
root@solaris:/root# zpool import rpoolroot@solaris:/root# zpool statuspool: rpoolstate: ONLINEscan: none requestedconfig:
NAME STATE READ WRITE CKSUMrpool ONLINE 0 0 0c2d1s0 ONLINE 0 0 0
errors: No known data errors
root@solaris:/root# zpool listNAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOTrpool 24.9G 5.32G 19.6G 21% 1.00x ONLINE -
root@solaris:/root# zpool export rpoolReboot and guest is seeing larger rpool
root@solaris:~# zpool listNAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOTrpool 24.9G 5.32G 19.6G 21% 1.00x ONLINE -