xref: /netbsd-src/share/man/man4/fss.4 (revision 2980e352a13e8f0b545a366830c411e7a542ada8)
1.\"	$NetBSD: fss.4,v 1.10 2008/04/30 13:10:54 martin Exp $	*/
2.\"
3.\"
4.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
5.\" All rights reserved.
6.\"
7.\" This code is derived from software contributed to The NetBSD Foundation
8.\" by Juergen Hannken-Illjes.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29.\" POSSIBILITY OF SUCH DAMAGE.
30.\"
31.Dd April 17, 2005
32.Dt FSS 4
33.Os
34.Sh NAME
35.Nm fss ,
36.Nm fssbs
37.Nd file system snapshot device
38.Sh SYNOPSIS
39.Cd "pseudo-device fss 4"
40.Sh DESCRIPTION
41The
42.Nm
43driver provides a read-only interface to the snapshot of a currently
44mounted file system.
45Reading from a
46.Nm
47device gives the view of the file system when the snapshot was taken.
48It can be configured via
49.Xr ioctl 2 .
50.Sh IOCTLS
51The
52.Xr ioctl 2
53command codes below are defined in
54.Aq Pa sys/dev/fssvar.h .
55.Pp
56The (third) argument to
57.Xr ioctl 2
58should be a pointer to the type indicated.
59.Bl -tag -width 8n
60.It Dv FSSIOCSET(struct fss_set)
61Configures a
62.Nm
63device.
64.Bd -literal -offset indent
65struct fss_set {
66	char *fss_mount;
67	char *fss_bstore;
68	blksize_t fss_csize;
69};
70.Ed
71.Pp
72The struct element
73.Va fss_mount
74is the mount point of the file system.
75The struct element
76.Va fss_bstore
77is either a regular file or a raw disk device where data overwritten on
78the file system will be saved.
79The struct element
80.Va fss_csize
81is the preferred size of this data.
82.It Dv FSSIOCGET(struct fss_get)
83Gets the status of a
84.Nm
85device.
86.Bd -literal -offset indent
87struct fss_get {
88	char fsg_mount[MNAMELEN];
89	struct timeval fsg_time;
90	blksize_t fsg_csize;
91	blkcnt_t fsg_mount_size;
92	blkcnt_t fsg_bs_size;
93};
94.Ed
95The struct element
96.Va fsg_mount
97is the mount point of the file system.
98The struct element
99.Va fsg_time
100is the time this snapshot was taken.
101The struct element
102.Va fsg_csize
103is the current size of data clusters.
104The struct element
105.Va fsg_mount_size
106is the number of clusters of the file system.
107The struct element
108.Va fsg_bs_size
109is the number of clusters written to the backing store.
110.It Dv FSSIOCCLR
111Unconfigures a
112.Nm
113device.
114.It Dv FSSIOFSET(int)
115Sets the flags of a
116.Nm
117device.
118Possible flags are:
119.Bl -tag -width Dv
120.It Dv FSS_UNCONFIG_ON_CLOSE
121Unconfigure the
122.Nm
123device on the last close.
124.El
125.It Dv FSSIOFGET(int)
126Gets the flags of a
127.Nm
128device.
129.El
130.Sh KERNEL THREADS
131For each active snapshot device there is a kernel thread
132that handles the backing store.
133This thread is named
134.Va fssbsN
135where
136.Va N
137is the device minor number.
138.Sh FILES
139.Bl -tag -width /dev/rfss? -compact
140.It Pa /dev/rfss?
141.It Pa /dev/fss?
142.El
143.Sh SEE ALSO
144.Xr fssconfig 8 ,
145.Xr mount 8 ,
146.Xr umount 8
147.Sh HISTORY
148The
149.Nm
150device appeared in
151.Nx 2.0 .
152.Sh BUGS
153This driver is
154.Em experimental .
155Be sure you have a backup before you use it.
156