Linked break-off snapshot
In this post we are going to see about Linked break-off snapshot. Unlike the full-sized instant snapshots, this volume can be set up in a different disk group from the data volume and possible to refresh the snapshot.
High-level plan for backup using Linked break-off snapshot
1. Prepare the data volume for snapshot
2. Create new diskgroup and volume for a snapshot.
3. Link the snapshot volume and data volume.
4. Break the link to create a snapshot.
5. Deport the snapshot diskgroup on a database server and import the diskgroup on the backup server.
6. Mount the snapshot volume and perform the backup.
7.once the backup is done, deport the snapshot diskgroup from the backup server and bring it back to the database server for next backup.
8. Refresh the snapshot using reattach command and perform the same from step no:4 as a routine process.
Here I have demonstrated the linked break-off snapshot using volume oravol1.
v oravol1 - ENABLED ACTIVE 204800 SELECT - fsgen pl oravol1-01 oravol1 ENABLED ACTIVE 204800 CONCAT - RW sd UXDISK2-02 oravol1-01 UXDISK2 61744 81312 0 disk_1 ENA sd UXDISK3-02 oravol1-01 UXDISK3 67840 75216 81312 disk_4 ENA sd UXDISK4-02 oravol1-01 UXDISK4 67840 48272 156528 disk_5 ENA
1. Prepare the volume for Linked break-off snapshot. Here we are just preparing the data volume for instant snapshot using vxsnap command.
# bash-3.00# vxsnap -g UXDG prepare oravol1 drl=off ndcomirs=2 bash-3.00# vxprint -hvt Disk group: UXDG v oravol1 - ENABLED ACTIVE 204800 SELECT - fsgen pl oravol1-01 oravol1 ENABLED ACTIVE 204800 CONCAT - RW sd UXDISK2-02 oravol1-01 UXDISK2 61744 81312 0 disk_1 ENA sd UXDISK3-02 oravol1-01 UXDISK3 67840 75216 81312 disk_4 ENA sd UXDISK4-02 oravol1-01 UXDISK4 67840 48272 156528 disk_5 ENA dc oravol1_dco oravol1 oravol1_dcl v oravol1_dcl - ENABLED ACTIVE 67840 SELECT - gen pl oravol1_dcl-01 oravol1_dcl ENABLED ACTIVE 67840 CONCAT - RW sd UXDISK4-01 oravol1_dcl-01 UXDISK4 0 67840 0 disk_5 ENA pl oravol1_dcl-02 oravol1_dcl ENABLED ACTIVE 67840 CONCAT - RW sd UXDISK3-01 oravol1_dcl-02 UXDISK3 0 67840 0 disk_4 ENA
2. Create new diskgroup for the snapshot – Create a new diskgroup called sanpshotdg and create a similar sized volume to be used for snapshot mirror.
bash-3.00# vxdg init snapshotdg SNAPD1=disk_6 SNAPD2=disk_7 bash-3.00# vxassist -g snapshotdg make snapvol 100M bash-3.00# vxdg list NAME STATE ID UXDG enabled,cds 1364804784.18.sfos snapshotdg enabled,cds 1365768419.27.sfos
3. Prepare the snap volume. This is same like how we have done for data volume oravol1.
# vxsnap -g snapshotdg prepare snapvol drl=off ndcomirs=2 bash-3.00# vxprint -hvtg snapshotdg v snapvol - ENABLED ACTIVE 204800 SELECT - fsgen pl snapvol-01 snapvol ENABLED ACTIVE 204800 CONCAT - RW sd SNAPD2-01 snapvol-01 SNAPD2 0 204800 0 disk_7 ENA dc snapvol_dco snapvol snapvol_dcl v snapvol_dcl - ENABLED ACTIVE 67840 SELECT - gen pl snapvol_dcl-01 snapvol_dcl ENABLED ACTIVE 67840 CONCAT - RW sd SNAPD1-01 snapvol_dcl-01 SNAPD1 0 67840 0 disk_6 ENA pl snapvol_dcl-02 snapvol_dcl ENABLED ACTIVE 67840 CONCAT - RW sd SNAPD2-02 snapvol_dcl-02 SNAPD2 204800 67840 0 disk_7 ENA
4.Link the oravol1 to snapvol. By doing this, data will be syncing between these volumes.
#vxsnap -g UXDG -b addmir oravol1 mirvol=snapvol mirdg=snapshotdg #vxprint -hvt Disk group: UXDG v oravol1 - ENABLED ACTIVE 204800 SELECT - fsgen pl oravol1-01 oravol1 ENABLED ACTIVE 204800 CONCAT - RW sd UXDISK2-02 oravol1-01 UXDISK2 61744 81312 0 disk_1 ENA sd UXDISK3-02 oravol1-01 UXDISK3 67840 75216 81312 disk_4 ENA sd UXDISK4-02 oravol1-01 UXDISK4 67840 48272 156528 disk_5 ENA dc oravol1_dco oravol1 oravol1_dcl v oravol1_dcl - ENABLED ACTIVE 67840 SELECT - gen pl oravol1_dcl-01 oravol1_dcl ENABLED ACTIVE 67840 CONCAT - RW sd UXDISK4-01 oravol1_dcl-01 UXDISK4 0 67840 0 disk_5 ENA pl oravol1_dcl-02 oravol1_dcl ENABLED ACTIVE 67840 CONCAT - RW sd UXDISK3-01 oravol1_dcl-02 UXDISK3 0 67840 0 disk_4 ENA ln oravol1_ln oravol1 oravol1_dco Disk group: snapshotdg v snapvol - ENABLED ACTIVE 204800 SELECT - fsgen pl snapvol-01 snapvol ENABLED ACTIVE 204800 CONCAT - RW sd SNAPD2-01 snapvol-01 SNAPD2 0 204800 0 disk_7 ENA dc snapvol_dco snapvol snapvol_dcl v snapvol_dcl - ENABLED ACTIVE 67840 SELECT - gen pl snapvol_dcl-01 snapvol_dcl ENABLED ACTIVE 67840 CONCAT - RW sd SNAPD1-01 snapvol_dcl-01 SNAPD1 0 67840 0 disk_6 ENA pl snapvol_dcl-02 snapvol_dcl ENABLED ACTIVE 67840 CONCAT - RW sd SNAPD2-02 snapvol_dcl-02 SNAPD2 204800 67840 0 disk_7 ENA ln snapvol_ln snapvol snapvol_dco
5. Create a linked break-off snapshot. We are just breaking the sync from data volume oravol1.
#vxsnap -g UXDG make source=oravol1/snapvol=snapvol1/snapdg=snapshotdg
6.verifying our work. Now you can see both data volume “oravol1” and snapshot volume “snapvol” should have identical data.
# df -h . Filesystem size used avail capacity Mounted on /dev/vx/dsk/UXDG/oravol1 100M 74M 24M 76% /apporavol1 # ls -lrt total 145408 drwxr-xr-x 2 root root 96 Apr 1 14:04 lost+found -rw------T 1 root root 10485760 Apr 1 14:05 test1 -rw------T 1 root root 10485760 Apr 1 14:05 run -rw------T 1 root root 10485760 Apr 1 14:05 unixarena -rw------T 1 root root 20971520 Apr 1 23:31 SOIS -rw------T 1 root root 20971520 Apr 1 23:42 sois2 -rw------T 1 root root 1048576 Apr 1 23:45 TEST # mount -F vxfs /dev/vx/dsk/snapshotdg/snapvol /snaporavol1/ # cd /snaporavol1/ # ls -lrt total 145408 drwxr-xr-x 2 root root 96 Apr 1 14:04 lost+found -rw------T 1 root root 10485760 Apr 1 14:05 test1 -rw------T 1 root root 10485760 Apr 1 14:05 run -rw------T 1 root root 10485760 Apr 1 14:05 unixarena -rw------T 1 root root 20971520 Apr 1 23:31 SOIS -rw------T 1 root root 20971520 Apr 1 23:42 sois2 -rw------T 1 root root 1048576 Apr 1 23:45 TEST
Note: I haven’t demonstrated the deport and import diskgroup to the backup server since its out of the scope of this tutorial.
7. Reattach the snapshot to volume. If you want to sync the data with oravol1 for a new backup, just reattach the snapvol to oravol and perform the step:5 again to take a new snapshot.
# vxsnap -g snapshotdg reattach snapvol source=oravol1 sourcedg=UXDG
Thank you for reading this. Please leave a comment if you have any doubt. I will get back to you as soon as possible.
Leave a Reply