• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to add Additional Storage Space Created from Dynamic LUN Expansion in ZFS online

by admin

Most of the storage arrays nowadays provide the feature of dynamic LUN expansion. This feature allows you to grow your existing volume on the fly without affecting existing data or I/O. Dynamic LUN expansion increases the capacity of the physical storage. You must then make Solaris-aware that the device has grown, and if a file system resides on the device, it must also be grown.

Before LUN expansion

1. Here is the disk that was used to create the zpool as seen in the format command output :

# format

< . . . .>

  98. c7t600A0B80002FBC6700001AE352B29DDBd0 [SUN-LCSM100_F-0670 cyl 51198 alt 2 hd 64 sec 64]  zfs-vol
      /scsi_vhci/ssd@g600a0b80002fbc6700001ae352b29ddb

   format> partition 
   partition> print

      Part      Tag    Flag     First Sector    Size       Last Sector
        0       usr    wm           256        99.99GB     209698782

2. Here are the sequence of commands used to create the zpool with the above disk :

# zpool create zfsvol c7t600A0B80002FBC6700001AE352B29DDBd0
# zpool list zfsvol
    NAME     SIZE  ALLOC   FREE    CAP  HEALTH  ALTROOT
    zfsvol  99.5G  79.5K  99.5G     0%  ONLINE  -
# df -k /zfsvol
  Filesystem            kbytes    used   avail capacity  Mounted on
  zfsvol               102703104      21 102703029     1%    /zfsvol

After LUN expansion

There are 2 ways to do the expansion of zpool. The simple approach is to set the zpool autoexpand property to ON. The alternate method using format to repartition the disk device should only be used in the case of an older version of ZFS that does not support autoexpand.

Method 1 : zpool autoexpand

# zpool get  autoexpand zfsvol
    NAME    PROPERTY    VALUE   SOURCE
    zfsvol  autoexpand  off     default
# zpool set autoexpand=on zfsvol
# zpool online -e zfsvol c7t600A0B80002FBC6700001AE352B29DDBd0
# zpool export zfsvol
# zpool import zfsvol
# zpool list zfsvol
    NAME     SIZE  ALLOC   FREE    CAP  HEALTH  ALTROOT
    zfsvol   150G  97.5K   149G     0%  ONLINE  -

Method 2 : repartition the disk

# NOINUSE_CHECK=1
# export NOINUSE_CHECK
# format -e c7t600A0B80002FBC6700001AE352B29DDBd0
   selecting c7t600A0B80002FBC6700001AE352B29DDBd0: zfs-vol
  format> type
    AVAILABLE DRIVE TYPES:
    0. Auto configure
    1. other
  Specify disk type (enter its number)[1]: 0
    c7t600A0B80002FBC6700001AE352B29DDBd0: configured with capacity of 150.00GB
    [SUN-LCSM100_F-0670-150.00GB]
  format> partition
  partition> 0
    Enter partition id tag[usr]: [Enter]
    Enter partition permission flags[wm]: [Enter]
    Enter new starting Sector[34]: 256  (256 was the value prior to the expansion)
    Enter partition size[314556349b, 314556604e, 153591mb, 149gb, 0tb]: $
  partition> lab
    [0] SMI Label
    [1] EFI Label
  Specify Label type[1]: 1
  Ready to label disk, continue? yes
  partition> quit
  format> quit
# zpool online -e zfsvol c7t600A0B80002FBC6700001AE352B29DDBd0
# zpool list zfsvol
   NAME     SIZE  ALLOC   FREE    CAP  HEALTH  ALTROOT
   zfsvol   150G   147K   149G     0%  ONLINE  -
# df -k /zfsvol
   Filesystem            kbytes    used   avail capacity  Mounted on
   zfsvol               154312704      21 154312629     1%    /zfsvol

The volume on the storage array has been expanded. Additional space has been given to the zpool.

Filed Under: Solaris, ZFS Tagged With: LUN expansion, zfs

Some more articles you might also be interested in …

  1. How to mount the zfs rpool while booted from CD [SPARC]
  2. How To Use ‘zpool split’ to Split rpool in solaris 11 (SPARC)
  3. How to add Additional Storage Space Created from Dynamic LUN Expansion in SVM online
  4. ZFS Tutorials : Creating ZFS snapshot and clones
  5. ZFS Tutorials : Creating ZFS pools and file systems

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright