xref: /netbsd-src/sbin/scan_ffs/scan_ffs.8 (revision b83d27bc99e71156392709dafbcc0f4925d9b3c8)
1.\"	$NetBSD: scan_ffs.8,v 1.14 2007/05/01 21:41:52 xtraeme Exp $
2.\"     OpenBSD: scan_ffs.8,v 1.13 2004/12/14 00:04:21 jmc Exp
3.\"
4.\" Copyright (c) 2005 Juan Romero Pardines
5.\" Copyright (c) 1997 Niklas Hallqvist, Tobias Weingartner
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27.\"
28.Dd May 1, 2007
29.Dt SCAN_FFS 8
30.Os
31.Sh NAME
32.Nm scan_ffs ,
33.Nm scan_lfs
34.Nd find FFSv1/FFSv2/LFS partitions on a disk or file
35.Sh SYNOPSIS
36.Nm
37.Op Fl blv
38.Op Fl e Ar end
39.Op Fl F Ar file
40.Op Fl s Ar start
41.Ar device
42.Sh DESCRIPTION
43.Nm
44will take a raw disk device that covers the whole disk or a file
45and will find all possible FFSv[12]/LFS partitions, independent
46of block sizes on it.
47It will show the file system type (FFSv1, FFSv2, or LFS), size, and
48offset.
49Also it has an option to show the values with a disklabel-alike
50output.
51.Pp
52The options are as follows:
53.Bl -tag -width XXsXstartXX
54.It Fl b
55Report every superblock found with its sector address, rather than trying
56to report the partition boundaries.
57This option can be useful to find the other superblocks in a partition if
58the first superblock has become corrupted.
59It is most useful if
60.Ar device
61refers to the raw device for the partition, rather than the entire disk.
62.It Fl e Ar end
63Where to stop searching for file systems.
64The
65.Ar end
66argument specifies the last sector that will be searched.
67Default is the last sector of
68.Ar device .
69.It Fl F Ar file
70Path to a file containing possible partitions inside of it.
71.It Fl l
72Print out a string looking much like the input to disklabel.
73With a little massaging, this output can usually be used by
74.Xr disklabel 8 .
75.It Fl s Ar start
76Where to start searching for file systems.
77This makes it easier to skip swap
78partitions or other large non-UFS/FFS partitions.
79The
80.Ar start
81argument specifies the first sector that will be searched.
82Default is the first sector of
83.Ar device .
84.It Fl v
85Be verbose about what
86.Nm
87is doing, and what has been found.
88.El
89.Pp
90The
91.Ar device
92argument specifies which device
93.Nm
94should scan for file systems.
95.Pp
96.Nm scan_lfs
97is just another name for the same program, both behave in exactly
98the same way.
99.Sh SEE ALSO
100.Xr disklabel 8
101.Sh HISTORY
102The
103.Nm
104program first appeared in
105.Ox 2.3
106and then in
107.Nx 3.1 .
108Support for searching in files was added in
109.Nx 4.0 .
110.Sh AUTHORS
111.An -nosplit
112.Nm
113was written for
114.Ox
115by
116.An Niklas Hallqvist
117and
118.An Tobias Weingartner .
119It was ported to
120.Nx
121by
122.An Juan Romero Pardines ,
123who added support for LFS/FFSv2,
124partitions with fragsize/blocksize greater than
1252048/16384 for FFSv1, searching on files, etc.
126.Sh BUGS
127Currently
128.Nm
129won't find partitions with fragsize/blocksize greater than
1308192/65536.
131