Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

scan_lfs(8) [netbsd man page]

SCAN_FFS(8)						    BSD System Manager's Manual 					       SCAN_FFS(8)

scan_ffs, scan_lfs -- find FFSv1/FFSv2/LFS partitions on a disk or file SYNOPSIS
scan_ffs [-blv] [-e end] [-F file] [-s start] device DESCRIPTION
scan_ffs will take a raw disk device that covers the whole disk or a file and will find all possible FFSv[12]/LFS partitions, independent of block sizes on it. It will show the file system type (FFSv1, FFSv2, or LFS), size, and offset. Also it has an option to show the values with a disklabel-alike output. The options are as follows: -b Report every superblock found with its sector address, rather than trying to report the partition boundaries. This option can be useful to find the other superblocks in a partition if the first superblock has become corrupted. It is most useful if device refers to the raw device for the partition, rather than the entire disk. -e end Where to stop searching for file systems. The end argument specifies the last sector that will be searched. Default is the last sector of device. -F file Path to a file containing possible partitions inside of it. -l Print out a string looking much like the input to disklabel. With a little massaging, this output can usually be used by disklabel(8). -s start Where to start searching for file systems. This makes it easier to skip swap partitions or other large non-UFS/FFS partitions. The start argument specifies the first sector that will be searched. Default is the first sector of device. -v Be verbose about what scan_ffs is doing, and what has been found. The device argument specifies which device scan_ffs should scan for file systems. scan_lfs is just another name for the same program, both behave in exactly the same way. SEE ALSO
disklabel(8) HISTORY
The scan_ffs program first appeared in OpenBSD 2.3 and then in NetBSD 3.1. Support for searching in files was added in NetBSD 4.0. AUTHORS
scan_ffs was written for OpenBSD by Niklas Hallqvist and Tobias Weingartner. It was ported to NetBSD by Juan Romero Pardines, who added sup- port for LFS/FFSv2, partitions with fragsize/blocksize greater than 2048/16384 for FFSv1, searching on files, etc. BUGS
Currently scan_ffs won't find partitions with fragsize/blocksize greater than 8192/65536. BSD
May 1, 2007 BSD

Check Out this Related Man Page

DISKLABEL(8)						    BSD System Manager's Manual 					      DISKLABEL(8)

