How to avoid reclaiming thin space with Veritas Volume Manager (VxVM)

How to avoid reclaiming thin space with Veritas Volume Manager (VxVM)

Article: 100046422
Last Published: 2019-10-08
Ratings: 0 0
Product(s): InfoScale & Storage Foundation

Description

 

The following procedure can be used to avoid reclaiming space at the Veritas Volume Manager (VxVM) layer.
This is normally required when a large amount of thin space is to be reclaimed at both the VxVM and storage layer.

The reclaim process can potentially take multiple hours to reclaim large quantities of thin space.

 

In this example, the thin disk "emc0_629" will be assigned to disk group "testdg":

 

# vxprint -qhtg testdg
dg testdg       default      default  3000     1570523941.26.sflorat52-6-v01.vxindia.veritas.com

dm emc0_0634    emc0_0634    auto     65536    41870848 -
dm emc0_0635    emc0_0635    auto     65536    41870848 -


# vxdg -g testdg adddisk emc0_0629

# vxdisk -o thin list
DEVICE          SIZE(MB)     PHYS_ALLOC(MB)  GROUP           TYPE                  RECLAIM_CMD
emc0_062a       20480        19822           vvr             thinrclm                         WRITE_SAME
emc0_062b       20480        4576            vvr             thinrclm                         WRITE_SAME
emc0_062c       20480        32              vvr             thinrclm                         WRITE_SAME
emc0_0627       20480        32              vvr             thinrclm                         WRITE_SAME
emc0_0628       20480        10272           vvr             thinrclm                         WRITE_SAME
emc0_0629       20480        207             testdg          thinrclm                         WRITE_SAME
emc0_0634       20480        206             testdg          thinrclm                         WRITE_SAME
emc0_0635       20480        32              testdg          thinrclm                         WRITE_SAME


The volume "vol1" is created and a file system created on top of the VxVM volume.

# vxassist -g testdg make vol1 10g

VxFS example:

-bash-4.1# mkfs -F vxfs /dev/vx/rdsk/testdg/vol1
    version 15 layout
    20971520 sectors, 10485760 blocks of size 1024, log size 16384 blocks
    rcq size 1024 blocks
    largefiles supported
    maxlink supported
    WORM not supported

# mount -F vxfs /dev/vx/dsk/testdg/vol1 /lega


UFS example:

# newfs /dev/vx/rdsk/testdg/vol1
newfs: construct a new file system /dev/vx/rdsk/testdg/vol1: (y/n)? y
Warning: 4096 sector(s) in last cylinder unallocated
/dev/vx/rdsk/testdg/vol1:       20971520 sectors in 3414 cylinders of 48 tracks, 128 sectors
        10240.0MB in 214 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,
 20055584, 20154016, 20252448, 20350880, 20449312, 20547744, 20646176,
 20744608, 20843040, 20941472

 

The file system is then mounted and a file is then copied to the mount point:
 

# mount /dev/vx/dsk/testdg/vol1 /lega/


# cp /etc/hosts /lega


The mount point is then unmounted

# umount /lega

# vxprint -qhtzg testdg
dg testdg       default      default  3000     1570523941.26.sflorat52-6-v01.vxindia.veritas.com

dm emc0_0629    emc0_0629    auto     65536    41870848 -
dm emc0_0634    emc0_0634    auto     65536    41870848 -
dm emc0_0635    emc0_0635    auto     65536    41870848 -

v  vol1         -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl vol1-01      vol1         ENABLED  ACTIVE   20971520 CONCAT    -        RW
sd emc0_0629-01 vol1-01      emc0_0629 0       20971520 0         emc0_0629 ENA


To trigger the thin reclaim event, delete the volume which requires the thin space to be reclaimed


# vxedit -g testdg -rf rm vol1


NOTE: The RECLAIM/RCLM flag will be hidden unless the -z option is used. 


# vxprint -qhtzg testdg
dg testdg       default      default  3000     1570523941.26.sflorat52-6-v01.vxindia.veritas.com

dm emc0_0629    emc0_0629    auto     65536    41870848 -
dm emc0_0634    emc0_0634    auto     65536    41870848 -
dm emc0_0635    emc0_0635    auto     65536    41870848 -
sd emc0_0629-01 -            emc0_0629 0       20971520 -         emc0_0629 RCLM

 

