The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Поиск:  Каталог документации / Документация по FreeBSD / Руководства по FreeBSD на английском

12.11 File System Snapshots

Contributed by Tom Rhodes.

FreeBSD 5.0 offers a new feature in conjunction with Soft Updates: File system snapshots.

Snapshots allow a user to create an image of specified file systems and treat this image as a file. 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 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 chflags(1) manual page) is set on to ensure that not even root can write to the snapshot. The 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.

Snapshots are created with the mount(8) command. To place a snapshot of /var in the file /var/snapshot/snap use the following command:

    # mount -u -o snapshot /var/snapshot/snap /var

Once a snapshot has been created, there are several interesting things that an administrator can do with them:

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:

    # umount /mnt
    # mdconfig -d -u 4

For more information about softupdates and file system snapshots, including technical papers, you can visit Marshall Kirk McKusick's website at http://www.mckusick.com

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру