Manual Reference Pages - SCAN_FFS (8)
- find UFS/FFS partitions on a disk
This is the life-saver of typos.
If you have ever been working too long,
and just happened to type disklabel -rw da0 floppy, instead of disklabel
-rw fd0 floppy, you know what I am talking about.
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.
The options are as follows:
This will make
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.
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
its own good,
especially if your disk has had a different layout previously, or contains
other non-UFS/FFS filesystems.
to be verbose about what it is doing, and what it has found.
where to begin searching for filesystems.
This makes it easier to skip swap
partitions, or other large non-UFS/FFS partitions.
Ditto for telling
where to stop.
This specifies which device
should use to scan for filesystems.
Usually this device should cover the whole disk in question.
The basic operation of this program is as follows:
You usually do so anyways, so you might as well get it over with.
Just dont do anything stupid.
Panic away from your machine.
Then relax, and see if the steps below wont help you out.
- Try to find your old disklabel by any other means possible.
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.
- Create a disklabel on the affected disk, which covers the whole disk, and has
at least one partition which covers the whole disk.
usually covers the whole disk anyways, this sounds like a good place to start.
over this partition.
If you have any information about the disklabel
which used to exist on the disk, keep that in mind while
spews out its things.
to reconstruct the disklabel on the affected disk, using
all the information you gathered from
and other sources.
Last but certainly not least, we wish you good luck.
The UFS/FFS filesystems are pretty sturdy.
Ive seen them reconstructed after some pretty weird and
If you cant have backups, at least have funky tools to help
you out of a jam when they happen.
utility first appeared in
OpenBSD 2.3 and was ported to
by Robert Watson. UFS2 Support was added by Michael Ranner.
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.
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.