System Administration Commands fssnapufs(1M)
NAME
fssnapufs - create a temporary snapshot of a UFS file sys-
tem
SYNOPSIS
fssnap [-F ufs] [-V] -o backing-store=path,
[specific-options] /mount/point
fssnap -d [-F ufs] [-V] /mount/point dev
fssnap -i [-F ufs] [-V] [-o specific-options] /mount/point dev
DESCRIPTION
The fssnap command queries, creates, or deletes a temporary
snapshot of a UFS file system. A snapshot is a point-in-time
image of a file system that provides a stable and unchanging
device interface for backups.
When creating a file system snapshot, you must specify the
file system to be captured and the backing-store file. The
backing-store file(s) are where the snapshot subsystem saves
old file system data before it is overwritten. Beyond the
first backing-store file, fssnap automatically creates addi-
tional backing-store files on an as-needed basis.
The number and size of the backing store files varies with
the amount of activity in the file system. The destination
path must have enough free space to hold the backing-store
file(s). This location must be different from the file sys-
tem that is being captured in a snapshot. The backing-store
file(s) can reside on any type of file system, including
another UFS file system or an NFS-mounted file system.
OPTIONS
The following options are supported:
-d
Deletes the snapshot associated with the given file sys-
tem.
-i
Displays the state of one or all UFS snapshots. If a
mount-point or device is not specified, a list of all
snapshots on the system is displayed. When a mount-point
SunOS 5.11 Last change: 29 Jan 2007 1
System Administration Commands fssnapufs(1M)
or device is specified, detailed information is provided
for the specified file system snapshot by default.
Use the -o options with the -i option to specify what
snapshot information is displayed. Since this feature is
provided primarily for use in scripts and on the command
line, no labels are displayed for the data. Sizes are
all in bytes, and the output is not internationalized or
localized. The information is displayed on one line per
option. Unrecognized options display a single ? on the
line. One line per option guarantees that there are the
same number of lines as options specified and there is a
one-to-one correspondence between an output line and an
option.
The following -o options display specific information
for a given snapshot. See the EXAMPLES section for exam-
ples of how to use these options.
snapnumber
Display the snapshot number.
blockdevname
Display the block device path.
rawdevname
Display the raw device path.
mountpoint
Display the mount point of the master file system.
state
Display the state of the snapshot device.
backing-store
Display the location of the first backing-store file
for this snapshot. If there are multiple backing-
store files, subsequent files have the same name as
the first file, with the suffixes .2, .3, and so
forth.
SunOS 5.11 Last change: 29 Jan 2007 2
System Administration Commands fssnapufs(1M)
backing-store-len
Display the sum of the sizes of the backing-store
files.
maxsize
Display the maxsize value specified for the
backing-store file(s).
createtime
Display the time that the snapshot was created.
chunksize
Display the copy-on-write granularity.
-o specific-options
Without -d or -i, the default action is to create a
snapshot. Specify the following options when creating a
snapshot. All of these options are discretionary, except
for the backing-store file, which is required.
backing-store=path
Uses path in the creation of the backing-store
file(s). path must not reside on the file system
that is being captured in a snapshot and must not be
the name of an existing file. If path is a direc-
tory, then a backing-store file is created within it
using a name that is generated automatically. If
path is not a directory and does not already exist,
then a backing-store file with that name is created.
If more than one backing-store file is required,
fssnap creates subsequent files automatically. The
second and subsequent files have the same name as
the first file, with suffixes of .2, .3, and so
forth.
This option can be abbreviated as bf=path or
bs=path.
unlink
SunOS 5.11 Last change: 29 Jan 2007 3
System Administration Commands fssnapufs(1M)
Unlinks the backing-store file after the snapshot is
created. This option specifies that the backing-
store file does not need to be removed manually when
the snapshot is deleted. This might make administra-
tion more difficult since the file is not visible in
the file system. If this option is not specified,
the backing-store files should be removed manually
after the snapshot is deleted.
chunksize=n [k,m,g]
Uses n for the chunk size. Chunk size is the granu-
larity of the data that is sent to the backing
store.
Specify chunksize in the following units: k for
kilobytes, m for megabytes, or g for gigabytes. By
default, chunk size is four times the block size of
the file system (typically 32k).
maxsize=n[k,m,g]
Does not allow the sum of the sizes of the backing-
store file(s) to exceed n, where n is the unit
specified. The snapshot is deleted automatically
when the sum of the sizes of the backing-store
file(s) exceeds maxsize.
Specify maxsize in the following units: k for kilo-
bytes, m for megabytes, or g for gigabytes.
raw
Displays to standard output the name of the raw dev-
ice instead of the block device when a snapshot is
created. The block device is printed by default
(when raw is not specified). This option makes it
easier to embed fssnap commands in the command line
for commands that require the raw device instead.
Both devices are always created. This option affects
only the output.
OPERANDS
The following operands are supported:
mount-point
SunOS 5.11 Last change: 29 Jan 2007 4
System Administration Commands fssnapufs(1M)
The directory where the file system resides.
special
The physical device for the file system, such as
/dev/dsk/c0t0d0s7.
EXAMPLES
Example 1 Creating a Snapshot of a File System
The following example creates a snapshot of a file system.
The block special device created for the snapshot is
/dev/fssnap/0.
# fssnap -F ufs -o backing-store=/var/tmp /export/home
/dev/fssnap/0
Example 2 Backing Up a File System Snapshot Without Having
To Unmount the File System
The following example backs up a file system snapshot
without having to unmount the file system. Since ufsdump
requires the path to a raw device, the raw option is used.
The /export/home file system snapshot is removed in the
second command.
# ufsdump 0uf /dev/rmt/0 `fssnap -F ufs
-o raw,bs=/export/snap /export/home`
|