fsgrab(1) - Linux man page

Name

fsgrab - grab contiguous data from a file or device

Synopsis

fsgrab [options]... [device]

Description

fsgrab seeks into a file (normally a block device file), and copies blocks from the appropriate point in that file to standard output. The device defaults to /dev/hda1 if none is named specifically.

Options

-d, --device=device
Read data from device instead of the default /dev/hda1. If you use this option, no non-option arguments are permitted.
-b, --block-size=blocksize
Use a block size of blocksize instead of the default 1024 bytes. blocksize may have an optional multiplier suffix: w for ×2, b for ×512, k for ×1024, m for ×1Meg.
-c, --count=count
Write out count blocks instead of the default 1 block.
-s, --skip=skip
Seek past the first skip blocks of input instead of the default zero.
-m, --max-chars=maximum, --max-bytes=maximum
Write no more than maximum bytes to the output. Note that fsgrab attempts to read blocksize × count bytes from the input regardless of whether a -m option was specified; this option will only affect how much it attempts to write. If the difference between the maximum and what would normally be written is more than the blocksize, or if the maximum is greater than what would normally be written, then fsgrab prints a warning to standard error.
-o, --output=output
Write the blocks to a file named output instead of to stdout.
-a, --append
Append to a named output instead of overwriting. This option is ignored when data is written to standard output.
-f, --force
Force writing to standard output even if it is a terminal.
--help
Write a usage message to standard output and exit successfully.
--version
Write version information to standard output and exit successfully.

Bugs

fsgrab may break if you try to seek more than 2097151 1k-blocks into a device; this is caused by the limitations of the lseek(2) system call. fsgrab makes some attempt to use ext2fs_llseek(3) (from the libext2fs library supplied with e2fsprogs) or llseek(2) where available to seek further into a device, but the code has not been widely tested. Early indications suggest that on full-featured Linux systems (where the libext2fs development system is available) and on FreeBSD (and other systems which have a 64-bit off_t type), fsgrab can successfully handle very large file systems (potentially billions of gigabytes, though sizes up to 9 GB have been tested).

See Also

dd(1).
The need for fsgrab may not be immediately obvious, given that dd does pretty much the same thing. Note that some versions of dd read but ignore the data specified in their skip= option; some even do this only for non-regular files (such as device files). fsgrab on the other hand always seeks over such data. In addition, the new --max-bytes option in fsgrab (added to make automated recovery of deleted files more straightforward) has no equivalent in dd.
lseek(2), llseek(2).
e2fsprogs
http://web.mit.edu/tytso/www/linux/e2fsprogs.html.
FreeBSD
http://www.freebsd.org/

Author

Aaron Crane <aaronc@pobox.com>. Bug-reports, comments and patches are always welcomed.

Copyright

This file is part of e2recover, a suite of programs which assist in recovering deleted files from ext2 file systems. e2recover is Copyright © 1997, 1998, 1999 Aaron Crane <aaronc@pobox.com>.

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with fsgrab; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

Referenced By

e2recover(1)