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