How to Increase rpool in OmiOS VMware Guest Using a Mirror

If you have ever created an OmniOS VM guest and made the root disk rpool too small, there is a pretty simple way to increase the size of the disk. The following will outline those steps.  Sections in blue are what you would type:

  • Edit the settings in vSphere for the VM

    1. Add a new disk with the desired size, this time make it twice as big as you think you might need
    2. Reboot VM.

newdisk

  • On the VM do the following:

    1. Format new disk using format command
    2. Mirror the rpool using the new disk created in vSphere
    3. Install boot block on new disk
    4. Detach the old disk from rpool
    5. Resize rpool
    6. Poweroff VM
    7. Edit settings of VM and remove old disk
    8. Poweron VM
    9. Confirm your work

 Current System State

 
root@csu-o:~# df -h
Filesystem                      Size  Used Avail Use% Mounted on
rpool/ROOT/omnios-1             6.5G  4.9G  1.6G  77% /
swap                            941M  312K  940M   1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1  6.5G  4.9G  1.6G  77% /lib/libc.so.1
swap                            940M     0  940M   0% /tmp
swap                            940M   48K  940M   1% /var/run
rpool/export                    1.6G   32K  1.6G   1% /export
rpool/export/home               1.6G   31K  1.6G   1% /export/home
rpool                           1.6G   38K  1.6G   1% /rpool
 
root@csu-o:~# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
rpool  9.94G  7.42G  2.52G         –    74%  1.00x  ONLINE  –
 
 
root@csu-o:~# zpool status    
  pool: rpool
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using ‘zpool upgrade’. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: none requested
config:
 
        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c2t0d0s0  ONLINE       0     0     0
 
errors: No known data errors

 Format new disk using format command

root@csu-o:~# format
Searching for disks…done
 
 
AVAILABLE DISK SELECTIONS:
       0. c2t0d0 <VMware-Virtualdisk-1.0 cyl 1302 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c2t1d0 <VMware-Virtualdisk-1.0 cyl 2608 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@1,0
Specify disk (enter its number): 1
selecting c2t1d0
[disk formatted]
No Solaris fdisk partition found.
 
 
FORMAT MENU:
        disk       – select a disk
        type       – select (define) a disk type
        partition  – select (define) a partition table
        current    – describe the current disk
        format     – format and analyze the disk
        fdisk      – run the fdisk program
        repair     – repair a defective sector
        label      – write label to the disk
        analyze    – surface analysis
        defect     – defect list management
        backup     – search for backup labels
        verify     – read and display labels
        save       – save new disk/partition definitions
        inquiry    – show vendor, product and revision
        volname    – set 8-character volume name
        !<cmd>     – execute <cmd>, then return
        quit
format> part
WARNING – This disk may be in use by an application that has
          modified the fdisk table. Ensure that this disk is
          not currently in use before proceeding to use fdisk.
format>
format> fdisk
No fdisk table exists. The default partition for the disk is:
 
  a 100% “SOLARIS System” partition
 
Type “y” to accept the default partition,  otherwise type “n” to edit the
 partition table.
y
format> part
 
 
PARTITION MENU:
        0      – change `0′ partition
        1      – change `1′ partition
        2      – change `2′ partition
        3      – change `3′ partition
        4      – change `4′ partition
        5      – change `5′ partition
        6      – change `6′ partition
        7      – change `7′ partition
        select – select a predefined table
        modify – modify a predefined partition table
        name   – name the current table
        print  – display the current table
        label  – write partition map and label to the disk
        !<cmd> – execute <cmd>, then return
        quit
partition> p
Current partition table (original):
Total disk cylinders available: 2607 + 2 (reserved cylinders)
 
Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)           0
  1 unassigned    wm       0               0         (0/0/0)           0
  2     backup    wu       0 – 2606       19.97GB    (2607/0/0) 41881455
  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)           0
  8       boot    wu       0 –    0        7.84MB    (1/0/0)       16065
  9 unassigned    wm       0               0         (0/0/0)           0
 
partition> 0
Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)           0
 
Enter partition id tag[unassigned]: 
Enter partition permission flags[wm]: 
Enter new starting cyl[0]: 1
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 2606c
partition> 
partition> 
partition> p
Current partition table (unnamed):
Total disk cylinders available: 2607 + 2 (reserved cylinders)
 
Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       1 – 2606       19.96GB    (2606/0/0) 41865390
  1 unassigned    wm       0               0         (0/0/0)           0
  2     backup    wu       0 – 2606       19.97GB    (2607/0/0) 41881455
  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)           0
  8       boot    wu       0 –    0        7.84MB    (1/0/0)       16065
  9 unassigned    wm       0               0         (0/0/0)           0
 
