Friday, July 22, 2016

Solaris 10: expand zfs filesystem LUN

Pre-requisite task
Increasing from 500GB to 1Tb
Extending the same LUN from 500GB to 1TB


- Unshare NFS mountpoint BACKUP
# unshare /BACKUP

- Unmount ZFS mountpoints
# zfs umount /BACKUP
# zfs umount /repo
Export the ZFS POOL
# zpool export rpool


Grab the current lun Geometry and take note of the first Sector.. ie. 256.

Part      Tag    Flag     First Sector          Size          Last Sector
  0        usr    wm               256          499GB           2147467228
  1 unassigned    wm                 0            0                0
  2 unassigned    wm                 0            0                0
  3 unassigned    wm                 0            0                0
  4 unassigned    wm                 0            0                0
  5 unassigned    wm                 0            0                0
  6 unassigned    wm                 0            0                0
  8   reserved    wm        2147467230         8.00MB           2147483613


- Once storage team extend the LUN , perform the following


Task

AutoConfigure the LUN to resize the LUN,
# format
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
Select 'type', then 0 for Autoconfigure

The lun will be formatted with new geometry.

Current partition table (original):
Total disk sectors available: 2147467229 + 16384 (reserved sectors)
Part      Tag    Flag     First Sector          Size          Last Sector
  0        usr    wm                34      1023.99GB           2147467229
  1 unassigned    wm                 0            0                0
  2 unassigned    wm                 0            0                0
  3 unassigned    wm                 0            0                0
  4 unassigned    wm                 0            0                0
  5 unassigned    wm                 0            0                0
  6 unassigned    wm                 0            0                0
  8   reserved    wm        2147467230         8.00MB           2147483613

Adjust Partition 0 to change the starting sector from 34 to 256.
partition> 0
Part      Tag    Flag     First Sector          Size          Last Sector
  0        usr    wm                34      1023.99GB           2147467229
Enter partition id tag[usr]:
Enter partition permission flags[wm]:
Enter new starting Sector[34]: 256
Enter partition size[2147467196b, 2147467451e, 1048567mb, 1023gb, 0tb]: $
partition> p
Current partition table (unnamed):
Total disk sectors available: 2147467229 + 16384 (reserved sectors)
Part      Tag    Flag     First Sector          Size          Last Sector
  0        usr    wm               256      1023.99GB           2147467228
  1 unassigned    wm                 0            0                0
  2 unassigned    wm                 0            0                0
  3 unassigned    wm                 0            0                0
  4 unassigned    wm                 0            0                0
  5 unassigned    wm                 0            0                0
  6 unassigned    wm                 0            0                0
  8   reserved    wm        2147467230         8.00MB           2147483613
partition> label
Ready to label disk, continue? y

Re-import zpool
# zpool import repo
Note, filesystem should still show 500GB.  You must set autoexpand=on to grow the zfs filesystem.
# zpool set autoexpand=on repo
Now share out /BACKUP and remount the mountpoint on all DB clients.

No comments:

Post a Comment