From Wiki-UX.info

Wiki-UX / Logical Volume Manager / How to use SAN snapshots for Disaster Recovery
Jump to: navigation, search

How to use SAN snapshots for Disaster Recovery

This article presents a brief description of utilizing a SAN snapshot, cloning on a LVM environment and how to import the cloned volume groups

Abstract

This article presents a brief description of utilizing a SAN snapshot (cloning) on a LVM environment and how to import the cloned volume groups. The source and duplicated physical volumes (LUNs) are presented to only the require hosts larry and moe respectively. The vgchangeid command is not used to change VGID of the cloned physical volumes since the source host larry has no access to it.

Contents


larry (Production)

# strings /etc/lvmtab
/dev/vg00
/dev/swap
/dev/vg01
/dev/vg02

moe (Disaster Recovery)

# strings /etc/lvmtab
/dev/vg00
/dev/swap

An SAN backing storage feature is use to take a snapshots (clones) of the physical volumes (LUNs) from /dev/vg01 and /dev/vg02 on larry. Those snapshot physical volumes are presented to moe for the Disaster Recovery scenario.

1. First, create map files of /dev/vg01 and /dev/vg02 on larry to import on moe. Since the physical volumes are cloned, the VGID will be the same on the cloned LUN.

# vgexport -p -s -m /larry01.map vg01
# vgexport -p -s -m /larry02.map vg02

2. Move the map files to moe, using ftp or copying the file contents from the terminal sessions.

3. Create /dev/larry01 and /dev/larry02 volume group device special files.

# mkdir /dev/larry01
# mknod /dev/larry01/group c 64 0x050000

# mkdir /dev/larry02
# mknod /dev/larry02/group c 64 0x060000

4. Import /dev/larry01 and /dev/larry02 volume groups.

# vgimport -s -m /larry01.map larry01
# vgimport -s -m /larry02.map larry02

After importing, the lvmtab file on moe will reflect the new settings:

# strings /etc/lvmtab
/dev/vg00
/dev/swap
/dev/larry01     <--- Imported volume group
/dev/larry02     <--- Imported volume group

5. Activate the volume groups

# vgchange -a y larry01
# vgchange -a y larry02

6. Check file system consistency

# fsck /dev/larry01/rlvol1
# fsck /dev/larry02/rlvol1

7. Update /etc/fstab file to point to /dev/larry01/lvol1 and /dev/larry01/lvol1 logical volumes.

8. Mount file systems.

# mount /DB
# mount /backup

Note: The rollback from "moe" to "larry" will be handle by the EMC utility to resync the cloned physical volumes (LUNS) with the source physical volumes. Since VGID will be the same, there is not need to export / import the volume groups in "larry", only volume group reactivation and file system check will be needed.

Reference

Authors

This page was last modified on 3 August 2011, at 19:54. This page has been accessed 2,044 times.