xref: /netbsd/sbin/fsirand/fsirand.8 (revision bf9ec67e)
1.\"	$NetBSD: fsirand.8,v 1.7 2001/11/16 04:25:43 lukem Exp $
2.\"
3.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Christos Zoulas.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd November 16, 2001
38.Dt FSIRAND 8
39.Os
40.Sh NAME
41.Nm fsirand
42.Nd install random inode generation numbers in a filesystem
43.Sh SYNOPSIS
44.Nm
45.Op Fl F
46.Op Fl p
47.Op Fl x Ar constant
48.Ar special
49.Sh DESCRIPTION
50.Nm
51writes random inode generation numbers for all the inodes on device
52.Ar special .
53These random numbers make the NFS filehandles less predictable, increasing
54security of exported filesystems.
55.Pp
56.Nm
57should be run on a clean and unmounted filesystem.
58.Pp
59The options are as follows:
60.Bl -tag -width indent
61.It Fl F
62Indicates that
63.Ar special
64is a file system image, rather than a device name.
65.Ar special
66will be accessed
67.Sq as-is ,
68without requiring that it is a raw character device and without
69attempting to read a disklabel.
70.It Fl p
71Print the current inode generation numbers; the filesystem is not modified.
72.It Fl x Ar constant
73Exclusive-or the given constant with the random number used in the generation
74process.
75.El
76.Pp
77.Nm
78exits zero on success, non-zero on failure.
79.Pp
80If
81.Nm
82receives a
83.Dv SIGINFO
84signal, statistics on the amount of work completed and estimated
85completion time (in minutes:seconds) will be written to the standard
86error output.
87.Sh SEE ALSO
88.Xr fsck_ffs 8 ,
89.Xr newfs 8
90.Sh SECURITY CONSIDERATIONS
91The current implementation does not use a good random number generator,
92so the randomization can be predicted.
93