disklabel -- read and write disk pack label SYNOPSIS
disklabel [-ACDFrtv] disk disklabel -e [-CDFIrv] disk disklabel -i [-DFIrv] disk disklabel -R [-DFrv] disk protofile disklabel -w [-DFrv] [-f disktab] disk disktype [packid] disklabel [-NW] disk disklabel -l DESCRIPTION
disklabel can be used to install, examine, or modify the label on a disk drive or pack. When writing the label, it can be used to change the drive identification, the disk partitions on the drive, or to replace a damaged label. The -e, -i, -l, -R, -w, -N, and -W options determine the basic operation. If none are specified the label is displayed. -e Edit the existing label (using EDITOR) and write it back to the disk. If EDITOR is undefined, then vi(1) is used. -i Interactively update the existing label and write it back to the disk. -l Show all known file system types (those that can be specified along a partition within the label) and exit. -R Write (restore) a label by reading it from protofile. The file should be in the same format as the default output. -w Write a standard label for the specified disktype. See disktab(5). -N Disallow writes to the disk sector that contains the label. This is the default state. -W Allow writes to the disk sector that contains the label. This state may not persist if no programs have the disk open. The majority of the rest of the options affect more than one form of the command: -A Read all labels from the disk, including ones deleted with disklabel -D. Implies -r. -C Output the partition offset and size values in <cylinder/head/sector> format. Note this format is always accepted on input with either the -e or -R flags. -D Delete all existing labels (by 1's complementing the magic number) before writing any labels to their default location. Implies -r. If -D is specified without a request to write the label, then existing labels are just deleted. -F Treat disk as a regular file. This suppresses all ioctl(2) calls, and is the default if disk is a regular file. disk is always opened using opendisk(3) even if -F is specified. Implies -r. -I If a label cannot be read from disk request the default one from the kernel. Implies -r. -f disktab Specify the name of a file to use instead of /etc/disktab. -r Read/write the disk directly rather than using ioctl(2) requests on the kernel. When writing a label, the kernel will be told about the label before the label is written and asked to write afterwards. This is the historic behaviour and can be supressed by specifying -F. -t Format the output as a disktab(5) entry. -v Be verbose about the operations being done, in particular the disk sectors being read and written. Specifying -v more than once will increase the verbosity. On systems that expect to have disks with MBR partitions (see fdisk(8)) disklabel will find, and update if requested, labels in the first 8k of type 169 (NetBSD) MBR labels and within the first 8k of the physical disk. On other systems disklabel will only look at the start of the disk. The offset at which the labels are written is also system dependent. disklabel will detect byteswapped labels, but currently cannot display them. Previous versions of disklabel could update the bootstrap code on some architectures. This functionality has been subsumed by installboot(8). FILES
/etc/disktab EXIT STATUS
The exit status of disklabel is set to indicate any errors or warnings. The values used are: 0 The disklabel utility has completed successfully. 1 A fatal error has occurred, such as unknown options passed on the command line, or writing the disklabel failed. 4 An I/O error of some sort occurred. 101..n One or more warnings occured while reading the disklabel. Subtract 100 to get the number of warnings detected. EXAMPLES
disklabel sd0 Display the in-core label for sd0 as obtained via /dev/rsd0c. disklabel -i -r sd0 Read the on-disk label for sd0, edit it using the built-in interactive editor and reinstall in-core as well as on-disk. disklabel -i -I sd0 As previous, but don't fail if there was no label on the disk yet; provide some default values instead. disklabel -e -I sd0 As previous, only edit using $EDITOR disklabel -w -r /dev/rsd0c sd2212 foo Create a label for sd0 based on information for ``sd2212'' found in /etc/disktab, using foo as the disk pack label. If you do not have an entry for your disk in /etc/disktab, you can use this style to put an initial label onto a new disk. Then dump the label to a file (using disklabel sd0 > protofile), editing the file, and replacing the label with disklabel -R sd0 protofile. disklabel -R sd0 mylabel Restore the on-disk and in-core label for sd0 from information in mylabel. DIAGNOSTICS
The kernel device drivers will not allow the size of a disk partition to be decreased or the offset of a partition to be changed while it is open. Some device drivers create a label containing only a single large partition if a disk is unlabeled; thus, the label must be written to the ``a'' partition of the disk while it is open. This sometimes requires the desired label to be set in two steps, the first one creating at least one other partition, and the second setting the label on the new partition while shrinking the ``a'' partition. SEE ALSO
opendisk(3), disklabel(5), disktab(5), dkctl(8), fdisk(8), gpt(8), installboot(8), mbrlabel(8), mscdlabel(8) BUGS
The disklabel structure stored on disk cannot support partitions/disks greater than 2TB. Please use gpt(8) and dkctl(8) to manage partitions and disks larger than 2TB. If the disk partition is not specified in the disk name (i.e., xy0 instead of /dev/rxy0c), disklabel will construct the full pathname of the disk and use the ``d'' partition on i386, hpcmips, or arc, and the ``c'' partition on all others. On the sparc, sparc64, sun2, and sun3 NetBSD systems, the size of each partition must be a multiple of the number of sectors per cylinder (i.e., each partition must be an integer number of cylinders), or the boot ROMs will declare the label invalid and fail to boot the system. In addition, the -r option should never be used on a sparc, sparc64, sun2, or sun3 system boot disk - the NetBSD kernel translates the NetBSD disk label into a SunOS compatible format (which is required by the boot PROMs) when it writes the label. Using the -r flag causes disklabel to write directly to disk, and bypass the format translation. This will result in a disk label that the PROMs will not recognize, and that therefore cannot be booted from. BSD
July 25, 2011 BSD
Man Page