32
SnapDrive™ for UNIX® Quick Start Guide (IBM® AIX®, HP-UX®, Linux®, Solaris®) Network Appliance, Inc. 495 East Java Drive Sunnyvale, CA 94089 USA Telephone: +1 (408) 822-6000 Fax: +1 (408) 822-4501 Support telephone: +1 (888) 4-NETAPP Documentation comments: [email protected] Information Web: http://www.netapp.com Part number 210-00733_B0 August 2005

SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

  • Upload
    lyquynh

  • View
    223

  • Download
    1

Embed Size (px)

Citation preview

Page 1: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

SnapDrive™ for UNIX® Quick Start Guide (IBM® AIX®, HP-UX®, Linux®, Solaris®)

Network Appliance, Inc.495 East Java DriveSunnyvale, CA 94089 USATelephone: +1 (408) 822-6000Fax: +1 (408) 822-4501Support telephone: +1 (888) 4-NETAPPDocumentation comments: [email protected] Web: http://www.netapp.com

Part number 210-00733_B0August 2005

Page 2: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Copyright and trademark information

Copyright information

Copyright © 1994—2005 Network Appliance, Inc. All rights reserved. Printed in the U.S.A.

No part of this document covered by copyright may be reproduced in any form or by any means—graphic, electronic, or mechanical, including photocopying, recording, taping, or storage in an electronic retrieval system—without prior written permission of the copyright owner.

Software derived from copyrighted Network Appliance material is subject to the following license and disclaimer:

THIS SOFTWARE IS PROVIDED BY NETWORK APPLIANCE “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NETWORK APPLIANCE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Network Appliance reserves the right to change any products described herein at any time, and without notice. Network Appliance assumes no responsibility or liability arising from the use of products described herein, except as expressly agreed to in writing by Network Appliance. The use or purchase of this product does not convey a license under any patent rights, trademark rights, or any other intellectual property rights of Network Appliance.

The product described in this manual may be protected by one or more U.S. patents, foreign patents, or pending applications.

RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.277-7103 (October 1988) and FAR 52-227-19 (June 1987).

Trademark information

NetApp, the Network Appliance logo, the bolt design, NetApp–the Network Appliance Company, DataFabric, FAServer, FilerView, MultiStore, NearStore, NetCache, SecureShare, SnapManager, SnapMirror, SnapMover, SnapRestore, SnapVault, SyncMirror, and WAFL are registered trademarks of Network Appliance, Inc. in the United States, and/or other countries. Data ONTAP, gFiler, Network Appliance, SnapCopy, Snapshot, and The Evolution of Storage are trademarks of Network Appliance, Inc. in the United States and/or other countries and registered trademarks in some other countries. ApplianceWatch, BareMetal, Camera-to-Viewer, ComplianceClock, ComplianceJournal, ContentDirector, ContentFabric, EdgeFiler, FlexClone, FlexVol, FPolicy, HyperSAN, InfoFabric, LockVault, Manage ONTAP, NOW, NetApp on the Web, ONTAPI, RAID-DP, RoboCache, RoboFiler, SecureAdmin, Serving Data by Design, SharedStorage, Simulate ONTAP, Smart SAN, SnapCache, SnapDirector, SnapDrive, SnapFilter, SnapLock, SnapMigrator, SnapSuite, SnapValidator, SohoFiler, vFiler, VFM, Virtual File Manager, VPolicy, and Web Filer are trademarks of Network Appliance, Inc. in the United States and other countries. NetApp Availability Assurance and NetApp ProTech Expert are service marks of Network Appliance, Inc. in the United States. Spinnaker Networks, the Spinnaker Networks logo, SpinAccess, SpinCluster, SpinFS, SpinHA,

ii Copyright and trademark information

Page 3: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

SpinMove, and SpinServer are registered trademarks of Spinnaker Networks, LLC in the United States and/or other countries. SpinAV, SpinManager, SpinMirror, SpinRestore, SpinShot, and SpinStor are trademarks of Spinnaker Networks, LLC in the United States and/or other countries.

Apple is a registered trademark and QuickTime is a trademark of Apple Computer, Inc. in the United States and/or other countries. Microsoft is a registered trademark and Windows Media is a trademark of Microsoft Corporation in the United States and/or other countries. RealAudio, RealNetworks, RealPlayer, RealSystem, RealText, and RealVideo are registered trademarks and RealMedia, RealProxy, and SureStream are trademarks of RealNetworks, Inc. in the United States and/or other countries.

All other brands or products are trademarks or registered trademarks of their respective holders and should be treated as such.

Network Appliance is a licensee of the CompactFlash and CF Logo trademarks.

Network Appliance NetCache is certified RealSystem compatible.

Copyright and trademark information iii

Page 4: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

iv Copyright and trademark information

Page 5: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Table of Contents

