1.\" $NetBSD: fss.4,v 1.6 2004/05/30 12:30:35 bouyer 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 January 10, 2004 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 XFSSIOCSETXstructXfss_setX -offset indent 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.El 122.Sh KERNEL THREADS 123For each active snapshot device there is a kernel thread 124that handles the backing store. 125This thread is named 126.Va fssbsN 127where 128.Va N 129is the device minor number. 130.Sh FILES 131.Bl -tag -width /dev/rfss? -compact 132.It Pa /dev/rfss? 133.It Pa /dev/fss? 134.El 135.Sh SEE ALSO 136.Xr fssconfig 8 , 137.Xr mount 8 , 138.Xr umount 8 139.Sh HISTORY 140The 141.Nm 142device appeared in 143.Nx 2.0 . 144.Sh BUGS 145This driver is 146.Em experimental . 147Be sure you have a backup before you use it. 148