Network Appliance(TM)

Manual Pages


Table of Contents

NAME

snap - manage snapshots

SYNOPSIS

snap list

snap create | delete name

snap rename from to

snap sched [ weeks [ days [ hours[@list] ] ] ]

snap reserve [ percent ]

DESCRIPTION

snap provides commands to create and manage snapshots. A snapshot is a read-only copy of the entire file system as of the time the snapshot was created. The filer uses a copyon-write technique to create snapshots very quickly without consuming any disk space. Only as blocks in the active file system are modified and written to new locations on disk does the snapshot begin to consume extra space.

Snapshots are exported to all NFS clients and can be accessed via .snapshot sub-directories which are accessible from each directory in the file system. These .snapshot sub-directories are special in that they can be accessed from every directory, but they only show up in directory listings at mount points.

The list command displays a single line of information for each snapshot. Along with the snapshot's name, it shows when the snapshot was created and the size of the snapshot. The filer can have up to 20 different snapshots online at one time. Because of the copy-on-write technique used to update disk blocks, deleting a snapshot will generally not free as much space as its size would seem to indicate. Blocks in the snapshot may be referenced by other snapshots, or by the active file system, and thus be unavailable for reuse even after the snapshot is deleted.

The create command creates a snapshot with the specified name. The delete command deletes an existing snapshot with the specified name. The rename command allows an existing snapshot to be given a new name.

Automatic snapshots can be scheduled to occur weekly, daily, or hourly. Weekly snapshots are named weekly.N, where N is "0" for the most recent snapshot, "1" for the next most recent, and so on. Daily snapshots are named daily.N and hourly snapshots hourly.N. Whenever a new snapshot of a particular type is created and the number of existing snapshots of that type exceeds the limit specified by the sched option described below, then the oldest snapshot is deleted and the existing ones are renamed. If, for example, we specified that a maximum of 8 hourly snapshots were to be saved using the sched command, then on the hour, hourly.7 would be deleted, hourly.0 would be renamed to hourly.1, and so on. The rename command can be used to move a snapshot out of the way so that it won't be deleted automatically.

The sched command sets the schedule for automatic snapshot creation. The first argument indicates how many weekly snapshots should be kept on-line, the second how many daily, and the third how many hourly. If an argument is left off, or set to zero, then no snapshot of the corresponding type is created. Daily snapshots are created at midnight, and weekly snapshots are created at midnight on Sunday. Only one snapshot is created at a time. If a weekly snapshot is being created, for instance, no daily or hourly snapshot will be created even if one would otherwise be scheduled.

For example, the command

snap sched 2 6

indicates that two weekly snapshots and six daily snapshots should be kept on line. No hourly snapshots will be created. For snapshots created on the hour, an optional list of times can be included indicating the hours on which snapshots should occur. For example the command

snap sched 2 6 8@8,12,16,20

indicates that in addition to the weekly and daily snapshots, eight hourly snapshots should be kept on line, and that they should be created at 8 am, 12 am, 4 pm, and 8 pm. Hours must be specified in 24-hour notation.

With no arguments sched prints the current snapshot schedule.

With no arguments, the reserve command prints the percentage of disk space that is reserved for snapshots. This reserve space can be used only by snapshots and not by the active file system. The size of the snapshot reserve can be set by using the percent argument.

SEE ALSO

na_df(1), na_rc(5)

BUGS

There is no way to tell how much space will be freed by deleting a particular snapshot or group of snapshots.

The snap create, snap delete, and snap delete commands can take 20 or 30 seconds on very large file systems.


Table of Contents