xref: /freebsd/sbin/mksnap_ffs/mksnap_ffs.8 (revision aa1a1e7dc42f954832a63c340de61f771b27278e)
1d35ae777SKirk McKusick.\"
2d35ae777SKirk McKusick.\" Copyright (c) 2003 Networks Associates Technology, Inc.
3d35ae777SKirk McKusick.\" All rights reserved.
4d35ae777SKirk McKusick.\"
5d35ae777SKirk McKusick.\" This software was developed for the FreeBSD Project by Marshall
6d35ae777SKirk McKusick.\" Kirk McKusick and Network Associates Laboratories, the Security
7d35ae777SKirk McKusick.\" Research Division of Network Associates, Inc. under DARPA/SPAWAR
8d35ae777SKirk McKusick.\" contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS
9d35ae777SKirk McKusick.\" research program.
10d35ae777SKirk McKusick.\"
11d35ae777SKirk McKusick.\" Redistribution and use in source and binary forms, with or without
12d35ae777SKirk McKusick.\" modification, are permitted provided that the following conditions
13d35ae777SKirk McKusick.\" are met:
14d35ae777SKirk McKusick.\" 1. Redistributions of source code must retain the above copyright
15d35ae777SKirk McKusick.\"    notice, this list of conditions and the following disclaimer.
16d35ae777SKirk McKusick.\" 2. Redistributions in binary form must reproduce the above copyright
17d35ae777SKirk McKusick.\"    notice, this list of conditions and the following disclaimer in the
18d35ae777SKirk McKusick.\"    documentation and/or other materials provided with the distribution.
19d35ae777SKirk McKusick.\" 3. The names of the authors may not be used to endorse or promote
20d35ae777SKirk McKusick.\"    products derived from this software without specific prior written
21d35ae777SKirk McKusick.\"    permission.
22d35ae777SKirk McKusick.\"
23d35ae777SKirk McKusick.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24d35ae777SKirk McKusick.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25d35ae777SKirk McKusick.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26d35ae777SKirk McKusick.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27d35ae777SKirk McKusick.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28d35ae777SKirk McKusick.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29d35ae777SKirk McKusick.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30d35ae777SKirk McKusick.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31d35ae777SKirk McKusick.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32d35ae777SKirk McKusick.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33d35ae777SKirk McKusick.\" SUCH DAMAGE.
34d35ae777SKirk McKusick.\"
35*aa1a1e7dSMike Karels.Dd May 22, 2023
36d35ae777SKirk McKusick.Dt MKSNAP_FFS 8
37d35ae777SKirk McKusick.Os
38d35ae777SKirk McKusick.Sh NAME
39d35ae777SKirk McKusick.Nm mksnap_ffs
40d35ae777SKirk McKusick.Nd take a file system snapshot
41d35ae777SKirk McKusick.Sh SYNOPSIS
42d35ae777SKirk McKusick.Nm
43d35ae777SKirk McKusick.Ar snapshot_name
44d35ae777SKirk McKusick.Sh DESCRIPTION
45d35ae777SKirk McKusickThe
46d35ae777SKirk McKusick.Nm
47734ac3b5SRuslan Ermilovutility creates a snapshot named
48c8cf3f3dSPawel Jakub Dawidek.Ar snapshot_name .
497741a5c4SKirk McKusickThis name is a path in the file system to be snapshotted.
50528d8e55SKirk McKusickTypically this is under the
51528d8e55SKirk McKusick.Pa .snap
52528d8e55SKirk McKusickdirectory in the root of the file system, but it can
537741a5c4SKirk McKusickbe anywhere in the filesystem being snapshotted.
54528d8e55SKirk McKusickSnapshots can be listed using the
55528d8e55SKirk McKusick.Xr snapinfo 8
56528d8e55SKirk McKusickcommand.
57528d8e55SKirk McKusick.Pp
58528d8e55SKirk McKusickAfter a snapshot is taken it appears as a file.
59129ea078SKirk McKusickThe size of the snapshot file is equal to the size of the
60129ea078SKirk McKusickfile system from which it was taken.
61528d8e55SKirk McKusickIt can be moved, renamed or deleted (which removes the snapshot).
62d35ae777SKirk McKusick.Pp
63d35ae777SKirk McKusickThe group ownership of the file is set to
64734ac3b5SRuslan Ermilov.Dq Li operator ;
65d35ae777SKirk McKusickthe owner of the file remains
66734ac3b5SRuslan Ermilov.Dq Li root .
67d35ae777SKirk McKusickThe mode of the snapshot is set to be readable by the owner
68d35ae777SKirk McKusickor members of the
69734ac3b5SRuslan Ermilov.Dq Li operator
70d35ae777SKirk McKusickgroup.
71c8cf3f3dSPawel Jakub Dawidek.Sh EXAMPLES
72c8cf3f3dSPawel Jakub DawidekCreate a snapshot of
73*aa1a1e7dSMike Karels.Pa /home
74c8cf3f3dSPawel Jakub Dawidekfile system and mount the snapshot elsewhere:
75c8cf3f3dSPawel Jakub Dawidek.Bd -literal -offset indent
76*aa1a1e7dSMike Karelsmksnap_ffs /home/.snap/snap1
77*aa1a1e7dSMike Karelsmdconfig -a -t vnode -o readonly -f /home/.snap/snap1
78c8cf3f3dSPawel Jakub Dawidekmount -o ro /dev/md0 /mnt/
79c8cf3f3dSPawel Jakub Dawidek.Ed
80528d8e55SKirk McKusick.Pp
81528d8e55SKirk McKusickDelete a snapshot:
82528d8e55SKirk McKusick.Bd -literal -offset indent
83*aa1a1e7dSMike Karelsrm /home/.snap/snap1
84528d8e55SKirk McKusick.Ed
85d35ae777SKirk McKusick.Sh SEE ALSO
86528d8e55SKirk McKusick.Xr rm 1 ,
87d35ae777SKirk McKusick.Xr chmod 2 ,
88d35ae777SKirk McKusick.Xr chown 8 ,
89c8cf3f3dSPawel Jakub Dawidek.Xr mdconfig 8 ,
90528d8e55SKirk McKusick.Xr mount 8 ,
91528d8e55SKirk McKusick.Xr snapinfo 8
92d35ae777SKirk McKusick.Sh HISTORY
93734ac3b5SRuslan ErmilovThe
94d35ae777SKirk McKusick.Nm
95734ac3b5SRuslan Ermilovutility first appeared in
96b78bd5ecSSevan Janiyan.Fx 5.1 .
970afc94c1SUlrich Spörlein.Sh CAVEATS
980afc94c1SUlrich SpörleinThe disk full situation is not handled gracefully and may
990afc94c1SUlrich Spörleinlead to a system panic when no free blocks are found.
100c43728a2SGiorgos Keramidas.Pp
101c43728a2SGiorgos KeramidasEvery filesystem can have only up to 20 active snapshots.
102c43728a2SGiorgos KeramidasWhen this limit is reached, attempting to create more snapshots
103c43728a2SGiorgos Keramidasfails with
104c43728a2SGiorgos Keramidas.Er ENOSPC ,
105c43728a2SGiorgos Keramidasand
106c43728a2SGiorgos Keramidas.Nm
107c43728a2SGiorgos Keramidasreports that it is
108c43728a2SGiorgos Keramidas.Dq out of space .
109