From c915db4bc7259326df26d181ae995b02a31ca605 Mon Sep 17 00:00:00 2001 From: Tom Rhodes Date: Mon, 15 Jul 2002 20:37:51 +0000 Subject: [PATCH] Add some information about FFS snapshots to the handbook. PR: 36725 Requested by: murray --- .../books/handbook/disks/chapter.sgml | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/en_US.ISO8859-1/books/handbook/disks/chapter.sgml b/en_US.ISO8859-1/books/handbook/disks/chapter.sgml index a94671b487..332820f038 100644 --- a/en_US.ISO8859-1/books/handbook/disks/chapter.sgml +++ b/en_US.ISO8859-1/books/handbook/disks/chapter.sgml @@ -418,6 +418,103 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on + + + + + Tom + Rhodes + Contributed by + + + + + + File System Snapshots + + + File System Snapshots + Snapshots + + + FreeBSD 5.0 offers a new feature in conjunction with the + option. File system snapshots. + + Snapshots allow a user to create an image of specified file + systems and treat this image as a file. The -u (or update) flag + in &man.mount.8; is required with this option. + Snapshot files must be created in the file system that the + action is performed on, and a user may create no more than 20 + snapshots per file system. Active snapshots are recorded + in the superblock so they are persistent across unmount and + remount operations along with system reboots. When a snapshot + is no longer required, it can be removed with the standard &man.rm.1; + command, like regular files. Snapshots may be removed in any order, + however all the used space may not be acquired as another snapshot will + possibly claim some of the blocks that were released. + + During initial creation, the schg flag (see &man.chflags.1; manual page) + is set on to ensure that not even root can write to the snapshot. + The &man.unlink.1; command makes an exception for snapshot files, + however, in which it allows them to be removed even + though they have the schg flag set, so it is not necessary to + clear the schg flag before removing a snapshot file. + + Once a snapshot has been created, there are several interesting + things that an administrator can do with them: + + + + Some administrators will use a snapshot file for backup purposes, + where the snapshot can be transfered to a CD or tape. + + + + File integrity, &man.fsck.8; may be ran on the snapshot file. + Assuming that the file system was clean when it was mounted, you + should always get a clean (and unchanging) result from running + &man.fsck.8; on the snapshot. This is essentially what the + background &man.fsck.8; process does. + + + + Run the &man.dump.8; utility on the snapshot. + A dump will be returned that is as consistent with the + file system as the timestamp of the snapshot. + + As of this writing &man.dump.8; has not yet + been changed to set the dumpdates file correctly, so + do not use this feature in production until that fix + is made. + + + + &man.mount.8; the snapshot as a frozen image of the file system. + To &man.mount.8; the snapshot + /var/snapshot/snap: + +&prompt.root; mdconfig -a -t vnode -f /var/snapshot/snap -u 4 +&prompt.root; mount -r /dev/md4 /mnt + + + + + You can now walk the hierarchy of your frozen /var + file system mounted at /mnt. Everything will + be in the same state it was during the snapshot creation time. + The only exception being that any earlier snapshots will appear + as zero length files. When the use of a snapshot has delimited, + it can be unmounted with: + +&prompt.root; umount /mnt +&prompt.root; mdconfig -d -u 4 + + For more information about and + file system snapshots, including technical papers, you can visit + Marshall Kirk McKusick's website at + http://www.mckusick.com + + File System Quotas