Connecting To SAN Snapshot™ Copies On HP-UX™
Connecting To SAN Snapshot™ Copies On HP-UX™
Connecting To SAN Snapshot™ Copies On HP-UX™
TECHNICAL REPORT
management strategies.
advanced storage solutions and global data
complex technical challenges with
organizations understand and meet
leader in data storage technology, helps
Network Appliance, a pioneer and industry
PARTNER
LOGO
1
TECHNICAL REPORT
Table of Contents
1. Scope
2. Intended Audience
3. Requirements and Assumptions
4. Mapping from File System to NetApp Filer Disks
5. Overview of the Process
6. Steps to Connect to LUNs Created with Snapshot Copies
7. Example of Connecting to a LUN from a Snapshot Copy
8. Graphical Representation of Example
9. Steps to Return to the Original State
10. Example of Returning to the Original State
11. Automation/Scripting
2
TECHNICAL REPORT
Abstract
This document describes the steps necessary to connect LUNs created with NetApp filer
Snapshot copy technology to an HP-UX system using HP's Logical Volume Manager
(LVM) in a SAN environment.
1. Scope
This document covers the steps needed for mounting NetApp filer Snapshot copies from
LUNs from HP-UX systems. In other words, it describes how to gain read/write access to
Snapshot copies created for file systems on HP-UX systems. It does not expand on the
multitude of reasons for wanting to gain access to these Snapshot copies, for example,
restore, backup, consistency checking, data mining, etc.
2. Intended Audience
This paper is intended for system and storage administrators.
• The reader has at least basic HP-UX administration skills and has access to the
administrative login for the server.
• The reader has at least basic Network Appliance administration skills and has
administrative access to the filer via the command-line interface.
• The filer and host have the necessary licenses to perform the activities outlined
in this document.
• The target system has the required block-level and network protocol
interconnects to perform the activities outlined in this document.
• Snapshot copies of the file system or, more correctly stated, Snapshot copies of
the NetApp filer volumes containing the LUNs for the file system have already
been created, and they have been created in such a way that the content of the
LUNs is consistent. The recommend method is using NetApp SnapDrive™ for
UNIX®.
• The Snapshot copies will be mounted on the same system where the original
LUNs are mounted. It is generally considered a simpler case to mount the LUNs
to a different (often referred to as nonoriginating) host because the problem of
"duplicate volume group IDs" generally does not exist. This procedure is
considered a safe approach because the HP-UX LVM volume group (VG) ID is
changed before mounting and will work equally well on originating or
nonoriginating hosts.
3
TECHNICAL REPORT
• In the examples in this report, all administrative commands are performed at the
server or filer console for clarity. Web-based management tools can also be
used.
• Physical volumes are formatted raw devices or LUNs from a host perspective.
There is a one-to-one relationship between physical volumes and LUNs on the
NetApp filer.
• Each LUN is mapped to one and only one NetApp filer volume.
For the sake of simplicity, the logical diagram shown below does not show the multiple
paths to each LUN.
4
TECHNICAL REPORT
5
TECHNICAL REPORT
6
TECHNICAL REPORT
7
TECHNICAL REPORT
Step Example
1 root> sanlun lun show -p
root>
2 filer1> lun show -m
LUN path Mapped to LUN ID
-------------------------------------------------------------
/vol/vol1/sh-hp1-lun-010 sh-hp1 10
/vol/vol1/sh-hp2-lun2049 sh-hp2 2049
filer1>
3 filer1> snap list vol1
Volume vol1
working...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Feb 29 12:52 test_hpux_snap
filer1>
4 filer1> lun create -b /vol/vol1/.snapshot/test_hpux_snap/sh-hp2-lun2049
/vol/vol1/snap-sh-hp2-lun2049
filer1>
5 filer1> lun map /vol/vol1/snap-sh-hp2-lun2049 sh-hp2 13
filer1>
6 root> ioscan -fnC disk
root>
7 root> insf -Cdisk
insf: Installing special files for sdisk instance 9 address 0/4/0/0.1.4.0.0.1.5
Network Appliance Inc.
8
TECHNICAL REPORT
root>
9 root> vgchgid /dev/rdsk/c52t1d5 /dev/rdsk/c41t1d6
10 root> ls -l /dev/*/group
vgimport: Warning: Volume Group contains "1" PVs, "4" specified. Continuing.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after
activating the volume group.
14 root> vgchange -a y /dev/vgsanp
Activated volume group
Volume group "/dev/vgsnap" has been successfully changed.
root>
15 root> mkdir 777 /mnt/snap
root>
16 root> mount /dev/vgsnap/lvol1 /mnt/snap
9
TECHNICAL REPORT
10
TECHNICAL REPORT
r13- vgexport /dev/<vgsnap> Host This command will remove the host VG, including
r10 the /dev/<vgsnap> directory and group file from the
host.
r9 No action necessary This change, which was written to the disk, will be
lost when the LUNs are destroyed in a later step.
r8 No action necessary This was for information only.
r7-r6 rmsf -k Host These commands remove the device files from the
/dev/dsk/<cXtYdZ> system kernel (-k) and from the file system. Both
/dev/dsk/<cXtYdZ> commands need to be executed and should be
/dev/dsk/<cXtYdQ>
...
executed with the same list of device files. The list
of device files should be the same as what was
rmsf /dev/dsk/<cXtYdZ> given in step 13 during the create process.
/dev/dsk/<cXtYdZ>
dev/dsk/<cXtYdQ>
...
r5 lun unmap Filer This command removes the mapping of the LUNs
<new_lun_name><igroup> from the igroup.
r4-r1 lun destroy Filer This command removes the created LUN. After this
<new_lun_name> command is executed, the LUN within the
Snapshot copy is returned to its original state.
Step Example
r16 root> umount /mnt/snap
r15 root> rmdir /mnt/snap
r14 root> vgchange -a n /dev/vgsanp
Volume group "/dev/vgsnap" has been successfully
changed.
root>
r13- root> vgexport /dev/vgsnaproot>
r10
r7-r6 root> rmsf -k /dev/dsk/c52t1d5 /dev/dsk/c53t1d5
/dev/dsk/c55t1d5 /dev/dsk/c54t1d5
root>
root> rmsf /dev/dsk/c52t1d5 /dev/dsk/c53t1d5
/dev/dsk/c55t1d5 /dev/dsk/c54t1d5
root>
r5 filer1> lun unmap /vol/vol1/snap-sh-hp2-lun2049 sh-
hp2filer1>
r4-r1 filer1> lun destroy /vol/vol1/snap-sh-hp2-lun2049
11
TECHNICAL REPORT
11. Automation/Scripting
This is a procedure that typically is done repeatedly and is automated through scripts
where the data is then backed up to tape, analyzed, checked for consistency, etc.
Typically, the Snapshot copies are created and renamed using the same names each
time to make the scripting process easier. Also, by using the same mappings each time,
the steps of finding the LUNs and creating the device files can be eliminated.
In a scripted solution, normally only steps 4, 5, 9, 11 through 14, and 16 will need to be
done each time to gain access to the Snapshot copies, and steps r16, r14, r13, r5, and
r4 are necessary to return to the starting state.
© 2004 Network Appliance, Inc. All rights reserved. Specifications subject to change without notice. NetApp, the Network Appliance logo, DataFabric,
FAServer, FilerView, NearStore, NetCache, SecureShare, SnapManager, SnapMirror, SnapRestore, and WAFL are registered trademarks and
Network Appliance, ApplianceWatch, BareMetal, Camera-to-Viewer, Center-to-Edge, ContentDirector, ContentFabric, Data ONTAP, EdgeFiler,
Network Appliance Inc. HyperSAN, InfoFabric, MultiStore, NetApp Availability Assurance, NetApp ProTech Expert, NOW, NOW NetApp on the Web, RoboCache, RoboFiler,
SecureAdmin, Serving Data by Design, Smart SAN, SnapCache, SnapCopy, SnapDirector, SnapDrive, SnapFilter, SnapMigrator, Snapshot,
SnapSuite, SnapVault, SohoCache, SohoFiler, The evolution of storage, Vfiler, VFM, Virtual File Manager, and Web Filer are trademarks of Network
Appliance, Inc. in the U.S. and other countries. All other brands or products are trademarks or registered trademarks of their respective holders and
should be treated as such.
12