Chapter 1 A Quick Look at SnapDrive for UNIX. . . . . . . . . . . . . . . . . . . . . 1

High-level overview of SnapDrive for UNIX . . . . . . . . . . . . . . . . . . 2

Quickly installing and setting up SnapDrive for UNIX . . . . . . . . . . . . . 4

Other configuration commands. . . . . . . . . . . . . . . . . . . . . . . . . . 7

Chapter 2 Quickly Learning About Snapshots and Storage . . . . . . . . . . . . . . . 9

Getting started with snapshots . . . . . . . . . . . . . . . . . . . . . . . . . 10

Sample script for working with snapshots and storage . . . . . . . . . . . . . 18

More commands for working with storage . . . . . . . . . . . . . . . . . . . 26

Table of Contents v

Page 6: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

vi Table of Contents

Page 7: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Chapter 1: A Quick Look at SnapDrive for UNIX

1

A Quick Look at SnapDrive for UNIX

About this chapter This chapter provides a brief overview of SnapDrive for UNIX and how you install and configure it. It contains the following topics:

◆ “High-level overview of SnapDrive for UNIX” on page 2

◆ “Quickly installing and setting up SnapDrive for UNIX” on page 4

◆ “Other configuration commands” on page 7

1

Page 8: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

High-level overview of SnapDrive for UNIX

About SnapDrive for UNIX

The SnapDrive for UNIX software simplifies storage management by letting you:

◆ Back up and restore data. SnapDrive for UNIX lets you use NetApp® Snapshot™ technology to make an image (snapshot) of host data that is stored on a NetApp storage system. This snapshot provides you with a copy of that data, which you can restore later. The data in the snapshot can exist on one storage system or span multiple storage systems and their volumes.

◆ Manage storage. You can create and delete storage components, including disk groups, host volumes, file systems, and LUNs. SnapDrive for UNIX enables you to manage this storage by expanding it, connecting it to a host, and disconnecting it.

Supported host platforms

The most complete list of host platforms that SnapDrive for UNIX supports is in the online SnapDrive for UNIX Compatibility Matrix. This matrix is on the NOW site at http://now.netapp.com/NOW/knowledge/docs/docs.shtml.

At the time this document was prepared, SnapDrive for UNIX supported the following host platforms:

◆ IBM® AIX® with either NetApp’s FCP host attach kit or NetApp’s iSCSI support kit installed

◆ HP-UX® with either the FCP host attach kit or iSCSI support kit installed

◆ Red Hat® Enterprise Linux® with the iSCSI support kit installed

◆ Solaris® with the FCP host attach kit installed

Check the NOW site for SnapDrive for UINX requirements

For information about the requirements for running SnapDrive for UNIX on each of its platforms, see the SnapDrive for UNIX Compatibility Matrix and the Compatibility and Configuration Guide for NetApp’s FCP and iSCSI Products. These matices are at http://now.netapp.com/NOW/knowledge/docs/docs.shtml/)

Some terms used by this guide

These are some terms this guide uses:

◆ Disk group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group. As a result, some commands include both -dg and -vg. In general,

2 High-level overview of SnapDrive for UNIX

Page 9: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

you can use either argument and get the same result. To make this guide easier to follow, it uses the term disk group and -dg to refer to both disk and volume groups.

◆ Logical volume and host volume. Some of the platforms that SnapDrive for UNIX supports use the term volume or host volume while others use the term logical volume. To simplify the terminology and make a distinction between volumes on the host and volumes on the storage system, this guide uses the term host volume and the command line argument -hostvol to refer to all volumes on the host.

◆ Snapshot. This is an image of data on one or more storage systems that was made at a specific point in time using NetApp Snapshot technology. You can use this snapshot to recover the data that has been accidentally deleted or modified since you took the snapshot.

Where to go for more information

This guide provides an overview of some tasks you can perform with SnapDrive for UNIX. For more information about SnapDrive for UNIX, detailed instructions on using its commands, and information on its requirements, see the following documents:

◆ SnapDrive for UNIX Installation and Administration Guide (IBM AIX, HP-UX, Linux, Solaris)

◆ SnapDrive for UNIX Release Notes (IBM AIX, HP-UX, Linux, Solaris)

◆ The SnapDrive for UNIX man page

◆ SnapDrive for UNIX Compatibility Matrix and the Compatibility and Configuration Guide for NetApp’s FCP and iSCSI Products (both these matrices are on the NOW site)

Chapter 1: A Quick Look at SnapDrive for UNIX 3

Page 10: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Quickly installing and setting up SnapDrive for UNIX

High-level installation overview

You can quickly install and set up SnapDrive for UNIX. The following table takes you through the basic installation and configuration steps. It also provides pointers to where you can find more information about a step. In most cases, these pointers refer you to a section in a chapter in the SnapDrive for UNIX Installation and Administration Guide.

