summaryrefslogtreecommitdiff
path: root/sbin/scan_ffs
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>1998-02-05 17:15:52 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>1998-02-05 17:15:52 +0000
commit3bfc7e6c2fa8ce0fae316d86abdc57b4c8792f9b (patch)
tree9e3715081a06e80dbcaf1078fa6238579ecbbb3b /sbin/scan_ffs
parent06265f0e7c4647765c1c7602b32deb29a109e8fb (diff)
Add man page. I don't know which revision this one is, I might have
a newer version of this utility to commit later...
Diffstat (limited to 'sbin/scan_ffs')
-rw-r--r--sbin/scan_ffs/Makefile5
-rw-r--r--sbin/scan_ffs/scan_ffs.8142
2 files changed, 145 insertions, 2 deletions
diff --git a/sbin/scan_ffs/Makefile b/sbin/scan_ffs/Makefile
index 7242fbb1b92..b97efad106e 100644
--- a/sbin/scan_ffs/Makefile
+++ b/sbin/scan_ffs/Makefile
@@ -1,9 +1,10 @@
-# $OpenBSD: Makefile,v 1.1 1998/02/04 20:37:13 deraadt Exp $
+# $OpenBSD: Makefile,v 1.2 1998/02/05 17:15:51 weingart Exp $
PROG= scan_ffs
SRCS= scan_ffs.c
-NOMAN=
DPADD= ${LIBUTIL}
LDADD= -lutil
+MAN= scan_ffs.8
+
.include <bsd.prog.mk>
diff --git a/sbin/scan_ffs/scan_ffs.8 b/sbin/scan_ffs/scan_ffs.8
new file mode 100644
index 00000000000..0bf55723a3d
--- /dev/null
+++ b/sbin/scan_ffs/scan_ffs.8
@@ -0,0 +1,142 @@
+.\" $OpenBSD: scan_ffs.8,v 1.1 1998/02/05 17:15:51 weingart Exp $
+.\"
+.\" Copyright (c) 1997 Niklas Hallqvist, Tobias Weingartner
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by Tobias Weingartner.
+.\" 4. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" .TH scan_ffs 8
+.Dd January 31, 1998
+.Dt SCAN_FFS 8
+.Os OpenBSD
+.Sh NAME
+.Nm scan_ffs
+.Nd find UFS/FFS partitions on a disk
+.Sh SYNOPSIS
+.Nm
+.Op Fl lsv
+.Op Fl b Ar begin
+.Op Fl e Ar end
+.Ar device
+.Sh DESCRIPTION
+This is the life-saver of typo's. If you have ever been working too long,
+and just happened to type 'disklabel -rw sd0 floppy', instead of 'disklabel
+-rw fd0 floppy', you know what I am talking about.
+.Pp
+This little program will take a raw disk device (which you might have to
+create) that covers the whole disk, and finds all probable UFS/FFS partitions
+on the disk. It has various options to make it go faster, and to print out
+information to help in the reconstruction of the disklabel.
+.Pp
+The following options are available:
+.Pp
+.Bl -tag -width "-b begin"
+.It Fl l
+This will make
+.Nm
+print out a string looking much like the input to disklabel. With a little
+massaging, this output can usually be used in the disklabel edit.
+.Pp
+.It Fl s
+This tells
+.Nm
+to be smart about skipping partitions (when it thinks it found a valid one).
+By not scanning partitions for superblocks, the program completes a couple of
+orders of magnitude faster. However, sometimes being smart is too good for
+it's own good,
+especially if your disk has had a different layout previously, or contains
+other non-UFS/FFS filesystems.
+.Pp
+.It Fl v
+Tell
+.Nm
+to be verbose about what it is doing, and what it has found.
+.Pp
+.It Fl b Ar begin
+Tell
+.Nm
+where to begin searching for filesystems. This makes it easier to skip swap
+partitions, or other large non-UFS/FFS partitions.
+.Pp
+.It Fl e Ar end
+Ditto for telling
+.Nm
+where to stop.
+.Pp
+.It Ar device
+This specifies which device
+.Nm
+should use to scan for filesystems. Usually this device should cover the
+whole disk in question.
+.Pp
+.El
+.Pp
+The basic operation of this program is as follows:
+.Pp
+.Bl -enum -width "1111"
+.It
+Panic. You usually do so anyways, so you might as well get it over with.
+Just don't do anything stupid. Panic away from your machine. Then relax,
+and see if the steps below won't help you out.
+.It
+Try to find your old disklabel by any other means possible. This includes
+printouts, backups, screendumps, and whatever other method you can think of.
+The more information you have, the better your chances are in recovering the
+disklabel of the disk.
+.Pp
+.It
+Create a disklabel on the affected disk, which covers the whole disk, and has
+at least one partition which covers the whole disk. As the 'c' partition
+usually covers the whole disk anyways, this sounds like a good place to start.
+.Pp
+.It
+Run
+.Nm
+over this partition. If you have any information about the disklabel
+which used to exist on the disk, keep that in mind while
+.Nm
+spews out its things.
+.Pp
+.It
+Use disklabel(8) to reconstruct the disklabel on the affected disk, using
+all the information you gathered from
+.Nm
+and other sources.
+.Pp
+.El
+.Pp
+Last but certainly not least, we wish you good luck. The UFS/FFS filesystems
+are pretty sturdy. I've seen them reconstructed after some pretty weird and
+awesome fumbles. If you can't have backups, at least have funky tools to help
+you out of a jam when they happen.
+.Pp
+.Sh SEE ALSO
+.Xr disklabel 8
+.Sh BUGS
+It is not perfect, and could do a lot more things with date/time information
+in the superblocks it finds, but this program has saved more than one butt,
+more than once.
+