Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Planning a Workgroup
Planning to Manage File Systems
Chapter 298
• The device containing a snapshot only holds blocks that have
changed on the primary file system since the snapshot was created.
• The remaining blocks, which have not changed, can be found on the
device containing the primary file system. Thus, there is no need for
a copy.
All this is done transparently within the kernel.
How does one work with snapshots?
A JFS snapshot can be used to perform an online backup of a file-system.
For procedure, go to “How to Create and Back Up a JFS Snapshot File
System” on page 694.
The snapshot file system must reside either on a separate disk or
separate logical volume from the original file system. Any data on the
device prior to taking the snapshot will be overwritten when the
snapshot is taken.
Commands and applications need not be changed to work with
snapshots, since the kernel is responsible for locating snapshot data
(either on the snapshot device or the primary device), and for copying
individual blocks from the primary file system to the snapshot device
immediately before they are updated. Because of this copy-on-write
scheme, a snapshot can be created instantaneously and requires only
enough space to hold the blocks that might change while the snapshot is
mounted.
The snapshot volume should be about 10-20% the size of the original file
system. The snapshot volume need not be structured in any way; it is not
necessary to execute newfs for a snapshot file system prior to mounting
it.
While a snapshot is mounted, changes to the original file system will not
be reflected in the snapshot. The snapshot is a “frozen” image of the
original file system.
Once a snapshot is unmounted, its contents are lost.
What limitations do snapshots pose?
It is possible to run out of space on a snapshot device. This might happen
because the device is too small, because the primary file system is too
volatile, or because the snapshot remains mounted for too long. When a
snapshot device becomes full, the kernel has nowhere to copy blocks from
the primary file system. In this situation, the kernel cannot maintain a
stable view of the file system, so it makes the snapshot inaccessible.