NoteFor detailed information on installing SnapDrive for UNIX on your host, see Chapter 2: Installing SnapDrive for UNIX in the SnapDrive for UNIX Installation and Administration Guide. Information on configuring SnapDrive for UNIX is in chapters 3 and 4.

Step Action More information

Preparing to install the SnapDrive for UNIX software package

1 Make sure your host and storage systems are set up correctly.

For the host:

◆ Make sure the FCP attach kit or iSCSI support kit is installed and you have performed the following tasks. These tasks are explained in the attach kit/support kit documentation.

❖ Set up the multipathing software, if it is supported on your host platform.

❖ Created and configured LUNs.

❖ Mapped LUNs to the host and verified that the host can see the LUNs.

❖ Verified that the host and storage system can communicate.

◆ Check that the host meets the SnapDrive for UNIX system requirements.

NoteSometimes SnapDrive for UNIX requirements are a subset of the attach kit/support kit system requirements.

See the following:

◆ The attach kit or support kit documentation.

◆ NOW description page for your host operating system

◆ The SnapDrive Compatibility Matrix

◆ The section Verify that the hosts are ready and the installation section for your host platform (Chapter 2, Installation and Administration Guide)

4 Quickly installing and setting up SnapDrive for UNIX

Page 11: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

For the storage system:

◆ Check that it meets the system requirements, including having the following set up:

❖ Data ONTAP™

❖ The IP address on the storage system cluster (used if a takeover occurs)

❖ The correct protocol license for your platform (FCP or iSCSI)

❖ The SnapRestore® license