partition> l
Ready to label disk, continue? y
 
partition> q
 
 
FORMAT MENU:
        disk       – select a disk
        type       – select (define) a disk type
        partition  – select (define) a partition table
        current    – describe the current disk
        format     – format and analyze the disk
        fdisk      – run the fdisk program
        repair     – repair a defective sector
        label      – write label to the disk
        analyze    – surface analysis
        defect     – defect list management
        backup     – search for backup labels
        verify     – read and display labels
        save       – save new disk/partition definitions
        inquiry    – show vendor, product and revision
        volname    – set 8-character volume name
        !<cmd>     – execute <cmd>, then return
        quit
format> q
root@csu-o:~# 

Mirror the rpool using the new disk created in vSphere.  Wait until it finishes resilvering.

root@csu-o:~# zpool attach rpool c2t0d0s0 c2t1d0s0
invalid vdev specification
use ‘-f’ to override the following errors:
/dev/dsk/c2t1d0s0 overlaps with /dev/dsk/c2t1d0s2
root@csu-o:~# zpool attach -f rpool c2t0d0s0 c2t1d0s0                                                                                         
Make sure to wait until resilver is done before rebooting.
root@csu-o:~# zpool status
  pool: rpool
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Fri Dec 20 14:00:06 2013
    902M scanned out of 7.42G at 32.2M/s, 0h3m to go
    902M resilvered, 11.87% done
config:
 
        NAME          STATE     READ WRITE CKSUM
        rpool         ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c2t0d0s0  ONLINE       0     0     0
            c2t1d0s0  ONLINE       0     0     0  (resilvering)
 
errors: No known data errors
root@csu-o:~# zpool status -v
  pool: rpool
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using ‘zpool upgrade’. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: resilvered 7.42G in 0h3m with 0 errors on Fri Dec 20 14:03:48 2013
config:
 
        NAME          STATE     READ WRITE CKSUM
        rpool         ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c2t0d0s0  ONLINE       0     0     0
            c2t1d0s0  ONLINE       0     0     0
 
errors: No known data errors
root@csu-o:~# 

 Install boot block on new disk

root@csu-o:~# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c2t1d0s0
stage2 written to partition 0, 283 sectors starting at 50 (abs 16115)
stage1 written to partition 0 sector 0 (abs 16065)
root@csu-o:~#

 Detach the old disk from rpool

root@csu-o:~# zpool detach rpool c2t0d0s0                                                                                                     
root@csu-o:~# 
root@csu-o:~# 
root@csu-o:~# zpool status -v                                                                                                     
  pool: rpool
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using ‘zpool upgrade’. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: resilvered 7.42G in 0h3m with 0 errors on Fri Dec 20 14:03:48 2013
config:
 
        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c2t1d0s0  ONLINE       0     0     0
 
errors: No known data errors
root@csu-o:~# 

Resize Rpool

root@csu-o:~# zpool scrub rpool

root@csu-o:~# zpool status -v
  pool: rpool
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using ‘zpool upgrade’. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: scrub repaired 0 in 0h1m with 0 errors on Fri Dec 20 14:15:52 2013
config:
        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c2t1d0s0  ONLINE       0     0     0
errors: No known data errors
root@csu-o:~#
root@csu-o:~# zpool set autoexpand=on rpool
root@csu-o:~#

Power off VM, Edit settings of VM and remove old disk

rmdisk

 

 

Power on VM, Confirm your work

 

root@csu-o:~# df -h
Filesystem                      Size  Used Avail Use% Mounted on
rpool/ROOT/omnios-1              17G  5.0G   12G  31% /
swap                            1.5G  308K  1.5G   1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1   17G  5.0G   12G  31% /lib/libc.so.1
swap                            1.5G     0  1.5G   0% /tmp
swap                            1.5G   60K  1.5G   1% /var/run
rpool/export                     12G   32K   12G   1% /export
rpool/export/home                12G   31K   12G   1% /export/home
rpool                            12G   38K   12G   1% /rpool
root@csu-o:~# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
rpool  19.9G  7.44G  12.5G         –    37%  1.00x  ONLINE  –

You Are Done

Permanent link to this article: https://daherlabs.mywire.org/wordpress/?p=28

1 comment

    • Justin Rassi on December 23, 2013 at 12:19 pm
    • Reply

    Great guide and very well done. Thank you very much, this was exactly what I needed.

Leave a Reply to Justin Rassi Cancel reply

Your email address will not be published.