How to resize volumes and filesystems which belong to a third-mirror break-off snapshot hierarchy
This article explains in detail the procedure to create a Volume Manager Third-Mirror break-off Snapshot.
The article further explains how to resize the volumes in a snapshot hierarchy.
Create a Diskgroup:
# vxdg init testdg emc0_02a2 emc0_02a3
Create the Primary Volume
# vxassist -g testdg make testvol 1g
Create the filesystem on the Primary Volume
# mkfs -F vxfs /dev/vx/rdsk/testdg/testvol version 7 layout
2097152 sectors, 1048576 blocks of size 1024, log size 16384 blocks
largefiles supported
Prepare the Primary Volume for snapshots
# vxsnap -g testdg prepare testvol
Verify the Volume is ready for Instant Snapshots
# vxprint -g testdg -F fastresync testvolon
# vxprint -g testdg -F hasdcolog testvolon
Verify the vxprint output
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v testvol - ENABLED ACTIVE 2097152 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 2097152 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 2097152 0 emc0_02a2 ENA
dc testvol_dco testvol testvol_dcl
v testvol_dcl - ENABLED ACTIVE 544 SELECT - gen
pl testvol_dcl-01 testvol_dcl ENABLED ACTIVE 544 CONCAT - RW
sd emc0_02a3-01 testvol_dcl-01 emc0_02a3 0 544 0 emc0_02a3 ENA
Mount the Primary Filesystem
# mount -F vxfs /dev/vx/dsk/testdg/testvol /tmp/testvol/
Create a file to track the changes
# cat /tmp/testvol/test1_beforesnapshot
This file is created before snapshot
Add two more disks into the diskgroup
# vxdg -g testdg adddisk emc0_029d emc0_029e
List the devices in the diskgroup
# vxdisk -g testdg listDEVICE TYPE DISK GROUP STATUS
emc0_02a2 auto:cdsdisk emc0_02a2 testdg online
emc0_02a3 auto:cdsdisk emc0_02a3 testdg online
emc0_029d auto:cdsdisk emc0_029d testdg online
emc0_029e auto:cdsdisk emc0_029e testdg online
Create a mirror for the Primary Volume which will be the plex used for the Third-Mirror break-off snapshot of the Primary Volume
# vxsnap -b -g testdg addmir testvol nmirror=2 alloc=emc0_029d,emc0_029e
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v testvol - ENABLED ACTIVE 2097152 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 2097152 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 2097152 0 emc0_02a2 ENA
pl testvol-02 testvol ENABLED SNAPATT 2097152 CONCAT - WO
sd emc0_029d-01 testvol-02 emc0_029d 0 2097152 0 emc0_029d ENA
pl testvol-03 testvol ENABLED SNAPATT 2097152 CONCAT - WO
sd emc0_029e-01 testvol-03 emc0_029e 0 2097152 0 emc0_029e ENA
dc testvol_dco testvol testvol_dcl
v testvol_dcl - ENABLED ACTIVE 544 SELECT - gen
pl testvol_dcl-01 testvol_dcl ENABLED ACTIVE 544 CONCAT - RW
sd emc0_02a3-01 testvol_dcl-01 emc0_02a3 0 544 0 emc0_02a3 ENA
pl testvol_dcl-02 testvol_dcl DISABLED DCOSNP 544 CONCAT - RW
sd emc0_029d-02 testvol_dcl-02 emc0_029d 2097152 544 0 emc0_029d ENA
pl testvol_dcl-03 testvol_dcl DISABLED DCOSNP 544 CONCAT - RW
sd emc0_029e-02 testvol_dcl-03 emc0_029e 2097152 544 0 emc0_029e ENA
Verify the plex Atomic Copy is in progress till both the plexes are in sync
# vxtask -l listTask: 189 RUNNING
Type: ATCOPY
Operation: PLXATT Vol testvol Plex testvol-02 Dg testdg
Started: Wed 02 Feb 2011 12:12:28 GMT
Throttle: 0
Progress: 37.79% 792576 of 2097152 Blocks
Work time: 14 seconds (0:23 remaining)
Status after the completion of the synchronization of the mirror plex
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v testvol - ENABLED ACTIVE 2097152 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 2097152 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 2097152 0 emc0_02a2 ENA
pl testvol-02 testvol ENABLED SNAPDONE 2097152 CONCAT - WO
sd emc0_029d-01 testvol-02 emc0_029d 0 2097152 0 emc0_029d ENA
dc testvol_dco testvol testvol_dcl
v testvol_dcl - ENABLED ACTIVE 544 SELECT - gen
pl testvol_dcl-01 testvol_dcl ENABLED ACTIVE 544 CONCAT - RW
sd emc0_02a3-01 testvol_dcl-01 emc0_02a3 0 544 0 emc0_02a3 ENA
pl testvol_dcl-02 testvol_dcl DISABLED DCOSNP 544 CONCAT - RW
sd emc0_029e-01 testvol_dcl-02 emc0_029e 0 544 0 emc0_029e ENA
rdgv240sol05 #
To create a third-mirror break-off snapshot, use the following form of the vxsnap make command:
# vxsnap [-g diskgroup] make source=volume[/newvol=snapvol] {/plex=plex1[,plex2,...]|/nmirror=number]}
Now we create the third-mirror break-off snapshot from plex testvol-02
# vxsnap -g testdg make source=testvol/newvol=SNAP-testvol/plex=testvol-02
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v SNAP-testvol - ENABLED ACTIVE 2097152 ROUND - fsgen
pl testvol-02 SNAP-testvol ENABLED ACTIVE 2097152 CONCAT - RW
sd emc0_029d-01 testvol-02 emc0_029d 0 2097152 0 emc0_029d ENA
dc SNAP-testvol_dco SNAP-testvol SNAP-testvol_dcl
v SNAP-testvol_dcl - ENABLED ACTIVE 544 ROUND - gen
pl testvol_dcl-02 SNAP-testvol_dcl ENABLED ACTIVE 544 CONCAT - RW
sd emc0_029e-01 testvol_dcl-02 emc0_029e 0 544 0 emc0_029e ENA
sp testvol_snp SNAP-testvol SNAP-testvol_dco
v testvol - ENABLED ACTIVE 2097152 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 2097152 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 2097152 0 emc0_02a2 ENA
dc testvol_dco testvol testvol_dcl
v testvol_dcl - ENABLED ACTIVE 544 SELECT - gen
pl testvol_dcl-01 testvol_dcl ENABLED ACTIVE 544 CONCAT - RW
sd emc0_02a3-01 testvol_dcl-01 emc0_02a3 0 544 0 emc0_02a3 ENA
sp SNAP-testvol_snp testvol testvol_dco
testvol = Primary Volume
SNAP-testvol = Snapshot of Primary Volume 'testvol'
Now we should have two separate volumes associated with each other with Volume Manager Snapshot (sp) objects as seen in the above 'vxprint' output
Any changes to the data on either the primary volume or the snapshot volume will be tracked by the DCO version 20 logs
Let us copy some data on the primary volume to fill up the filesystem to 90% full
# dd if=/dev/zero of=/tmp/testvol/900mFile.out bs=1k count=921600921600+0 records in
921600+0 records out
# du -sh /tmp/testvol/900mFile.out 900M /tmp/testvol/900mFile.out
# du -sk /tmp/testvol/900mFile.out921600 /tmp/testvol/900mFile.out
# df -h /tmp/testvol/Filesystem size used avail capacity Mounted on
/dev/vx/dsk/testdg/testvol
1.0G 917M 100M 91% /tmp/testvol
# df -k /tmp/testvol/Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/testdg/testvol
1048576 939350 102406 91% /tmp/testvol
We now have created a Third Mirror Break-off snapshot in Volume Manager. The data in the snapshot volume is consistent data at a point in time when the snapshot operation was performed.
The data in the Primary Volume can be changing by the Applications in the production just as we have created the new 900 MB file which is now only available on the Primary Volume but not on the Snapshot Volume.
To perform a resize operation on the Volumes/Filesystems in this Volume Manager snapshot hierarchy to add more space, we have two ways of performing the resize operation based on requirement.
1.) Perform the resize operation on each of the Primary volume and Snapshot volume independently
In this scenario, the snapshot hierarchy will be maintained and there is no need to reattach the snapshot volume to the original volume
2.) Perform a reattach of the Snapshot Volume to the Primary Volume before the resize operation
In this scenario, the snapshot volume will first be reattached to the source volume and then a resize operation will be performed on the Primary Volume. Once the resize operation is completed, the snapshot will need to be re-created.
Note that we should never need to disassociate the snapshots to perform a resize operation of the volumes/filesystems. If we disassociate the snapshot then a full resync will be required with the Primary Volume to create the snapshots again.
Resize operation does not require a snapshots hierarchy to be broken or disassociated.
Let us test first with Option 1 above.
Check the maximum size the Primary Volume can be grown using the existing disk
# vxassist -g testdg maxgrow testvol alloc=emc0_02a2Volume testvol can be extended by 17221632 to: 19318784 (9433Mb)
Check the maximum size the Snapshot Volume can be grown using the existing disk
# vxassist -g testdg maxgrow SNAP-testvol alloc=emc0_029dVolume SNAP-testvol can be extended by 17221632 to: 19318784 (9433Mb)
Perform the resize operation to grow the volume and filesystem on the Primary Volume
# vxresize -g testdg testvol 19318784 alloc=emc0_02a2,emc0_02a3
Notice the command we used with alloc option to define both devices, one for the data volume and one for the DCO object as it is in the configuration.
The Primary Volume and Filesystem have been resized to the new volume/filesystem size. Note that the Snapshot Volume is still at the original size.
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v SNAP-testvol - ENABLED ACTIVE 2097152 ROUND - fsgen
pl testvol-02 SNAP-testvol ENABLED ACTIVE 2097152 CONCAT - RW
sd emc0_029d-01 testvol-02 emc0_029d 0 2097152 0 emc0_029d ENA
dc SNAP-testvol_dco SNAP-testvol SNAP-testvol_dcl
v SNAP-testvol_dcl - ENABLED ACTIVE 544 ROUND - gen
pl testvol_dcl-02 SNAP-testvol_dcl ENABLED ACTIVE 544 CONCAT - RW
sd emc0_029e-01 testvol_dcl-02 emc0_029e 0 544 0 emc0_029e ENA
sp testvol_snp SNAP-testvol SNAP-testvol_dco
v testvol - ENABLED ACTIVE 19318784 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 19318784 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 19318784 0 emc0_02a2 ENA
dc testvol_dco testvol testvol_dcl1
v testvol_dcl1 - ENABLED ACTIVE 1712 SELECT - gen
pl testvol_dcl1-01 testvol_dcl1 ENABLED ACTIVE 1712 CONCAT - RW
sd emc0_02a3-02 testvol_dcl1-01 emc0_02a3 0 1712 0 emc0_02a3 ENA
sp SNAP-testvol_snp testvol testvol_dco
# df -k /tmp/testvol/Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/testdg/testvol
9659392 1863064 7309064 21% /tmp/testvol
# df -h /tmp/testvolFilesystem size used avail capacity Mounted on
/dev/vx/dsk/testdg/testvol
9.2G 1.8G 7.0G 21% /tmp/testvol
Note that the DCO size has automatically been resized with the resize of the volume/filesystem to meet the increasing volume/fs size.
Let us add some more data to the Primary Filesystem
# dd if=/dev/zero of=/tmp/testvol/900MfileAfterResize.out bs=1k count=921600921600+0 records in
921600+0 records out
# ls -lh /tmp/testvol/total 3686402
-rw-r--r-- 1 root root 900M Feb 2 12:24 900mFile.out
-rw-r--r-- 1 root root 900M Feb 2 12:47 900MfileAfterResize.out
drwxr-xr-x 2 root root 96 Feb 2 12:45 lost+found
-rw-r--r-- 1 root root 37 Feb 2 12:18 test1_beforesnapshot
Now let us attempt a refresh the snapshot first to check the behavior before resizing the snapshot volume/filesystem:
# vxsnap -g testdg refresh SNAP-testvol source=testvol
VxVM vxsnap ERROR V-5-1-7001 Volume SNAP-testvol cannot be refreshed from the volume testvol due to size/regionsize incompatibility
The attempt to refresh or re-attach the snapshot failed due to size of the Snapshot Volume not matching that of the Primary Volume
First we mount the snapshot so that we can correctly re-size the snapshot volume and filesystem.
# mount -F vxfs /dev/vx/dsk/testdg/SNAP-testvol /tmp/snapshot/
# df -h /tmp/snapshot/Filesystem size used avail capacity Mounted on
/dev/vx/dsk/testdg/SNAP-testvol
1.0G 17M 944M 2% /tmp/snapshot
# df -k /tmp/snapshot/Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/testdg/SNAP-testvol
1048576 17750 966407 2% /tmp/snapshot
# ls -l /tmp/snapshot/total 2
drwxr-xr-x 2 root root 96 Feb 2 12:17 lost+found
-rw-r--r-- 1 root root 37 Feb 2 12:18 test1_beforesnapshot
# cat /tmp/snapshot/test1_beforesnapshotThis file is created before snapshot
The snapshot volume's filesystem has the data from the time when the snapshot was performed on the Primary volume.
To enable us to re-sync the snapshot volume with its original volume by a reattach or refresh operation, we need to first re-size the snapshot to the new size.
# vxassist -g testdg maxgrow SNAP-testvol alloc=emc0_029dVolume SNAP-testvol can be extended by 17221632 to: 19318784 (9433Mb)
Note: that we have mounted the filesystem otherwise a resize operation using "vxresize" cannot be performed.
Perform the resize operation to grow the volume and filesystem on the Snapshot Volume
# vxresize -g testdg SNAP-testvol 19318784 alloc=emc0_029d,emc0_029e
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v SNAP-testvol - ENABLED ACTIVE 19318784 ROUND - fsgen
pl testvol-02 SNAP-testvol ENABLED ACTIVE 19318784 CONCAT - RW
sd emc0_029d-01 testvol-02 emc0_029d 0 19318784 0 emc0_029d ENA
dc SNAP-testvol_dco SNAP-testvol SNAP-testvol_dcl1
v SNAP-testvol_dcl1 - ENABLED ACTIVE 1712 SELECT - gen
pl SNAP-testvol_dcl1-01 SNAP-testvol_dcl1 ENABLED ACTIVE 1712 CONCAT - RW
sd emc0_029e-02 SNAP-testvol_dcl1-01 emc0_029e 544 1712 0 emc0_029e ENA
sp testvol_snp SNAP-testvol SNAP-testvol_dco
v testvol - ENABLED ACTIVE 19318784 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 19318784 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 19318784 0 emc0_02a2 ENA
dc testvol_dco testvol testvol_dcl1
v testvol_dcl1 - ENABLED ACTIVE 1712 SELECT - gen
pl testvol_dcl1-01 testvol_dcl1 ENABLED ACTIVE 1712 CONCAT - RW
sd emc0_02a3-02 testvol_dcl1-01 emc0_02a3 0 1712 0 emc0_02a3 ENA
sp SNAP-testvol_snp testvol testvol_dco
# df -k /tmp/snapshot/Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/testdg/SNAP-testvol
9659392 19863 9037066 1% /tmp/snapshot
# df -h /tmp/snapshot/Filesystem size used avail capacity Mounted on
/dev/vx/dsk/testdg/SNAP-testvol
9.2G 19M 8.6G 1% /tmp/snapshot
# ls -lh /tmp/snapshot/total 2
drwxr-xr-x 2 root root 96 Feb 2 12:55 lost+found
-rw-r--r-- 1 root root 37 Feb 2 12:18 test1_beforesnapshot
The resize operation is successful on the Snapshot volume and now the Primary volume and Snapshot volume are of the same size
Now we can perform a snapshot refresh or reattach operation:
We will first perform a refresh. We have to unmount the snapshot volume's filesystem before we perform the refresh or reattach operation.
Here is the error that we will encounter if the Snapshot Volume's filesystem is already mounted:
# vxsnap -b -g testdg refresh SNAP-testvol source=testvolVxVM vxsnap ERROR V-5-1-7066 Volume SNAP-testvol is open, cannot refresh
# umount /tmp/snapshot/
Once the Snapshot Volume's filesystem is unmounted, we can proceed with the refresh operation:
# vxsnap -b -g testdg refresh SNAP-testvol source=testvol
The amount of data that needs to re-synchronize is the amount of data that has changed on the Primary volume since the snapshot was taken or the last refresh operation was performed.
# vxtask -l listTask: 206 RUNNING
Type: SNAPSYNC
Operation: SNAPSYNC Vol SNAP-testvol Dg testdg
Started: Wed 02 Feb 2011 13:03:39 GMT
Throttle: 0
Progress: 2.82% 544768 of 19318784 Blocks
Work time: 3 seconds (01:43 remaining)
# vxtask list
TASKID PTID TYPE/STATE PCT PROGRESS
206 SNAPSYNC/R 04.11% 0/19318784/794624 SNAPSYNC SNAP-testvol testdg
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v SNAP-testvol - ENABLED ACTIVE 19318784 ROUND - fsgen
pl testvol-02 SNAP-testvol ENABLED ACTIVE 19318784 CONCAT - RW
sd emc0_029d-01 testvol-02 emc0_029d 0 19318784 0 emc0_029d ENA
dc SNAP-testvol_dco SNAP-testvol SNAP-testvol_dcl1
v SNAP-testvol_dcl1 - ENABLED ACTIVE 1712 SELECT - gen
pl SNAP-testvol_dcl1-01 SNAP-testvol_dcl1 ENABLED ACTIVE 1712 CONCAT - RW
sd emc0_029e-02 SNAP-testvol_dcl1-01 emc0_029e 544 1712 0 emc0_029e ENA
sp testvol_snp1 SNAP-testvol SNAP-testvol_dco
v testvol - ENABLED ACTIVE 19318784 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 19318784 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 19318784 0 emc0_02a2 ENA
dc testvol_dco testvol testvol_dcl1
v testvol_dcl1 - ENABLED ACTIVE 1712 SELECT - gen
pl testvol_dcl1-01 testvol_dcl1 ENABLED ACTIVE 1712 CONCAT - RW
sd emc0_02a3-02 testvol_dcl1-01 emc0_02a3 0 1712 0 emc0_02a3 ENA
sp SNAP-testvol_snp1 testvol testvol_dco
Since we are using Fast Mirror Resync (FMR), we can actually start using the snapshot immediately without waiting for the actual SNAPSYNC process to complete.
# vxtask listTASKID PTID TYPE/STATE PCT PROGRESS
206 SNAPSYNC/R 27.37% 0/19318784/5287936 SNAPSYNC SNAP-testvol testdg
# mount -F vxfs /dev/vx/dsk/testdg/SNAP-testvol /tmp/snapshot/
# ls -l /tmp/snapshot/total 3686402
-rw-r--r-- 1 root root 943718400 Feb 2 12:24 900mFile.out
-rw-r--r-- 1 root root 943718400 Feb 2 12:47 900MfileAfterResize.out
drwxr-xr-x 2 root root 96 Feb 2 12:45 lost+found
-rw-r--r-- 1 root root 37 Feb 2 12:18 test1_beforesnapshot
# vxtask -l listTask: 206 RUNNING
Type: SNAPSYNC
Operation: SNAPSYNC Vol SNAP-testvol Dg testdg
Started: Wed 02 Feb 2011 13:03:39 GMT
Throttle: 0
Progress: 39.37% 7606272 of 19318784 Blocks
Work time: 56 seconds (01:26 remaining)
# df -k /tmp/snapshot/Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/testdg/SNAP-testvol
9659392 1863064 7309064 21% /tmp/snapshot
# df -h /tmp/snapshot/Filesystem size used avail capacity Mounted on
/dev/vx/dsk/testdg/SNAP-testvol
9.2G 1.8G 7.0G 21% /tmp/snapshot
# vxtask -l listTask: 206 RUNNING
Type: SNAPSYNC
Operation: SNAPSYNC Vol SNAP-testvol Dg testdg
Started: Wed 02 Feb 2011 13:03:39 GMT
Throttle: 0
Progress: 92.91% 17948672 of 19318784 Blocks
Work time: 2 minutes, 14 seconds (0:10 remaining)
We can perform read/write operations on the snapshot volume or the Primary volume and maintaining the two volumes with separate data from the point when the snapshot refresh operation was performed.
Next we will show the resize operation with Option 2 where we will first reattach the snapshot volume to the primary volume and then performing the resize operation as one volume object.
Using the following command, some or all plexes of an instant snapshot may be reattached to the specified original volume, or to a source volume in the snapshot hierarchy above the snapshot volume:
# vxsnap [-g diskgroup] reattach snapvolume|snapvolume_set source=volume|volume_set [nmirror=number]
By default, all the plexes are reattached, which results in the removal of the snapshot. If required, the number of plexes to be reattached may be specified and the value assigned to the nmirror attribute.
Note: The snapshot that is being reattached must not be open to any application. For example, any file system configured on the snapshot volume must first be unmounted.
First unmount the snapshot volume's filesystem.
# umount /tmp/snapshot/
The following command reattaches one plex from the snapshot volume, SNAP-testvol, to the source volume, testvol:
# vxsnap -b -g testdg reattach SNAP-testvol source=testvol
Since there was no data to re-sync since we already refreshed the snapshot and did not update any other data after that, we got no task to synchronize any data.
While the reattached plexes are being resynchronized from the data in the parent volume, they remain in the SNAPTMP state. After resynchronization is complete, the plexes are placed in the SNAPDONE state. You can use the vxsnap snapwait command (but not vxsnap syncwait) to wait for the resynchronization of the reattached plexes to complete
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v testvol - ENABLED ACTIVE 19318784 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 19318784 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 19318784 0 emc0_02a2 ENA
pl testvol-02 testvol ENABLED SNAPDONE 19318784 CONCAT - WO
sd emc0_029d-01 testvol-02 emc0_029d 0 19318784 0 emc0_029d ENA
dc testvol_dco testvol testvol_dcl1
v testvol_dcl1 - ENABLED ACTIVE 1712 SELECT - gen
pl testvol_dcl1-01 testvol_dcl1 ENABLED ACTIVE 1712 CONCAT - RW
sd emc0_02a3-02 testvol_dcl1-01 emc0_02a3 0 1712 0 emc0_02a3 ENA
pl SNAP-testvol_dcl1-01 testvol_dcl1 DISABLED DCOSNP 1712 CONCAT - RW
sd emc0_029e-02 SNAP-testvol_dcl1-01 emc0_029e 544 1712 0 emc0_029e ENA
If the volume and its snapshot have both been resized (to an identical smaller or larger size) before performing the reattachment, a fast resynchronization can still be performed. A full resynchronization is not required. Version 20 DCO volumes are resized proportionately when the associated data volume is resized.
For version 0 DCO volumes, the FastResync maps stay the same size, but the region size is recalculated, and the locations of the dirty bits in the existing maps are adjusted. In both cases, new regions are marked as dirty in the maps.
Now let us add new disks and perform the resize operation on those disks. We need to add two disks for data volumes. The existing devices for DCO plexes are large enough to handle the increase of the data volume sizes.
# vxdg -g testdg adddisk emc0_029a emc0_029b
# vxdisk -g testdg listDEVICE TYPE DISK GROUP STATUS
emc0_02a2 auto:cdsdisk emc0_02a2 testdg online
emc0_02a3 auto:cdsdisk emc0_02a3 testdg online
emc0_029a auto:cdsdisk emc0_029a testdg online
emc0_029b auto:cdsdisk emc0_029b testdg online
emc0_029d auto:cdsdisk emc0_029d testdg online
emc0_029e auto:cdsdisk emc0_029e testdg online
# vxdg -g testdg freeDISK DEVICE TAG OFFSET LENGTH FLAGS
emc0_02a2 emc0_02a2 emc0_02a2 19318784 1664 -
emc0_02a3 emc0_02a3 emc0_02a3 1712 19318736 -
emc0_029a emc0_029a emc0_029a 0 19320448 -
emc0_029b emc0_029b emc0_029b 0 19320448 -
emc0_029d emc0_029d emc0_029d 19318784 1664 -
emc0_029e emc0_029e emc0_029e 0 544 -
emc0_029e emc0_029e emc0_029e 2256 19318192 -
# df -h /tmp/testvol/Filesystem size used avail capacity Mounted on
/dev/vx/dsk/testdg/testvol
9.2G 1.8G 7.0G 21% /tmp/testvol
# df -k /tmp/testvol/Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/testdg/testvol
9659392 1863064 7309064 21% /tmp/testvol
The resize operation is a normal resize operation as we would perform on any volume and we can define the new devices using the alloc feature.
# vxassist -g testdg maxgrow testvol alloc=emc0_029a,emc0_029bVolume testvol can be extended by 19318784 to: 38637568 (18866Mb)
# vxresize -g testdg testvol 38637568 alloc=emc0_029a,emc0_029b,emc0_02a3,emc0_029e &
# vxtask listTASKID PTID TYPE/STATE PCT PROGRESS
220 RDWRBACK/R 64.83% 0/38637568/25050624 RESYNC testvol testdg
# vxtask listTASKID PTID TYPE/STATE PCT PROGRESS
220 RDWRBACK/R 77.49% 0/38637568/29941248 RESYNC testvol testdg
# vxtask -l list
Task: 220 RUNNING
Type: RDWRBACK
Operation: RESYNC Vol testvol Dg testdg
Started: Wed 02 Feb 2011 13:35:41 GMT
Throttle: 0
Progress: 79.58% 30746752 of 38637568 Blocks
Work time: 15007 days, 13 hours, 38 minutes, 13 seconds (92436:39:28 remaining)
The resize operation will take a while in this case due to the read writeback operation to sync up the plexes of the mirrors and till the reattach is completed, the snapshots cannot be created again.
This is the main drawback as compared to using the first option to perform the resize operation, since the resize is quicker and the refresh can be completed in the background while we can already start using the Snapshot Volume/Filesystem.
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029a emc0_029a auto 65536 19320448 -
dm emc0_029b emc0_029b auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v testvol - ENABLED ACTIVE 38637568 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 38637568 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 19318784 0 emc0_02a2 ENA
sd emc0_02a3-01 testvol-01 emc0_02a3 1712 19318736 19318784 emc0_02a3 ENA
sd emc0_029b-02 testvol-01 emc0_029b 2880 48 38637520 emc0_029b ENA
pl testvol-02 testvol ENABLED SNAPDONE 38637568 CONCAT - WO
sd emc0_029d-01 testvol-02 emc0_029d 0 19318784 0 emc0_029d ENA
sd emc0_029a-02 testvol-02 emc0_029a 2880 592 19318784 emc0_029a ENA
sd emc0_029e-01 testvol-02 emc0_029e 2256 19318192 19319376 emc0_029e ENA
dc testvol_dco testvol testvol_dcl
v testvol_dcl - ENABLED ACTIVE 2880 SELECT - gen
pl testvol_dcl-01 testvol_dcl DISABLED DCOSNP 2880 CONCAT - RW
sd emc0_029a-01 testvol_dcl-01 emc0_029a 0 2880 0 emc0_029a ENA
pl testvol_dcl-02 testvol_dcl ENABLED ACTIVE 2880 CONCAT - RW
sd emc0_029b-01 testvol_dcl-02 emc0_029b 0 2880 0 emc0_029b ENA
# df -h /tmp/testvol/Filesystem size used avail capacity Mounted on
/dev/vx/dsk/testdg/testvol
18G 1.8G 16G 11% /tmp/testvol
# df -k /tmp/testvol/Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/testdg/testvol
19318784 1865434 16362522 11% /tmp/testvol
Once the filesystem is resized, we can perform the snapshot operation again to use the data for backup and/or offhost processing
So we create the snapshot for the third-mirror breakoff snapshot.
# vxsnap -g testdg make source=testvol/newvol=SNAP-testvol/plex=testvol-02
# vxprint -qhtrg testdgdg testdg default default 20000 1296648197.47.rdgv240sol05
dm emc0_02a2 emc0_02a2 auto 65536 19320448 -
dm emc0_02a3 emc0_02a3 auto 65536 19320448 -
dm emc0_029a emc0_029a auto 65536 19320448 -
dm emc0_029b emc0_029b auto 65536 19320448 -
dm emc0_029d emc0_029d auto 65536 19320448 -
dm emc0_029e emc0_029e auto 65536 19320448 -
v SNAP-testvol - ENABLED ACTIVE 38637568 ROUND - fsgen
pl testvol-02 SNAP-testvol ENABLED ACTIVE 38637568 CONCAT - RW
sd emc0_029d-01 testvol-02 emc0_029d 0 19318784 0 emc0_029d ENA
sd emc0_029a-02 testvol-02 emc0_029a 2880 592 19318784 emc0_029a ENA
sd emc0_029e-01 testvol-02 emc0_029e 2256 19318192 19319376 emc0_029e ENA
dc SNAP-testvol_dco SNAP-testvol SNAP-testvol_dcl
v SNAP-testvol_dcl - ENABLED ACTIVE 2880 ROUND - gen
pl testvol_dcl-01 SNAP-testvol_dcl ENABLED ACTIVE 2880 CONCAT - RW
sd emc0_029a-01 testvol_dcl-01 emc0_029a 0 2880 0 emc0_029a ENA
sp testvol_snp SNAP-testvol SNAP-testvol_dco
v testvol - ENABLED ACTIVE 38637568 SELECT - fsgen
pl testvol-01 testvol ENABLED ACTIVE 38637568 CONCAT - RW
sd emc0_02a2-01 testvol-01 emc0_02a2 0 19318784 0 emc0_02a2 ENA
sd emc0_02a3-01 testvol-01 emc0_02a3 1712 19318736 19318784 emc0_02a3 ENA
sd emc0_029b-02 testvol-01 emc0_029b 2880 48 38637520 emc0_029b ENA
dc testvol_dco testvol testvol_dcl
v testvol_dcl - ENABLED ACTIVE 2880 SELECT - gen
pl testvol_dcl-02 testvol_dcl ENABLED ACTIVE 2880 CONCAT - RW
sd emc0_029b-01 testvol_dcl-02 emc0_029b 0 2880 0 emc0_029b ENA
sp SNAP-testvol_snp testvol testvol_dco
As we have shown using both the methods above, the ideal and recommended way to perform the resize operation is to maintain the snapshot as shown in the Method 1 above.
Please refer to the Volume Manager Administrator's Guide for further reference. All of the above steps have been performed in accordance with the documentation in the Administrator's Guide.
The Documentation can be found from our portal at: https://docs.infoscale.com
How to create a third-mirror break-off snapshot and increase the volume and filesystem size in the snapshot hierarchy