Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  FFS2RECOV (8)


ffs2recov - aid to recover files from corrupt ffs2 filesystems




ffs2recov [-adps] [-b blk] [ -c inum-n name | -f inum | -i inum ] [-o blk] [-r name] [-t blk] file


The program ffs2recov is used to aid in the recovery of file data from a corrupt file system.

The options are as follows:
-a Dump all files on the filesystem that have the mode IFREG in the inode. They will be put into the local directory with their name being the inode number.
-b blk Find where block blk is in the file system. This will report what file if any it is in, or if it is in part of the meta data in the file system. NOTE: This is experimental and hasn’t been fully tested.
-c inum-n name
  Recreate inum in the current directory with the name name. If inum is a directory, it will create the directory, and populate it with it’s children. This will restore permissions, ownership (if root), atime and mtime.
-d Dump all the inodes with the mode IFDIR. The listing will contain each file name and inode number that goes with the file. Each directory is listed on a single line.
-f inum
  Print out inode information for inum.
-i inum
  Dump out the data belonging to inum to stdout.
-o blk Use disk block blk as the location of the superblock. Currently this only effects the parameters used, or what is printed out when displaying the superblock with -p . It does not change where it thinks the blocks within the file system are.
-p Print out the information contained in the superblock.
-r name
  Prints out the inode and the parent inode of any file that matches name.
-s Find possible superblocks in the filesystem. If there is a valid cylinder group following it, it will print out where the beging of the file system is. This may not be correct if there are stray superblock/cylinder group pairs on the disk, such as in swap.
[-t blk]
  Offsets all read operations to blk. This is useful for accessing a filesystem in another partition through the raw disk device that covers the entire disk. The other block offsets are all relative to this. Reported blocks will also be relative to this block offset.
file Operate on the file system file. This file can either be a raw device or a regular file. You must either be able to mmap(2) or be able to seek on it.


The following is an example of a typical usage of the ffs2recov command:

If you would like to recover inode 2385 named dir and all it’s decendants the command:

    % ffs2recov -c 2385 -n dir ffs.image

will create dir, populate it, setting modes, permissions, and times to the originals.

    % ffs2recov -s /dev/rda0c

will scan the entire disk da0 and search for possible file systems. It will print out the super block offset (for use with -o ) along with the start of the file system.

    % ffs2recov -p -o 655376 ffs.image

will print out the super block at disk block location 655376. It will warn if the block doesn’t appear to be a valid super block, but will still try to print out parameters from it.


This manual page was written by
.An John-Mark Gurney Aq .


The code doesn’t handle triple indirect blocks. This shouldn’t be a problem due to the fact that on a standard 4096/512 system, you can represent a 2**32 byte file without triple indirect blocks.
Search for    or go to Top of page |  Section 8 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.