◆ The section Verifying that your storage systems are ready (Chapter 2, Installation and Administration Guide.

◆ The Data ONTAP documentation that came with your storage system.

2 Get a copy of the SnapDrive for UNIX software:

◆ Download the software from the NOW site

◆ Get the software from the SnapDrive for UNIX CD-ROM

See the section Get a copy of the SnapDrive for UNIX software package (Chapter 2, Installation and Administration Guide).

Installing SnapDrive for UNIX

3 Log in as root and go to the directory where you placed the SnapDrive for UNIX software package (you can also install directly from the CD-ROM).

Execute the install script or command to install SnapDrive for UNIX on your host:

◆ AIX: Uncompress the file NetApp.snapdrive_aix_2_0.Z; then use SMIT to install NetApp.snapdrive_aix_2_0.

◆ HP-UX: # swinstall -s <pathname>/NTAPsnapdrive_hpux_2_0.depot snapdrive

◆ Linux: # rpm -U -v <pathname>/netapp.snapdrive.linux_2_0.rpm

◆ Solaris: From the directory containing the installation package, execute the ./install command.

See the installation section for your host operating system (Chapter 2, Installation and Administration Guide).

Step Action More information

Chapter 1: A Quick Look at SnapDrive for UNIX 5

Page 12: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Configuring SnapDrive for UNIX

4 Specify the current login information for each storage system by using the snapdrive config set user command. SnapDrive for UNIX needs this information to access the storage system.

To get the user names for storage systems attached to the host, execute the snapdrive config list command. This command does not display the storage system passwords.

Example: This example uses the snapdrive config set command to provide SnapDrive for UNIX with the user name for the storage system toaster. The storage system in this example does not have a password. It then uses the snapdrive config list command to confirm the user name for the storage system toaster.

# snapdrive config set root toaster Password for root: Retype Password: Access to filer toaster has been configured for user root# snapdrive config listuser name filer name-----------------------------root toaster#

See the section Specifying the current login information for storage systems (Chapter 4, Installation and Administration Guide).

5 Recommended: Enable autosupport on one of the storage systems. Enter the name of the storage system you want to use for autosupport as the value for the autosupport-filer variable in the SnapDrive for UNIX snapdrive.conf file. This file is located in your installation directory. Use a text editor to edit it.

NoteThe snapdrive.conf file contains several settings you can change, including the locations for the log files. In most cases, NetApp recommends you accept the default values.

See the section Setting up autosupport (Chapter 3, Installation and Administration Guide).

Step Action More information

6 Quickly installing and setting up SnapDrive for UNIX

Page 13: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Other configuration commands

More configuration commands for SnapDrive for UNIX

The following table summarizes additional commands that are helpful in configuring SnapDrive for UNIX.

Description Command or Action More information

Configuring and verifying your version of SnapDrive for UNIX software

Check the values in the snapdrive.conf file. snapdrive config show See the section Setting values in snapdrive.conf (Chapter 3, Installation and Administration Guide).

Check your version of SnapDrive for UNIX.

snapdrive version See the section Checking your version of SnapDrive for UNIX (Chapter 3, Installation and Administration Guide).

Change the path name and options for the log files. SnapDrive for UNIX logs information to three files:

◆ An audit file

◆ A recovery file

◆ A trace file

Edit the variables in the snapdrive.conf file

See the section Setting up audit, recovery, and trace logging (Chapter 3, Installation and Administration Guide).

Chapter 1: A Quick Look at SnapDrive for UNIX 7

Page 14: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Set and display access control permissions between a host and a storage system

Specify the access control permissions a host has on a storage system.

You can set the following access levels for a host on a storage system:

◆ NONE − No access.

◆ SNAP CREATE − Create snapshots.

◆ SNAP USE − Delete and rename snapshots.

◆ SNAP ALL − Create, restore, delete, and rename snapshots.

◆ STORAGE CREATE DELETE − Create, resize, and delete storage.

◆ STORAGE USE − Connect and disconnect storage.

◆ STORAGE ALL − Create, delete, connect, and disconnect storage.

◆ ALL ACCESS − All operations.

Edit the permissions file (sd<hostname>.prbac) on the storage system associated with that host.

See the sections Setting up access control and View the current access control settings (Chapter 4, Installation and Administration Guide).

Display information about the access control permissions a host has to a storage system.

snapdrive config access show filer_name

See the section View the current access control settings (Chapter 4, Installation and Administration Guide).

Description Command or Action More information

8 Other configuration commands

Page 15: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Chapter 2: Quickly Learning About Snapshots and Storage

2

Quickly Learning About Snapshots and Storage

About this chapter This chapter provides high-level steps that describe creating and using snapshots. It also contains a section that lets you use a sample script to work with snapshots and storage. Experienced users can refer to the steps in these sections to start working with snapshots.

This chapter includes the following topics:

◆ “Getting started with snapshots” on page 10

◆ “Sample script for working with snapshots and storage” on page 18

◆ “More commands for working with storage” on page 26

9

Page 16: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Getting started with snapshots

Using SnapDrive for UNIX to take snapshots

You can quickly start using SnapDrive for UNIX to take snapshots. The steps in this section provide the basic information needed to work with snapshots. They tell you how to set up a sample snapshot and work with it.

NoteThese steps focus on the Snapdrive for UNIX snapshot commands; they do not use the storage commands. For information on using both snapshot and storage commands, see “Sample script for working with snapshots and storage” on page 18.

These steps and their examples show how you can easily perform the following tasks:

◆ Create a snapshot.

◆ Display information about the snapshot.

◆ Rename a snapshot.

◆ Restore a disk group or file system from a snapshot.

◆ Connect a snapshot to a different location on the host.

◆ Disconnect a snapshot from a location on the host.

◆ Delete a snapshot.

In addition to telling you how to set up a sample snapshot and work with it, each step also includes the following:

◆ Examples of additional SnapDrive for UNIX command lines so you can see other ways to use the command.

◆ Pointers to where you can find more information about the commands.

These steps assume you have experience setting up and running applications on your host operating system. If the steps or the sample command lines are not clear to you, look in the documentation listed in the “More information” column of the table.

10 Getting started with snapshots

Page 17: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

NoteTo make the exercises in these steps easier to follow, they do not use all the options available for each SnapDrive for UNIX command. For a complete list of these commands, their options, and detailed explanations of how they work, see the SnapDrive for UNIX Installation and Administration Guide. Most of the information in this section comes from Chapter 5: Creating and Using Snapshots and Chapter 9: Checklists for Using SnapDrive Commands.

Performing these exercises

The following steps explain how to execute the commands. These steps assume you have a volume group named vg1 and a storage system named toaster. When performing this exercise, NetApp recommends you do it on a test system to ensure that you do not accidentally create a problem for a production system. If you have a test system set up that uses different names for these entities, substitute your names for the ones in the following steps.

Chapter 2: Quickly Learning About Snapshots and Storage 11

Page 18: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Step Action More information

Create a snapshot

1 Create a snapshot of a volume group called vg1 using the snapdrive snap create command. Name the snapshot snap1.

# snapdrive snap create -vg vg1 -snapname snap1

Examples of additional command lines: The following command lines use the snapdrive snap create command with disk groups dg1 and dg2, which have host volumes myvol1 and myvol2. The host volume dg1/myvol2 has a file system mounted on /myfs/fs2. Each command line creates a snapshot called toaster:/vol/vol1:snap1.

# snapdrive snap create -fs /myfs/fs2 -snapname snap1

# snapdrive snap create -dg dg1 dg2 -snapname snap1

# snapdrive snap create -hostvol dg1/myvol1 -snapname snap1 -force

# snapdrive snap create -hostvol dg1/myvol2 -fs /fs2 -snapname snap1

NoteSome commands work only with snapshots created by SnapDrive for UNIX. For example, SnapDrive for UNIX can only restore snapshots it created.

You can also create snapshots of volume groups that span multiple storage system volumes or multiple storage systems. This feature is limited on Linux hosts because there is not a freeze operation in the software stack.

On HP-UX, Solaris, and Linux hosts, if applications are using host volumes as raw storage, you must perform the steps necessary to quiesce the application before taking the snapshot.

See the section Creating snapshots (Chapter 5, Installation and Administration Guide).

12 Getting started with snapshots

Page 19: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Display information about the snapshot

2 Display information about the snapshot you just created using the snapdrive snap show command.

# snapdrive snap show -snapname toaster:/vol/vol1:snap1

NoteYou can use either snapdrive snap show or snapdrive snap list in the command line. These commands are synonyms.

Examples of additional command lines: These are valid snapdrive snap show command lines. If you are not sure of a snapshot name, you can include a wildcard character (*) as long as it is at the end of a command line.

# snapdrive snap show -snapname toaster:/vol/vol2:snapA snapX snapY

# snapdrive snap show -verbose -snapname toaster:/vol/vol2:snapA /vol/vol3:snapB snapC

# snapdrive snap show -snapname toaster:/vol/vol2:snapA

# snapdrive snap show toaster:/vol/vol2:snapA

# snapdrive snap show toaster:/vol/vol0:*

# snapdrive snap show -verbose -hostvol hplvol23

# snapdrive snap show -quiet -snapname toaster:/vol/vol2:snapA

# snapdrive snap show -quiet toaster:/vol/vol2:snapA toaster:/vol/vol0:snap23

# snapdrive snap show -verbose -snapname toaster:/vol/vol2:snapA

# snapdrive snap show -verbose -dg dg21

# snapdrive snap show -verbose toaster:/vol/vol2:snapA /vol/vol3:snapB snapC

See the section Displaying information about snapshots (Chapter 5, Installation and Administration Guide).

Step Action More information

Chapter 2: Quickly Learning About Snapshots and Storage 13

Page 20: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Rename a snapshot

3 Rename the snapshot snap1 to bkup40105 using the snapdrive snap rename command.

# snapdrive snap rename -snapname toaster:/vol/vol1:snap1 bkup40105

Examples of additional command lines: This command line includes the -force option because a snapshot named newsnapshot currently exists.

# snapdrive snap rename -force toaster:/vol/vol1:oldsnap newsnapshot

This command line uses the long form for the snapshot names. Both resolve to the same storage system volume.

# snapdrive snap rename toaster:/vol/vol1:FridaySnap toaster:/vol/vol1:Snap040130

See the section Renaming a snapshot (Chapter 5, Installation and Administration Guide).

Restore a snapshot

4 Restore the snapshot using the snapdrive snap restore command.

# snapdrive snap restore -dg vg1-snapname toaster:/vol/vol1:bkup40105

Make sure you are not in the directory you want to restore when you issue this command.

CautionThis operation replaces the current contents of the LUNs that make up the host disk groups with the contents of the LUNs in the specified snapshot. It can take several minutes. Do not press Ctrl-C during this procedure. If you try to halt the procedure, you risk leaving the disk groups in an incomplete state.

See the section Restoring a snapshot (Chapter 5, Installation and Administration Guide)

Step Action More information

14 Getting started with snapshots

Page 21: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Examples of additional command lines: These are examples of snapdrive snap restore command lines:

# snapdrive snap restore -fs /mnt/dir -snapname toaster:/vol/vol1:NewSnap33

# snapdrive snap restore -dg dg1 dg2 -snapname toaster:/vol/vol1:Tuesday

The next set of command lines use a host that has a disk group dg1 with the host volumes myvol1 and myvol2. The volume dg1/myvol2 has a file system mounted on /fs2. The disk group dg1 has three LUNs in it: toaster:/vol/vol1/lun0, toaster:/vol/vol1/lun1, and toaster:/vol/vol1/lun2. The following commands all restore the same data:

# snapdrive snap restore -dg dg1 -snapname toaster:/vol/vol1:snap1

# snapdrive snap restore -vg dg1 -snapname toaster:/vol/vol1:snap1

# snapdrive snap restore -hostvol dg1/myvol2 dg1/myvol1 -snapname toaster:/vol/vol1:snap1

# snapdrive snap restore -hostvol dg1/myvol2 -fs /fs2 -snapname toaster:/vol/vol1:snap1

Step Action More information

Chapter 2: Quickly Learning About Snapshots and Storage 15

Page 22: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Connect a snapshot to a different location

5 Connect a snapshot to new location on a host where you took the snapshot.

# snapdrive snap connect -fs /db2/datafiles2 /db2_bkup40105 -snapname toaster:/vol/vol1:bkup40105

Examples of additional command lines: You can use this command to connect the snapshot to a new location on the same host or a different host. The following are sample snapdrive snap connect command lines.

# snapdrive snap connect -hostvol srcdg/myvol destdg/myvol -snapname toaster:/vol/vol1:snap1

# snapdrive snap connect -vg vg2 -snapname toaster:/vol/vol1:snap1

# snapdrive snap connect -fs /db2/datafiles2 /db2_snap1 -snapname toaster:/vol/vol1:snap1

#snapdrive snap connect -fs /db2/datafiles2 -snapname toaster:/vol/vol1:snap1 -autoexpand -autorename

NoteWhen you identify a disk group to be connected by specifying a logical volume or file system, you must specify all the logical volumes contained in that disk group in order to connect the entire disk group. The -autoexpand option simplifies this process by letting you name only a subset of the logical volumes or file systems in the disk group. The option then expands the connection to the rest of the logical volumes or file systems in the disk group. The -autorename option tells SnapDrive for UNIX to rename the destination entities as needed to avoid naming conflicts.

See the section Connecting snapshots to a new location (Chapter 5, Installation and Administration Guide).

Step Action More information

16 Getting started with snapshots

Page 23: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Disconnect a snapshot from a location on a host

6 Remove the mappings between the host and the LUNs in the snapshot bckup40105 by using the snapdrive snap disconnect command.

snapdrive snap disconnect -fs /db2_bkup40105

NoteSnapDrive for UNIX does not modify the snapshot during a disconnect except to delete the temporary LUNs that were created during the snapdrive snap connect operation.

Examples of additional command lines: The following are sample snapdrive snap disconnect command lines.

# snapdrive snap disconnect -hostvol dg5/myvolume

# snapdrive snap disconnect -vg vg1 vg10

# snapdrive snap disconnect -dg dg1 dg2 dg3

See the section Disconnecting a snapshot (Chapter 5, Installation and Administration Guide).

Delete a snapshot

7 Delete the snapshot bkup40105 using the snapdrive snap delete command.

# snapdrive snap delete toaster:/vol/vol1:bkup40105

Examples of additional command lines: The snapdrive snap delete command displays a list of what it is deleting. The following is an example of the type of output it provides.

# snapdrive snap delete -v toaster:/vol/vol0:snap1 snap2 snap3snapdrive: deleting

toaster:/vol/vol0:snap1 toaster:/vol/vol0:snap2 toaster:/vol/vol0:snap3

See the section Deleting snapshots (Chapter 5, Installation and Administration Guide).

Step Action More information

Chapter 2: Quickly Learning About Snapshots and Storage 17

Page 24: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Sample script for working with snapshots and storage

Examples of using snapshots and storage

The sample script in this section has you perform simplified versions of many tasks you might want to perform in a production environment. By going through these examples, you can see how quickly you can start using SnapDrive for UNIX to manage snapshots and storage on your system.

NoteYou can execute the commands in the following steps. When performing an exercise such as this, NetApp recommends you do it on a test system to ensure that you do not accidentally create a problem for a production system.

The steps that follow show you how to

◆ Create a volume group and file system to be used as storage.

◆ Display information about the storage.

◆ Increase the size of the storage.

◆ Take a snapshot of the volume group.

◆ Destroy the data in the volume group and then restore it using a snapshot.

◆ Disconnect the LUNs from the host.

◆ Reconnect the snapshot to the host.

Each step also includes the following:

◆ Examples of additional SnapDrive for UNIX command lines so you can see other ways to use the command.

◆ Pointers to where you can find more information about the commands.

These steps assume you have experience setting up and running applications on your host operating system. If the steps or the sample command lines are not clear to you, look in documentation referred to by the pointers.

NoteTo make the exercises in these steps easier to follow, they do not use all the options available for each SnapDrive for UNIX command. For a complete list of the SnapDrive for UNIX commands, their options, and detailed explanations of how they work, see the SnapDrive for UNIX Installation and Administration Guide. Most of the information in this section comes from Chapter 5: Creating and Using Snapshots, Chapter 6: Provisioning and Managing Storage, and Chapter 9: Checklists for Using SnapDrive Commands.

18 Sample script for working with snapshots and storage

Page 25: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Step Action More information

Setting up a file system on a host entity

1 Create a volume group vg1 with three LUNs (lunA, lunB, and lunC) on a storage system toaster and a file system /db1/datafiles1. Assign each LUN a size of 100MB.

Enter the following snapdrive storage create command:

# snapdrive storage create -vg vg1-lun toaster:/vol/vol1/lunA lunB lunC -lunsize 100m -fs /db1/datafiles1

Now create a standalone LUN called lunD:

# snapdrive storage create -lun toaster:/vol/vol1/lunD -lunsize 100m

Examples of additional command lines: The following are snapdrive storage create command lines. These command lines illustrate how you can specify different information when you’re creating storage.

This command line provides the minimal information required for setting up a file system. It creates a file system in a 100mb disk group by specifying only the file system mount point, the disk group size, and the storage system volume. Snapdrive for UNIX supplies the default values for the other parameters, including the volume group name, number of LUNs, LUN size, and file system type.

# snapdrive storage create -fs /mnt/myfs -dgsize 100m -filervol toaster:/vol/vol1

This command line specifies a Solaris file system type.

# snapdrive storage create -fs /mnt/acctfs -fstype vxfs -filervol toaster:/vol/acct -dgsize 1g

This command line specifies an AIX file system type.

# snapdrive storage create -fs /mnt/acctfs -fstype jfs2 -lun toaster:/vol/vol1/lunA lunB lunC -lunsize 1g

See the section Creating storage (Chapter 6, Installation and Administration Guide).

Chapter 2: Quickly Learning About Snapshots and Storage 19

Page 26: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Display information about the storage

2 Confirm that SnapDrive for UNIX created all the necessary parameters by executing the snapdrive storage show command.

# snapdrive storage show -vg vg1

NoteYou can use either snapdrive storage show or snapdrive storage list in the command line. These commands are synonyms.

Examples of additional command lines: The following is a list of sample command lines that you could use with the storage show command.

# snapdrive storage show -filer toaster1 toaster2 -verbose

# snapdrive storage list -dg dg1 dg2

# snapdrive storage show -fs /mnt/myfs /mnt/myfs2

# snapdrive storage show -hostvol dg2/vol1 dg4/myvol3

# snapdrive storage list -dg dg2 -fs /mnt/myfs

See the section Displaying information about storage (Chapter 6, Installation and Administration Guide).

Step Action More information

20 Sample script for working with snapshots and storage

Page 27: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Increase the size of the storage

3 Use the snapdrive storage resize command with the -growby option to expand the size of the storage by adding 155MB. The -growby option combined with the -addlun option tells SnapDrive for UNIX to increase the size of the volume group by adding a LUN that is 155MB to the volume group.

# snapdrive storage resize -vg vg1 -addlun -growby 155m

Examples of additional command lines: This command line includes the -growto option with the -addlun option to tell SnapDrive for UNIX to increase the size of the storage until it reaches a total of 155MB. SnapDrive for UNIX adds a LUN to the volume group and bases its size on the difference between the current size of the storage and 155MB.

NoteCurrently you must include the -addlun option on the command line for all host platforms. SnapDrive for UNIX requires that you always add a LUN when you resize storage.

# snapdrive storage resize -vg myvg -addlun -growby 100m

The next command line is for a Solaris host and uses the -growto option to tell SnapDrive for UNIX to increase the size of the storage until it reaches 200MB. SnapDrive for UNIX performs the necessary calculations to determine how much the storage needs to grow by before it reaches 200MB. It adds the new storage to the last LUN in the volume group.

# snapdrive storage resize -dg my_dg -growto 200m

Tip: Keep in mind when you use this command that the total size of the volume or disk group cannot exceed the operating system limits.

See the section Increasing the size of the storage (Chapter 6, Installation and Administration Guide).

Step Action More information

Chapter 2: Quickly Learning About Snapshots and Storage 21

Page 28: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Take a snapshot

4 Add three files. Make each file 1MB and name the files file1, file2, and file3.

# cd /db1/datafiles1

# mkfile 1m file1 file2 file3

# cd ..

NoteOnce you’ve created the files, leave that directory. You do not want it to be your current directory. Certain SnapDrive for UNIX commands, such as the restore command, do not work if you are in the directory you want to restore.

5 Create a snapshot called snap1 using the snapdrive snap create command.

# snapdrive snap create -vg vg1 -snapname snap1

Examples of additional command lines: The following snapdrive snap create command lines assume you have disk groups dg1 and dg2 with host volumes myvol1 and myvol2. The host volume dg1/myvol2 has a file system mounted on /myfs/fs2. The disk groups have three LUNs: toaster:/vol/vol1/lun0, toaster:/vol/vol1/lun1, and toaster: /vol/vol1/lun2. These command lines all create a snapshot called toaster:/vol/vol1:snap1.

# snapdrive snap create -fs /myfs/fs2 -snapname snap1

# snapdrive snap create -dg dg1 dg2 -snapname snap1

# snapdrive snap create -vg dg1 -snapname snap1

# snapdrive snap create -hostvol dg1/myvol1 -snapname snap1 -force

# snapdrive snap create -hostvol dg1/myvol2 -fs /fs2 -snapname snap1

See the section Creating snapshots (Chapter 5, Installation and Administration Guide).

Step Action More information

22 Sample script for working with snapshots and storage

Page 29: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Restore the snapshot

6 Remove the files you created in step 4.

# rm -rf /db1/datafiles1/*

7 Restore a snapshot using the snapdrive snap restore command.

Make sure you are not in the directory where you want to restore the files, or you will receive an error message.

# snapdrive snap restore -vg vg1 -snapname snap1

CautionThis procedure might take several minutes. Do not press Ctrl-C during this procedure. If you attempt to halt the procedure, you risk leaving the disk groups in an incomplete state.

Examples of additional command lines: The following command lines assume you have a snapshot that includes data from vg1 and vg2. The first command line performs a partial restore. It restores the snapshot data from vg2 only. The second one restores data for both vg2 and vg1.

# snapdrive snap restore -vg vg2 -snapname snap1

# snapdrive snap restore -vg vg1 vg2 -snapname snap1

See the section Restoring a snapshot (Chapter 5, Installation and Administration Guide).

Step Action More information

Chapter 2: Quickly Learning About Snapshots and Storage 23

Page 30: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Disconnect the LUN mappings from the host

8 Disconnect lunD from the host where you created it using the snapdrive storage disconnect command.

# snapdrive storage disconnect -lun toaster:/vol/vol1/lunD

NoteIf you want to disconnect a host-side entity that contains other entities, you must include the -full option on the command line.

Examples of additional command lines: These are sample storage disconnect command lines.

# snapdrive storage disconnect -lun toaster:/vol/vol1/lunA muffin:/vol/vol1/lunB

# snapdrive storage disconnect -dg dg1 dg2 dg3 -full

# snapdrive storage disconnect -hostvol dg1/mylvol1

See the section Disconnecting LUNs associated with host entities (Chapter 6, Installation and Administration Guide).

Connect an existing LUN to the host

9 Reconnect lunD to the host by using the snapdrive storage connect command.

# snapdrive storage connect -lun toaster:/vol/vol1/lunD

NoteYou can use this command to connect LUNs that were not created by SnapDrive for UNIX as well as LUNs created with it. This command only supports connecting LUNs; it does not connect other LVM entities.

Examples of additional command lines: The following are examples of snapdrive storage connect command lines:

# snapdrive storage connect -lun filer1:/vol/vol1/ntap_lun2

# snapdrive storage connect -lun filer1:/vol/vol1/ntap_lun2 ntap_lun3 ntap_lun4

See the section Connecting existing LUNs to the host (Chapter 6, Installation and Administration Guide).

Step Action More information

24 Sample script for working with snapshots and storage

Page 31: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

Delete storage from the host

10 Delete the volume group, LUNs, and file system using the snapdrive storage delete command. Because you’re deleting the file system, you do not need to specify the volume group and LUN names. (Do not unmount the file system before you delete the storage, or SnapDrive for UNIX won’t be able to find it.)

# snapdrive storage delete -fs /db1/datafiles1

NoteIf you want to delete a host-side entity that contains other entities, you must include the -full option on the command line.

Examples of additional command lines: The following are examples of the snapdrive storage delete command lines.

# snapdrive storage delete -lun toaster:/vol/vol1/lunC

# snapdrive storage delete -vg vg1

# snapdrive storage delete -dg dg1 dg2 dg3

# snapdrive storage delete -hostvol mydg/vol3 mydg/vol5

# snapdrive storage delete -dg dg1 dg2 dg3 -full

See the section Deleting storage from the host (Chapter 6, Installation and Administration Guide).

Step Action More information

Chapter 2: Quickly Learning About Snapshots and Storage 25

Page 32: SnapDrive™ for UNIX® - ITOTS NETWORKS group and volume group. Some of the platforms that SnapDrive for UNIX supports use the term disk group while others use the term volume group

More commands for working with storage

Other storage tasks available with SnapDrive for UNIX

The following table contains a quick summary of additional storage commands that you might find useful as you execute SnapDrive for UNIX.

Description Command More information

Connect and disconnect storage from the host without affecting the state on the storage system

Perform only the host portion of the storage connection operation.

This command only supports connecting LUNs; it does not connect other LVM entities

snapdrive host connect See the section Connecting only the host-side of storage (Chapter 6, Installation and Administration Guide).

Perform only the host portion of the storage disconnect operation.

snapdrive host disconnect See the section Disconnecting only the host-side of storage (Chapter 6, Installation and Administration Guide).

Prepare the host to add LUNs

Tell the host how many LUNs you want to create on a storage system that is currently mapped to the host. (You only need to use this command on hosts such as Solaris and Linux that require preparation before you create LUNs.)

snapdrive config prepare

luns -count count See the section Preparing hosts for adding LUNs (Chapter 3, Installation and Administration Guide).

Determine how many LUNs could be created on the host without exceeding a host-local limit. (You only need to use this command on hosts such as Solaris and Linux that require preparation before you create LUNs.)

snapdrive config check luns

See the section Preparing hosts for adding LUNs (Chapter 3, Installation and Administration Guide).

26 More commands for working with storage