The disk cannot be removed from the disk group until the thin space has been reclaimed.


-bash-4.1# vxdg -g testdg rmdisk emc0_0629
VxVM vxdg ERROR V-5-1-16414 Disk emc0_0629 is used by one or more subdisks which
are pending to be reclaimed.
        Use "vxdisk reclaim emc0_0629" to reclaim space used by these subdisks,
        and retry "vxdg rmdisk" command.
        Note: reclamation is irreversible.


NOTE: The subdisk(s) reported in a RECLAIM/RCLM state cannot be removed at this time.


# vxedit -g testdg -rf rm emc0_0629-01


The vxprint still reflects the subdisk to be reclaimed:


-bash-4.1# vxprint -qhtzg testdg
dg testdg       default      default  3000     1570523941.26.sflorat52-6-v01.vxindia.veritas.com

dm emc0_0629    emc0_0629    auto     65536    41870848 -
dm emc0_0634    emc0_0634    auto     65536    41870848 -
dm emc0_0635    emc0_0635    auto     65536    41870848 -
sd emc0_0629-01 -            emc0_0629 0       20971520 -         emc0_0629 RCLM

 

Procedure

__________________________________________________________________________________________


To bypass the VxVM thin reclaim operation, the disk can be marked from removal as follows:


1. Turn off the reclaim attribute at the disk level

# vxdisk set emc0_0629 reclaim=off
VxVM vxdisk ERROR V-5-1-18536 Disk emc0_0629 is used by one or more subdisks which
are pending to be reclaimed.
        Use "vxdisk reclaim emc0_0629" to reclaim space used by these subdisks,
        and retry the command.
        Note: reclamation is irreversible.


2. Mark the disk for removal using the -k option

# vxdg -g testdg -k rmdisk emc0_0629

# vxprint -qhtzg testdg
dg testdg       default      default  3000     1570523941.26.sflorat52-6-v01.vxindia.veritas.com

dm emc0_0629    -            -        -        -        REMOVED
dm emc0_0634    emc0_0634    auto     65536    41870848 -
dm emc0_0635    emc0_0635    auto     65536    41870848 -
sd emc0_0629-01 -            emc0_0629 0       20971520 -         emc0_0629 RCLM


3. Remove the subdisk(s) that still require the thin space to be reclaimed

# vxedit -g testdg -rf rm emc0_0629-01


4. Once the subdisk in the RECLAIM/RCLM state has been removed, the disk can then be removed from the disk group
 

# vxprint -qhtzg testdg
dg testdg       default      default  3000     1570523941.26.sflorat52-6-v01.vxindia.veritas.com

dm emc0_0629    -            -        -        -        REMOVED
dm emc0_0634    emc0_0634    auto     65536    41870848 -
dm emc0_0635    emc0_0635    auto     65536    41870848 -

# vxdg -g testdg rmdisk emc0_0629

 

5. The vxprint will now reflect that the disk has been removed from the disk group 

# vxprint -qhtzg testdg

dg testdg       default      default  3000     1570523941.26.sflorat52-6-v01.vxindia.veritas.com

dm emc0_0634    emc0_0634    auto     65536    41870848 -
dm emc0_0635    emc0_0635    auto     65536    41870848 -


6. The thin space can now be reclaimed at the storage layer


# vxdisk -o thin list
DEVICE          SIZE(MB)     PHYS_ALLOC(MB)  GROUP           TYPE                  RECLAIM_CMD
emc0_062a       20480        19822           vvr             thinrclm                         WRITE_SAME
emc0_062b       20480        4576            vvr             thinrclm                         WRITE_SAME
emc0_062c       20480        32              vvr             thinrclm                         WRITE_SAME
emc0_0627       20480        32              vvr             thinrclm                         WRITE_SAME
emc0_0628       20480        10272           vvr             thinrclm                         WRITE_SAME
emc0_0629       20480        222             -               thinrclm                         WRITE_SAME
emc0_0634       20480        206             testdg          thinrclm                         WRITE_SAME
emc0_0635       20480        32              testdg          thinrclm                         WRITE_SAME

 

 

Was this content helpful?