Asciidoc: Import disk-utils man pages

This commit is contained in:
Mario Blättermann 2021-03-16 21:08:43 +01:00
parent ef63c72a33
commit c6a568fccb
20 changed files with 2297 additions and 0 deletions

56
disk-utils/addpart.8.adoc Normal file
View File

@ -0,0 +1,56 @@
////
addpart.8 -- man page for addpart
Copyright 2007 Karel Zak <kzak@redhat.com>
Copyright 2007 Red Hat, Inc.
May be distributed under the GNU General Public License
////
= addpart(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: addpart
== NAME
addpart - tell the kernel about the existence of a partition
== SYNOPSIS
*addpart* _device partition start length_
== DESCRIPTION
*addpart* tells the Linux kernel about the existence of the specified partition. The command is a simple wrapper around the "add partition" ioctl.
This command doesn't manipulate partitions on a block device.
== PARAMETERS
_device_::
The disk device.
_partition_::
The partition number.
_start_::
The beginning of the partition (in 512-byte sectors).
_length_::
The length of the partition (in 512-byte sectors).
== SEE ALSO
*delpart*(8),
*fdisk*(8),
*parted*(8),
*partprobe*(8),
*partx*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

124
disk-utils/blockdev.8.adoc Normal file
View File

@ -0,0 +1,124 @@
////
Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
Copyright 2007 Karel Zak <kzak@redhat.com>
May be distributed under the GNU General Public License
////
= blockdev(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: blockdev
== NAME
blockdev - call block device ioctls from the command line
== SYNOPSIS
*blockdev* [*-q*] [*-v*] _command_ [_command_...] _device_ [_device_...]
*blockdev* *--report* [_device_...]
*blockdev* *-h*|*-V*
== DESCRIPTION
The utility *blockdev* allows one to call block device ioctls from the command line.
== OPTIONS
*-q*::
Be quiet.
*-v*::
Be verbose.
*--report*::
Print a report for the specified device. It is possible to give multiple devices. If none is given, all devices which appear in _/proc/partitions_ are shown. Note that the partition StartSec is in 512-byte sectors.
*-h*, *--help*::
Display help text and exit.
*-V*, *--version*::
Print version and exit.
== COMMANDS
It is possible to give multiple devices and multiple commands.
*--flushbufs*::
Flush buffers.
*--getalignoff*::
Get alignment offset.
*--getbsz*::
Print the blocksize in bytes. This size does not describe device topology. It's the size used internally by the kernel and it may be modified (for example) by filesystem driver on mount.
*--getdiscardzeroes*::
Get discard zeroes support status.
*--getfra*::
Get filesystem readahead in 512-byte sectors.
*--getiomin*::
Get minimum I/O size.
*--getioopt*::
Get optimal I/O size.
*--getmaxsect*::
Get max sectors per request.
*--getpbsz*::
Get physical block (sector) size.
*--getra*::
Print readahead (in 512-byte sectors).
*--getro*::
Get read-only. Print 1 if the device is read-only, 0 otherwise.
*--getsize64*::
Print device size in bytes.
*--getsize*::
Print device size (32-bit!) in sectors. Deprecated in favor of the *--getsz* option.
*--getss*::
Print logical sector size in bytes - usually 512.
*--getsz*::
Get size in 512-byte sectors.
*--rereadpt*::
Reread partition table
*--setbsz* _bytes_::
Set blocksize. Note that the block size is specific to the current file descriptor opening the block device, so the change of block size only persists for as long as *blockdev* has the device open, and is lost once *blockdev* exits.
*--setfra* _sectors_::
Set filesystem readahead (same as *--setra* on 2.6 kernels).
*--setra* _sectors_::
Set readahead (in 512-byte sectors).
*--setro*::
Set read-only. The currently active access to the device may not be affected by the change. For example, a filesystem already mounted in read-write mode will not be affected. The change applies after remount.
*--setrw*::
Set read-write.
== AUTHORS
*blockdev* was written by Andries E. Brouwer and rewritten by Karel Zak.
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

162
disk-utils/cfdisk.8.adoc Normal file
View File

@ -0,0 +1,162 @@
////
cfdisk.8 -- man page for cfdisk
Copyright 1994 Kevin E. Martin (martin@cs.unc.edu)
Copyright (C) 2014 Karel Zak <kzak@redhat.com>
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
////
= cfdisk(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: cfdisk
== NAME
cfdisk - display or manipulate a disk partition table
== SYNOPSIS
*cfdisk* [_options_] [_device_]
== DESCRIPTION
*cfdisk* is a curses-based program for partitioning any block device. The default device is _/dev/sda_.
Note that *cfdisk* provides basic partitioning functionality with a user-friendly interface. If you need advanced features, use *fdisk*(8) instead.
All disk label changes will remain in memory only, and the disk will be unmodified until you decide to write your changes. Be careful before using the write command.
Since version 2.25 *cfdisk* supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any functionality for CHS (Cylinder-Head-Sector) addressing. CHS has never been important for Linux, and this addressing concept does not make any sense for new devices.
Since version 2.25 *cfdisk* also does not provide a 'print' command any more. This functionality is provided by the utilities *partx*(8) and *lsblk*(8) in a very comfortable and rich way.
If you want to remove an old partition table from a device, use *wipefs*(8).
== OPTIONS
*-h*, *--help*::
Display help text and exit.
*-L*, *--color*[**=**__when__]::
Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled, for the current built-in default see *--help* output. See also the COLORS section.
*--lock*[=_mode_]::
Use exclusive BSD lock for device or file it operates. The optional argument _mode_ can be *yes*, *no* (or 1 and 0) or *nonblock*. If the _mode_ argument is omitted, it defaults to *"yes"*. This option overwrites environment variable *$LOCK_BLOCK_DEVICE*. The default is not to use any lock at all, but it's recommended to avoid collisions with udevd or other tools.
*-r*, *--read-only*::
Forced open in read-only mode.
*-V*, *--version*::
Display version information and exit.
*-z*, *--zero*::
Start with an in-memory zeroed partition table. This option does not zero the partition table on the disk; rather, it simply starts the program without reading the existing partition table. This option allows you to create a new partition table from scratch or from an sfdisk-compatible script.
== COMMANDS
The commands for *cfdisk* can be entered by pressing the corresponding key (pressing _Enter_ after the command is not necessary). Here is a list of the available commands:
*b*::
Toggle the bootable flag of the current partition. This allows you to select which primary partition is bootable on the drive. This command may not be available for all partition label types.
*d*::
Delete the current partition. This will convert the current partition into free space and merge it with any free space immediately surrounding the current partition. A partition already marked as free space or marked as unusable cannot be deleted.
*h*::
Show the help screen.
*n*::
Create a new partition from free space. *cfdisk* then prompts you for the size of the partition you want to create. The default size is equal to the entire available free space at the current position. +
The size may be followed by a multiplicative suffix: KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB").
*q*::
Quit the program. This will exit the program without writing any data to the disk.
*r*::
Reduce or enlarge the current partition. *cfdisk* then prompts you for the new size of the partition. The default size is the current size. A partition marked as free space or marked as unusable cannot be resized. +
*Note that reducing the size of a partition might destroy data on that partition.*
*s*::
Sort the partitions in ascending start-sector order. When deleting and adding partitions, it is likely that the numbering of the partitions will no longer match their order on the disk. This command restores that match.
*t*::
Change the partition type. By default, new partitions are created as _Linux_ partitions.
*u*::
Dump the current in-memory partition table to an sfdisk-compatible script file. +
The script files are compatible between *cfdisk*, *fdisk*(8) *sfdisk*(8) and other libfdisk applications. For more details see *sfdisk*(8). +
It is also possible to load an sfdisk-script into *cfdisk* if there is no partition table on the device or when you start *cfdisk* with the *--zero* command-line option.
*W*::
Write the partition table to disk (you must enter an uppercase W). Since this might destroy data on the disk, you must either confirm or deny the write by entering `yes' or `no'. If you enter `yes', *cfdisk* will write the partition table to disk and then tell the kernel to re-read the partition table from the disk. +
The re-reading of the partition table does not always work. In such a case you need to inform the kernel about any new partitions by using *partprobe*(8) or *partx*(8), or by rebooting the system.
*x*::
Toggle extra information about a partition.
_Up Arrow_, _Down Arrow_::
Move the cursor to the previous or next partition. If there are more partitions than can be displayed on a screen, you can display the next (previous) set of partitions by moving down (up) at the last (first) partition displayed on the screen.
_Left Arrow_, _Right Arrow_::
Select the preceding or the next menu item. Hitting _Enter_ will execute the currently selected item.
All commands can be entered with either uppercase or lowercase letters (except for **W**rite). When in a submenu or at a prompt, you can hit the _Esc_ key to return to the main menu.
== COLORS
Implicit coloring can be disabled by creating the empty file _/etc/terminal-colors.d/cfdisk.disable_.
See *terminal-colors.d*(5) for more details about colorization configuration.
*cfdisk* does not support color customization with a color-scheme file.
== ENVIRONMENT
*CFDISK_DEBUG*=all::
enables cfdisk debug output.
*LIBFDISK_DEBUG*=all::
enables libfdisk debug output.
*LIBBLKID_DEBUG*=all::
enables libblkid debug output.
*LIBSMARTCOLS_DEBUG*=all::
enables libsmartcols debug output.
*LIBSMARTCOLS_DEBUG_PADDING*=on::
use visible padding characters. Requires enabled *LIBSMARTCOLS_DEBUG*.
*LOCK_BLOCK_DEVICE*=<mode>::
use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
== AUTHORS
mailto:kzak@redhat.com[Karel Zak]
The current cfdisk implementation is based on the original cfdisk from mailto:martin@cs.unc.edu[Kevin E. Martin].
== SEE ALSO
*fdisk*(8),
*parted*(8),
*partprobe*(8),
*partx*(8),
*sfdisk*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

42
disk-utils/delpart.8.adoc Normal file
View File

@ -0,0 +1,42 @@
////
delpart.8 -- man page for delpart
Copyright 2007 Karel Zak <kzak@redhat.com>
Copyright 2007 Red Hat, Inc.
May be distributed under the GNU General Public License
////
= delpart(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: delpart
== NAME
delpart - tell the kernel to forget about a partition
== SYNOPSIS
*delpart* _device partition_
== DESCRIPTION
*delpart* asks the Linux kernel to forget about the specified _partition_ (a number) on the specified _device_. The command is a simple wrapper around the "del partition" ioctl.
This command doesn't manipulate partitions on a block device.
== SEE ALSO
*addpart*(8),
*fdisk*(8),
*parted*(8),
*partprobe*(8),
*partx*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,91 @@
////
Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
= fdformat(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: fdformat
== NAME
fdformat - low-level format a floppy disk
== SYNOPSIS
*fdformat* [_options_] _device_
== DESCRIPTION
*fdformat* does a low-level format on a floppy disk. _device_ is usually one of the following (for floppy devices the major = 2, and the minor is shown for informational purposes only):
....
/dev/fd0d360 (minor = 4)
/dev/fd0h1200 (minor = 8)
/dev/fd0D360 (minor = 12)
/dev/fd0H360 (minor = 12)
/dev/fd0D720 (minor = 16)
/dev/fd0H720 (minor = 16)
/dev/fd0h360 (minor = 20)
/dev/fd0h720 (minor = 24)
/dev/fd0H1440 (minor = 28)
....
....
/dev/fd1d360 (minor = 5)
/dev/fd1h1200 (minor = 9)
/dev/fd1D360 (minor = 13)
/dev/fd1H360 (minor = 13)
/dev/fd1D720 (minor = 17)
/dev/fd1H720 (minor = 17)
/dev/fd1h360 (minor = 21)
/dev/fd1h720 (minor = 25)
/dev/fd1H1440 (minor = 29)
....
The generic floppy devices, _/dev/fd0_ and _/dev/fd1_, will fail to work with *fdformat* when a non-standard format is being used, or if the format has not been autodetected earlier. In this case, use *setfdprm*(8) to load the disk parameters.
== OPTIONS
*-f*, *--from* _N_::
Start at the track _N_ (default is 0).
*-t*, *--to* _N_::
Stop at the track _N_.
*-r*, *--repair* _N_::
Try to repair tracks failed during the verification (max _N_ retries).
*-n*, *--no-verify*::
Skip the verification that is normally performed after the formatting.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== NOTES
This utility does not handle USB floppy disk drives. Use *ufiformat*(8) instead.
== AUTHORS
mailto:almesber@nessie.cs.id.ethz.ch[Werner Almesberger]
== SEE ALSO
*fd*(4),
*emkfs*(8),
*mkfs*(8),
*setfdprm*(8),
*ufiformat*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

236
disk-utils/fdisk.8.adoc Normal file
View File

@ -0,0 +1,236 @@
////
Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
Copyright 2012 Davidlohr Bueso <dave@gnu.org>
Copyright (C) 2013 Karel Zak <kzak@redhat.com>
May be distributed under the GNU General Public License
////
= fdisk(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: fdisk
== NAME
fdisk - manipulate disk partition table
== SYNOPSIS
*fdisk* [_options_] _device_
*fdisk* *-l* [_device_...]
== DESCRIPTION
*fdisk* is a dialog-driven program for creation and manipulation of partition tables. It understands GPT, MBR, Sun, SGI and BSD partition tables.
Block devices can be divided into one or more logical disks called _partitions_. This division is recorded in the _partition table_, usually found in sector 0 of the disk. (In the BSD world one talks about `disk slices' and a `disklabel'.)
All partitioning is driven by device I/O limits (the topology) by default. *fdisk* is able to optimize the disk layout for a 4K-sector size and use an alignment offset on modern devices for MBR and GPT. It is always a good idea to follow *fdisk*'s defaults as the default values (e.g., first and last partition sectors) and partition sizes specified by the +/-<size>{M,G,...} notation are always aligned according to the device properties.
CHS (Cylinder-Head-Sector) addressing is deprecated and not used by default. Please, do not follow old articles and recommendations with *fdisk -S <n> -H <n>* advices for SSD or 4K-sector devices.
Note that *partx*(8) provides a rich interface for scripts to print disk layouts, *fdisk* is mostly designed for humans. Backward compatibility in the output of *fdisk* is not guaranteed. The input (the commands) should always be backward compatible.
== OPTIONS
*-b*, *--sector-size* _sectorsize_::
Specify the sector size of the disk. Valid values are 512, 1024, 2048, and 4096. (Recent kernels know the sector size. Use this option only on old kernels or to override the kernel's ideas.) Since util-linux-2.17, *fdisk* differentiates between logical and physical sector size. This option changes both sector sizes to _sectorsize_.
*-B*, *--protect-boot*::
Don't erase the beginning of the first disk sector when creating a new disk label. This feature is supported for GPT and MBR.
*-c*, *--compatibility*[=_mode_]::
Specify the compatibility mode, 'dos' or 'nondos'. The default is non-DOS mode. For backward compatibility, it is possible to use the option without the _mode_ argument -- then the default is used. Note that the optional _mode_ argument cannot be separated from the *-c* option by a space, the correct form is for example '-c=dos'.
*-h*, *--help*::
Display a help text and exit.
*-L*, *--color*[=_when_]::
Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled; for the current built-in default see the *--help* output. See also the *COLORS* section.
*-l*, *--list*::
List the partition tables for the specified devices and then exit. +
If no devices are given, the devices mentioned in _/proc/partitions_ (if this file exists) are used. Devices are always listed in the order in which they are specified on the command-line, or by the kernel listed in _/proc/partitions_.
*-x*, *--list-details*::
Like *--list*, but provides more details.
*--lock*[=_mode_]::
Use exclusive BSD lock for device or file it operates. The optional argument _mode_ can be *yes*, *no* (or 1 and 0) or *nonblock*. If the _mode_ argument is omitted, it defaults to *"yes"*. This option overwrites environment variable *$LOCK_BLOCK_DEVICE*. The default is not to use any lock at all, but it's recommended to avoid collisions with udevd or other tools.
*-n*, *--noauto-pt*::
Don't automatically create a default partition table on empty device. The partition table has to be explicitly created by user (by command like 'o', 'g', etc.).
*-o*, *--output* _list_::
Specify which output columns to print. Use *--help* to get a list of all supported columns. +
The default list of columns may be extended if _list_ is specified in the format _+list_ (e.g., *-o +UUID*).
*-s*, *--getsz*::
Print the size in 512-byte sectors of each given block device. This option is DEPRECATED in favour of *blockdev*(8).
*-t*, *--type* _type_::
Enable support only for disklabels of the specified _type_, and disable support for all other types.
*-u*, *--units*[=_unit_]::
When listing partition tables, show sizes in 'sectors' or in 'cylinders'. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the _unit_ argument -- then the default is used. Note that the optional _unit_ argument cannot be separated from the *-u* option by a space, the correct form is for example '*-u=*_cylinders_'.
*-C*, *--cylinders* _number_::
Specify the number of cylinders of the disk. I have no idea why anybody would want to do so.
*-H*, *--heads* _number_::
Specify the number of heads of the disk. (Not the physical number, of course, but the number used for partition tables.) Reasonable values are 255 and 16.
*-S*, *--sectors* _number_::
Specify the number of sectors per track of the disk. (Not the physical number, of course, but the number used for partition tables.) A reasonable value is 63.
*-w*, *--wipe* _when_::
Wipe filesystem, RAID and partition-table signatures from the device, in order to avoid possible collisions. The argument _when_ can be *auto*, *never* or *always*. When this option is not given, the default is *auto*, in which case signatures are wiped only when in interactive mode. In all cases detected signatures are reported by warning messages before a new partition table is created. See also *wipefs*(8) command.
*-W*, *--wipe-partitions* _when_::
Wipe filesystem, RAID and partition-table signatures from a newly created partitions, in order to avoid possible collisions. The argument _when_ can be *auto*, *never* or *always*. When this option is not given, the default is *auto*, in which case signatures are wiped only when in interactive mode and after confirmation by user. In all cases detected signatures are reported by warning messages before a new partition is created. See also *wipefs*(8) command.
*-V*, *--version*::
Display version information and exit.
== DEVICES
The _device_ is usually _/dev/sda_, _/dev/sdb_ or so. A device name refers to the entire disk. Old systems without libata (a library used inside the Linux kernel to support ATA host controllers and devices) make a difference between IDE and SCSI disks. In such cases the device name will be _/dev/hd*_ (IDE) or _/dev/sd*_ (SCSI).
The _partition_ is a device name followed by a partition number. For example, _/dev/sda1_ is the first partition on the first hard disk in the system. See also Linux kernel documentation (the _Documentation/admin-guide/devices.txt_ file).
== SIZES
The "last sector" dialog accepts partition size specified by number of sectors or by +/-<size>{K,B,M,G,...} notation.
If the size is prefixed by '+' then it is interpreted as relative to the partition first sector. If the size is prefixed by '-' then it is interpreted as relative to the high limit (last available sector for the partition).
In the case the size is specified in bytes than the number may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB. The "iB" is optional, e.g., "K" has the same meaning as "KiB".
The relative sizes are always aligned according to device I/O limits. The +/-<size>{K,B,M,G,...} notation is recommended.
For backward compatibility fdisk also accepts the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes are deprecated.
== SCRIPT FILES
*fdisk* allows reading (by 'I' command) *sfdisk*(8) compatible script files. The script is applied to in-memory partition table, and then it is possible to modify the partition table before you write it to the device.
And vice-versa it is possible to write the current in-memory disk layout to the script file by command 'O'.
The script files are compatible between *cfdisk*(8), *sfdisk*(8), *fdisk* and other libfdisk applications. For more details see *sfdisk*(8).
== DISK LABELS
*GPT (GUID Partition Table)*
____
GPT is modern standard for the layout of the partition table. GPT uses 64-bit logical block addresses, checksums, UUIDs and names for partitions and an unlimited number of partitions (although the number of partitions is usually restricted to 128 in many partitioning tools).
Note that the first sector is still reserved for a *protective MBR* in the GPT specification. It prevents MBR-only partitioning tools from mis-recognizing and overwriting GPT disks.
GPT is always a better choice than MBR, especially on modern hardware with a UEFI boot loader.
____
*DOS-type (MBR)*
____
A DOS-type partition table can describe an unlimited number of partitions. In sector 0 there is room for the description of 4 partitions (called `primary'). One of these may be an extended partition; this is a box holding logical partitions, with descriptors found in a linked list of sectors, each preceding the corresponding logical partitions. The four primary partitions, present or not, get numbers 1-4. Logical partitions are numbered starting from 5.
In a DOS-type partition table the starting offset and the size of each partition is stored in two ways: as an absolute number of sectors (given in 32 bits), and as a *Cylinders/Heads/Sectors* triple (given in 10+8+6 bits). The former is OK -- with 512-byte sectors this will work up to 2 TB. The latter has two problems. First, these C/H/S fields can be filled only when the number of heads and the number of sectors per track are known. And second, even if we know what these numbers should be, the 24 bits that are available do not suffice. DOS uses C/H/S only, Windows uses both, Linux never uses C/H/S. The *C/H/S addressing is deprecated* and may be unsupported in some later *fdisk* version.
*Please, read the DOS-mode section if you want DOS-compatible partitions.* *fdisk* does not care about cylinder boundaries by default.
____
*BSD/Sun-type*
____
A BSD/Sun disklabel can describe 8 partitions, the third of which should be a `whole disk' partition. Do not start a partition that actually uses its first sector (like a swap partition) at cylinder 0, since that will destroy the disklabel. Note that a *BSD label* is usually nested within a DOS partition.
____
*IRIX/SGI-type*
____
An IRIX/SGI disklabel can describe 16 partitions, the eleventh of which should be an entire `volume' partition, while the ninth should be labeled `volume header'. The volume header will also cover the partition table, i.e., it starts at block zero and extends by default over five cylinders. The remaining space in the volume header may be used by header directory entries. No partitions may overlap with the volume header. Also do not change its type or make some filesystem on it, since you will lose the partition table. Use this type of label only when working with Linux on IRIX/SGI machines or IRIX/SGI disks under Linux.
____
A sync() and an ioctl(BLKRRPART) (rereading the partition table from disk) are performed before exiting when the partition table has been updated.
== DOS mode and DOS 6.x WARNING
*Note that all this is deprecated. You don't have to care about things like* *geometry and cylinders on modern operating systems. If you really want* *DOS-compatible partitioning then you have to enable DOS mode and cylinder* *units by using the '-c=dos -u=cylinders' fdisk command-line options.*
The DOS 6.x FORMAT command looks for some information in the first sector of the data area of the partition, and treats this information as more reliable than the information in the partition table. DOS FORMAT expects DOS FDISK to clear the first 512 bytes of the data area of a partition whenever a size change occurs. DOS FORMAT will look at this extra information even if the /U flag is given -- we consider this a bug in DOS FORMAT and DOS FDISK.
The bottom line is that if you use *fdisk* or *cfdisk* to change the size of a DOS partition table entry, then you must also use *dd*(1) to *zero the first 512 bytes* of that partition before using DOS FORMAT to format the partition. For example, if you were using *fdisk* to make a DOS partition table entry for _/dev/sda1_, then (after exiting *fdisk* and rebooting Linux so that the partition table information is valid) you would use the command *dd if=/dev/zero of=/dev/sda1 bs=512 count=1* to zero the first 512 bytes of the partition.
*fdisk* usually obtains the disk geometry automatically. This is not necessarily the physical disk geometry (indeed, modern disks do not really have anything like a physical geometry, certainly not something that can be described in the simplistic Cylinders/Heads/Sectors form), but it is the disk geometry that MS-DOS uses for the partition table.
Usually all goes well by default, and there are no problems if Linux is the only system on the disk. However, if the disk has to be shared with other operating systems, it is often a good idea to let an fdisk from another operating system make at least one partition. When Linux boots it looks at the partition table, and tries to deduce what (fake) geometry is required for good cooperation with other systems.
Whenever a partition table is printed out in DOS mode, a consistency check is performed on the partition table entries. This check verifies that the physical and logical start and end points are identical, and that each partition starts and ends on a cylinder boundary (except for the first partition).
Some versions of MS-DOS create a first partition which does not begin on a cylinder boundary, but on sector 2 of the first cylinder. Partitions beginning in cylinder 1 cannot begin on a cylinder boundary, but this is unlikely to cause difficulty unless you have OS/2 on your machine.
For best results, you should always use an OS-specific partition table program. For example, you should make DOS partitions with the DOS FDISK program and Linux partitions with the Linux fdisk or Linux cfdisk programs.
== COLORS
Implicit coloring can be disabled by an empty file _/etc/terminal-colors.d/fdisk.disable_.
See *terminal-colors.d*(5) for more details about colorization configuration. The logical color names supported by *fdisk* are:
*header*::
The header of the output tables.
*help-title*::
The help section titles.
*warn*::
The warning messages.
*welcome*::
The welcome message.
== ENVIRONMENT
*FDISK_DEBUG*=all::
enables fdisk debug output.
*LIBFDISK_DEBUG*=all::
enables libfdisk debug output.
*LIBBLKID_DEBUG*=all::
enables libblkid debug output.
*LIBSMARTCOLS_DEBUG*=all::
enables libsmartcols debug output.
*LIBSMARTCOLS_DEBUG_PADDING*=on::
use visible padding characters. Requires enabled *LIBSMARTCOLS_DEBUG*.
*LOCK_BLOCK_DEVICE*=<mode>::
use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
== AUTHORS
mailto:kzak@redhat.com[Karel Zak] +
mailto:dave@gnu.org[Davidlohr Bueso]
The original version was written by Andries E. Brouwer, A. V. Le Blanc and others.
== SEE ALSO
*cfdisk*(8),
*mkfs*(8),
*partx*(8),
*sfdisk*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

169
disk-utils/fsck.8.adoc Normal file
View File

@ -0,0 +1,169 @@
////
Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
This file may be copied under the terms of the GNU Public License.
////
= fsck(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: fsck
== NAME
fsck - check and repair a Linux filesystem
== SYNOPSIS
*fsck* [*-lsAVRTMNP*] [*-r* [_fd_]] [*-C* [_fd_] [*-t* _fstype_] [_filesystem_...] [*--*] [_fs-specific-options_]
== DESCRIPTION
*fsck* is used to check and optionally repair one or more Linux filesystems. _filesystem_ can be a device name (e.g., _/dev/hdc1_, _/dev/sdb2_), a mount point (e.g., _/_, _/usr_, _/home_), or an filesystem label or UUID specifier (e.g., UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Normally, the *fsck* program will try to handle filesystems on different physical disk drives in parallel to reduce the total amount of time needed to check all of them.
If no filesystems are specified on the command line, and the *-A* option is not specified, *fsck* will default to checking filesystems in _/etc/fstab_ serially. This is equivalent to the *-As* options.
The exit status returned by *fsck* is the sum of the following conditions:
____
*0*::
No errors
*1*::
Filesystem errors corrected
*2*::
System should be rebooted
*4*::
Filesystem errors left uncorrected
*8*::
Operational error
*16*::
Usage or syntax error
*32*::
Checking canceled by user request
*128*::
Shared-library error
____
The exit status returned when multiple filesystems are checked is the bit-wise OR of the exit statuses for each filesystem that is checked.
In actuality, *fsck* is simply a front-end for the various filesystem checkers (*fsck*._fstype_) available under Linux. The filesystem-specific checker is searched for in the *PATH* environment variable. If the *PATH* is undefined then fallback to _/sbin_.
Please see the filesystem-specific checker manual pages for further details.
== OPTIONS
*-l*::
Create an exclusive *flock*(2) lock file (_/run/fsck/<diskname>.lock_) for whole-disk device. This option can be used with one device only (this means that *-A* and *-l* are mutually exclusive). This option is recommended when more *fsck* instances are executed in the same time. The option is ignored when used for multiple devices or for non-rotating disks. *fsck* does not lock underlying devices when executed to check stacked devices (e.g. MD or DM) NDASH this feature is not implemented yet.
*-r* [****__fd__]::
Report certain statistics for each fsck when it completes. These statistics include the exit status, the maximum run set size (in kilobytes), the elapsed all-clock time and the user and system CPU time used by the fsck run. For example: +
*/dev/sda1: status 0, rss 92828, real 4.002804, user 2.677592, sys 0.86186* +
GUI front-ends may specify a file descriptor _fd_, in which case the progress bar information will be sent to that file descriptor in a machine parsable format. For example: +
*/dev/sda1 0 92828 4.002804 2.677592 0.86186*
*-s*::
Serialize *fsck* operations. This is a good idea if you are checking multiple filesystems and the checkers are in an interactive mode. (Note: *e2fsck*(8) runs in an interactive mode by default. To make *e2fsck*(8) run in a non-interactive mode, you must either specify the *-p* or *-a* option, if you wish for errors to be corrected automatically, or the *-n* option if you do not.)
*-t* _fslist_::
Specifies the type(s) of filesystem to be checked. When the *-A* flag is specified, only filesystems that match _fslist_ are checked. The _fslist_ parameter is a comma-separated list of filesystems and options specifiers. All of the filesystems in this comma-separated list may be prefixed by a negation operator '*no*' or '*!*', which requests that only those filesystems not listed in _fslist_ will be checked. If none of the filesystems in _fslist_ is prefixed by a negation operator, then only those listed filesystems will be checked. +
Options specifiers may be included in the comma-separated _fslist_. They must have the format **opts=**__fs-option__. If an options specifier is present, then only filesystems which contain _fs-option_ in their mount options field of _/etc/fstab_ will be checked. If the options specifier is prefixed by a negation operator, then only those filesystems that do not have _fs-option_ in their mount options field of _/etc/fstab_ will be checked. +
For example, if *opts=ro* appears in _fslist_, then only filesystems listed in _/etc/fstab_ with the *ro* option will be checked. +
For compatibility with Mandrake distributions whose boot scripts depend upon an unauthorized UI change to the *fsck* program, if a filesystem type of *loop* is found in _fslist_, it is treated as if *opts=loop* were specified as an argument to the *-t* option. +
Normally, the filesystem type is deduced by searching for _filesys_ in the _/etc/fstab_ file and using the corresponding entry. If the type cannot be deduced, and there is only a single filesystem given as an argument to the *-t* option, *fsck* will use the specified filesystem type. If this type is not available, then the default filesystem type (currently ext2) is used.
*-A*::
Walk through the _/etc/fstab_ file and try to check all filesystems in one run. This option is typically used from the _/etc/rc_ system initialization file, instead of multiple commands for checking a single filesystem. +
The root filesystem will be checked first unless the *-P* option is specified (see below). After that, filesystems will be checked in the order specified by the _fs_passno_ (the sixth) field in the _/etc/fstab_ file. Filesystems with a _fs_passno_ value of 0 are skipped and are not checked at all. Filesystems with a _fs_passno_ value of greater than zero will be checked in order, with filesystems with the lowest _fs_passno_ number being checked first. If there are multiple filesystems with the same pass number, *fsck* will attempt to check them in parallel, although it will avoid running multiple filesystem checks on the same physical disk. +
*fsck* does not check stacked devices (RAIDs, dm-crypt, ...) in parallel with any other device. See below for *FSCK_FORCE_ALL_PARALLEL* setting. The _/sys_ filesystem is used to determine dependencies between devices. +
Hence, a very common configuration in _/etc/fstab_ files is to set the root filesystem to have a _fs_passno_ value of 1 and to set all other filesystems to have a _fs_passno_ value of 2. This will allow *fsck* to automatically run filesystem checkers in parallel if it is advantageous to do so. System administrators might choose not to use this configuration if they need to avoid multiple filesystem checks running in parallel for some reason - for example, if the machine in question is short on memory so that excessive paging is a concern. +
*fsck* normally does not check whether the device actually exists before calling a filesystem specific checker. Therefore non-existing devices may cause the system to enter filesystem repair mode during boot if the filesystem specific checker returns a fatal error. The _/etc/fstab_ mount option *nofail* may be used to have *fsck* skip non-existing devices. *fsck* also skips non-existing devices that have the special filesystem type *auto*.
*-C* [****__fd__]::
Display completion/progress bars for those filesystem checkers (currently only for ext[234]) which support them. *fsck* will manage the filesystem checkers so that only one of them will display a progress bar at a time. GUI front-ends may specify a file descriptor _fd_, in which case the progress bar information will be sent to that file descriptor.
*-M*::
Do not check mounted filesystems and return an exit status of 0 for mounted filesystems.
*-N*::
Don't execute, just show what would be done.
*-P*::
When the *-A* flag is set, check the root filesystem in parallel with the other filesystems. This is not the safest thing in the world to do, since if the root filesystem is in doubt things like the *e2fsck*(8) executable might be corrupted! This option is mainly provided for those sysadmins who don't want to repartition the root filesystem to be small and compact (which is really the right solution).
*-R*::
When checking all filesystems with the *-A* flag, skip the root filesystem. (This is useful in case the root filesystem has already been mounted read-write.)
*-T*::
Don't show the title on startup.
*-V*::
Produce verbose output, including all filesystem-specific commands that are executed.
*-?*, *--help*::
Display help text and exit.
*--version*::
Display version information and exit.
== FILESYSTEM SPECIFIC OPTIONS
*Options which are not understood by fsck are passed to the filesystem-specific checker!*
These options *must* not take arguments, as there is no way for *fsck* to be able to properly guess which options take arguments and which don't.
Options and arguments which follow the *--* are treated as filesystem-specific options to be passed to the filesystem-specific checker.
Please note that *fsck* is not designed to pass arbitrarily complicated options to filesystem-specific checkers. If you're doing something complicated, please just execute the filesystem-specific checker directly. If you pass *fsck* some horribly complicated options and arguments, and it doesn't do what you expect, *don't bother reporting it as a bug.* You're almost certainly doing something that you shouldn't be doing with *fsck*. Options to different filesystem-specific fsck's are not standardized.
== ENVIRONMENT
The *fsck* program's behavior is affected by the following environment variables:
*FSCK_FORCE_ALL_PARALLEL*::
If this environment variable is set, *fsck* will attempt to check all of the specified filesystems in parallel, regardless of whether the filesystems appear to be on the same device. (This is useful for RAID systems or high-end storage systems such as those sold by companies such as IBM or EMC.) Note that the _fs_passno_ value is still used.
*FSCK_MAX_INST*::
This environment variable will limit the maximum number of filesystem checkers that can be running at one time. This allows configurations which have a large number of disks to avoid *fsck* starting too many filesystem checkers at once, which might overload CPU and memory resources available on the system. If this value is zero, then an unlimited number of processes can be spawned. This is currently the default, but future versions of *fsck* may attempt to automatically determine how many filesystem checks can be run based on gathering accounting data from the operating system.
*PATH*::
The *PATH* environment variable is used to find filesystem checkers.
*FSTAB_FILE*::
This environment variable allows the system administrator to override the standard location of the _/etc/fstab_ file. It is also useful for developers who are testing *fsck*.
*LIBBLKID_DEBUG=all*::
enables libblkid debug output.
*LIBMOUNT_DEBUG=all*::
enables libmount debug output.
== FILES
_/etc/fstab_
== AUTHORS
mailto:tytso@mit.edu>[Theodore Ts'o]
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO
*fstab*(5),
*mkfs*(8),
*fsck.ext2*(8) or *fsck.ext3*(8) or *e2fsck*(8),
*fsck.cramfs*(8),
*fsck.jfs*(8),
*fsck.nfs*(8),
*fsck.minix*(8),
*fsck.msdos*(8),
*fsck.vfat*(8),
*fsck.xfs*(8),
*reiserfsck*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,67 @@
= fsck.cramfs(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: fsck.cramfs
== NAME
fsck.cramfs - fsck compressed ROM file system
== SYNOPSIS
*fsck.cramfs* [_options_] _file_
== DESCRIPTION
*fsck.cramfs* is used to check the cramfs file system.
== OPTIONS
*-v*, *--verbose*::
Enable verbose messaging.
*-b*, *--blocksize* _blocksize_::
Use this blocksize, defaults to page size. Must be equal to what was set at creation time. Only used for *--extract*.
*--extract*[=_directory_]::
Test to uncompress the whole file system. Optionally extract contents of the _file_ to _directory_.
*-a*::
This option is silently ignored.
*-y*::
This option is silently ignored.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== EXIT STATUS
____
*0*::
success
*4*::
file system was left uncorrected
*8*::
operation error, such as unable to allocate memory
*16*::
usage information was printed
____
== SEE ALSO
*mount*(8),
*mkfs.cramfs*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,117 @@
////
Copyright 1992, 1993, 1994 Rickard E. Faith (faith@cs.unc.edu)
May be freely distributed.
////
= fsck.minix(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: fsck.minix
== NAME
fsck.minix - check consistency of Minix filesystem
== SYNOPSIS
*fsck.minix* [_options_] _device_
== DESCRIPTION
*fsck.minix* performs a consistency check for the Linux MINIX filesystem.
The program assumes the filesystem is quiescent. *fsck.minix* should not be used on a mounted device unless you can be sure nobody is writing to it. Remember that the kernel can write to device when it searches for files.
The _device_ name will usually have the following form:
____
[cols=",",]
|===
|/dev/hda[1-63] |IDE disk 1
|/dev/hdb[1-63] |IDE disk 2
|/dev/sda[1-15] |SCSI disk 1
|/dev/sdb[1-15] |SCSI disk 2
|===
____
If the filesystem was changed, i.e., repaired, then *fsck.minix* will print "FILE SYSTEM HAS CHANGED" and will *sync*(2) three times before exiting. There is _no_ need to reboot after check.
== WARNING
*fsck.minix* should *not* be used on a mounted filesystem. Using *fsck.minix* on a mounted filesystem is very dangerous, due to the possibility that deleted files are still in use, and can seriously damage a perfectly good filesystem! If you absolutely have to run *fsck.minix* on a mounted filesystem, such as the root filesystem, make sure nothing is writing to the disk, and that no files are "zombies" waiting for deletion.
== OPTIONS
*-l*, *--list*::
List all filenames.
*-r*, *--repair*::
Perform interactive repairs.
*-a*, *--auto*::
Perform automatic repairs. This option implies *--repair* and serves to answer all of the questions asked with the default. Note that this can be extremely dangerous in the case of extensive filesystem damage.
*-v*, *--verbose*::
Be verbose.
*-s*, *--super*::
Output super-block information.
*-m*, *--uncleared*::
Activate MINIX-like "mode not cleared" warnings.
*-f*, *--force*::
Force a filesystem check even if the filesystem was marked as valid. Marking is done by the kernel when the filesystem is unmounted.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== DIAGNOSTICS
There are numerous diagnostic messages. The ones mentioned here are the most commonly seen in normal usage.
If the device does not exist, *fsck.minix* will print "unable to read super block". If the device exists, but is not a MINIX filesystem, *fsck.minix* will print "bad magic number in super-block".
== EXIT STATUS
The exit status returned by *fsck.minix* is the sum of the following:
____
*0*::
No errors
*3*::
Filesystem errors corrected, system should be rebooted if filesystem was mounted
*4*::
Filesystem errors left uncorrected
*7*::
Combination of exit statuses 3 and 4
*8*::
Operational error
*16*::
Usage or syntax error
____
== AUTHORS
mailto:torvalds@cs.helsinki.fi[Linus Torvalds]. Exit status values by mailto:faith@cs.unc.edu[Rik Faith] Added support for filesystem valid flag: mailto:greg%wind.uucp@plains.nodak.edu[Dr. Wettstein]. Check to prevent fsck of mounted filesystem added by mailto:quinlan@yggdrasil.com[Daniel Quinlan]. Minix v2 fs support by mailto:schwab@issan.informatik.uni-dortmund.de[Andreas Schwab], updated by mailto:janl@math.uio.no[Nicolai Langfeldt]. Portability patch by mailto:rmk@ecs.soton.ac.uk[Russell King].
== SEE ALSO
*fsck*(8),
*fsck.ext2*(8),
*mkfs*(8),
*mkfs.ext2*(8),
*mkfs.minix*(8),
*reboot*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

49
disk-utils/isosize.8.adoc Normal file
View File

@ -0,0 +1,49 @@
= isosize(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: isosize
== NAME
isosize - output the length of an iso9660 filesystem
== SYNOPSIS
*isosize* [_options_] _iso9660_image_file_
== DESCRIPTION
This command outputs the length of an iso9660 filesystem that is contained in the specified file. This file may be a normal file or a block device (e.g. _/dev/hdd_ or _/dev/sr0_). In the absence of any options (and errors), it will output the size of the iso9660 filesystem in bytes. This can now be a large number (>> 4 GB).
== OPTIONS
*-x*, *--sectors*::
Show the block count and block size in human-readable form. The output uses the term "sectors" for "blocks".
*-d*, *--divisor* _number_::
Only has an effect when *-x* is not given. The value shown (if no errors) is the iso9660 file size in bytes divided by _number_. So if _number_ is the block size then the shown value will be the block count.
The size of the file (or block device) holding an iso9660 filesystem can be marginally larger than the actual size of the iso9660 filesystem. One reason for this is that cd writers are allowed to add "run out" sectors at the end of an iso9660 image.
== EXIT STATUS
____
*0*::
success
*1*::
generic failure, such as invalid usage
*32*::
all failed
*64*::
some failed
____
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

76
disk-utils/mkfs.8.adoc Normal file
View File

@ -0,0 +1,76 @@
= mkfs(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: mkfs
== NAME
mkfs - build a Linux filesystem
== SYNOPSIS
*mkfs* [_options_] [*-t* _type_] [_fs-options_] _device_ [_size_]
== DESCRIPTION
*This mkfs frontend is deprecated in favour of filesystem specific mkfs.<type> utils.*
*mkfs* is used to build a Linux filesystem on a device, usually a hard disk partition. The _device_ argument is either the device name (e.g., _/dev/hda1_, _/dev/sdb2_), or a regular file that shall contain the filesystem. The _size_ argument is the number of blocks to be used for the filesystem.
The exit status returned by *mkfs* is 0 on success and 1 on failure.
In actuality, *mkfs* is simply a front-end for the various filesystem builders (**mkfs.**__fstype__) available under Linux. The filesystem-specific builder is searched for via your *PATH* environment setting only. Please see the filesystem-specific builder manual pages for further details.
== OPTIONS
*-t*, *--type* _type_::
Specify the _type_ of filesystem to be built. If not specified, the default filesystem type (currently ext2) is used.
_fs-options_::
Filesystem-specific options to be passed to the real filesystem builder.
*-V*, *--verbose*::
Produce verbose output, including all filesystem-specific commands that are executed. Specifying this option more than once inhibits execution of any filesystem-specific commands. This is really only useful for testing.
*-V*, *--version*::
Display version information and exit. (Option *-V* will display version information only when it is the only parameter, otherwise it will work as *--verbose*.)
*-h*, *--help*::
Display help text and exit.
== BUGS
All generic options must precede and not be combined with filesystem-specific options. Some filesystem-specific programs do not automatically detect the device size and require the _size_ parameter to be specified.
== AUTHORS
mailto:david@ods.com[David Engel] +
mailto:waltje@uwalt.nl.mugnet.org[Fred N. van Kempen] +
mailto:sommel@sci.kun.nl[Ron Sommeling] +
The manual page was shamelessly adapted from Remy Card's version for the ext2 filesystem.
== SEE ALSO
*fs*(5),
*badblocks*(8),
*fsck*(8),
*mkdosfs*(8),
*mke2fs*(8),
*mkfs.bfs*(8),
*mkfs.ext2*(8),
*mkfs.ext3*(8),
*mkfs.ext4*(8),
*mkfs.minix*(8),
*mkfs.msdos*(8),
*mkfs.vfat*(8),
*mkfs.xfs*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,66 @@
////
Copyright 1999 Andries E. Brouwer (aeb@cwi.nl)
May be freely distributed.
////
= mkfs.bfs(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: mkfs.bfs
== NAME
mkfs.bfs - make an SCO bfs filesystem
== SYNOPSIS
*mkfs.bfs* [_options_] _device_ [_block-count_]
== DESCRIPTION
*mkfs.bfs* creates an SCO bfs filesystem on a block device (usually a disk partition or a file accessed via the loop device).
The _block-count_ parameter is the desired size of the filesystem, in blocks. If nothing is specified, the entire partition will be used.
== OPTIONS
*-N*, *--inodes* _number_::
Specify the desired _number_ of inodes (at most 512). If nothing is specified, some default number in the range 48-512 is picked depending on the size of the partition.
*-V*, *--vname* _label_::
Specify the volume _label_. I have no idea if/where this is used.
*-F*, *--fname* _name_::
Specify the filesystem _name_. I have no idea if/where this is used.
*-v*, *--verbose*::
Explain what is being done.
*-c*::
This option is silently ignored.
*-l*::
This option is silently ignored.
*-h*, *--help*::
Display help text and exit.
*-V*, *--version*::
Display version information and exit. Option *-V* only works as *--version* when it is the only option.
== EXIT STATUS
The exit status returned by *mkfs.bfs* is 0 when all went well, and 1 when something went wrong.
== SEE ALSO
*mkfs*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,90 @@
= mkfs.cramfs(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: mkfs.cramfs
== NAME
mkfs.cramfs - make compressed ROM file system
== SYNOPSIS
*mkfs.cramfs* [_options_] _directory file_
== DESCRIPTION
Files on cramfs file systems are zlib-compressed one page at a time to allow random read access. The metadata is not compressed, but is expressed in a terse representation that is more space-efficient than conventional file systems.
The file system is intentionally read-only to simplify its design; random write access for compressed files is difficult to implement. cramfs ships with a utility (*mkcramfs*(8)) to pack files into new cramfs images.
File sizes are limited to less than 16 MB.
Maximum file system size is a little under 272 MB. (The last file on the file system must begin before the 256 MB block, but can extend past it.)
== ARGUMENTS
The _directory_ is simply the root of the directory tree that we want to generate a compressed filesystem out of.
The _file_ will contain the cram file system, which later can be mounted.
== OPTIONS
*-v*::
Enable verbose messaging.
*-E*::
Treat all warnings as errors, which are reflected as command exit status.
*-b* _blocksize_::
Use defined block size, which has to be divisible by page size.
*-e* _edition_::
Use defined file system edition number in superblock.
*-N* _big, little, host_::
Use defined endianness. Value defaults to _host_.
*-i* _file_::
Insert a _file_ to cramfs file system.
*-n* _name_::
Set name of the cramfs file system.
*-p*::
Pad by 512 bytes for boot code.
*-s*::
This option is ignored. Originally the *-s* turned on directory entry sorting.
*-z*::
Make explicit holes.
*-h*, *--help*::
Display help text and exit.
*-V*, *--version*::
Display version information and exit.
== EXIT STATUS
____
*0*::
success
*8*::
operation error, such as unable to allocate memory
____
== SEE ALSO
*fsck.cramfs*(8),
*mount*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,100 @@
////
Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
Copyright 2012 Davidlohr Bueso <dave@gnu.org>
Copyright (C) 2013 Karel Zak <kzak@redhat.com>
May be distributed under the GNU General Public License
////
= mkfs.minix(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: mkfs.minix
== NAME
mkfs.minix - make a Minix filesystem
== SYNOPSIS
*mkfs.minix* [_options_] _device_ [_size-in-blocks_]
== DESCRIPTION
*mkfs.minix* creates a Linux MINIX filesystem on a device (usually a disk partition).
The _device_ is usually of the following form:
....
/dev/hda[1-8] (IDE disk 1)
/dev/hdb[1-8] (IDE disk 2)
/dev/sda[1-8] (SCSI disk 1)
/dev/sdb[1-8] (SCSI disk 2)
....
The device may be a block device or an image file of one, but this is not enforced. Expect not much fun on a character device :-).
The _size-in-blocks_ parameter is the desired size of the file system, in blocks. It is present only for backwards compatibility. If omitted the size will be determined automatically. Only block counts strictly greater than 10 and strictly less than 65536 are allowed.
== OPTIONS
*-c*, *--check*::
Check the device for bad blocks before creating the filesystem. If any are found, the count is printed.
*-n*, *--namelength* _length_::
Specify the maximum length of filenames. Currently, the only allowable values are 14 and 30 for file system versions 1 and 2. Version 3 allows only value 60. The default is 30.
*--lock*[=_mode_]::
Use exclusive BSD lock for device or file it operates. The optional argument _mode_ can be *yes*, *no* (or 1 and 0) or *nonblock*. If the _mode_ argument is omitted, it defaults to *"yes"*. This option overwrites environment variable *$LOCK_BLOCK_DEVICE*. The default is not to use any lock at all, but it's recommended to avoid collisions with udevd or other tools.
*-i*, *--inodes* _number_::
Specify the number of inodes for the filesystem.
*-l*, *--badblocks* _filename_::
Read the list of bad blocks from _filename_. The file has one bad-block number per line. The count of bad blocks read is printed.
*-1*::
Make a Minix version 1 filesystem. This is the default.
*-2*, *-v*::
Make a Minix version 2 filesystem.
*-3*::
Make a Minix version 3 filesystem.
*-V*, *--version*::
Display version information and exit. The long option cannot be combined with other options.
*-h*, *--help*::
Display help text and exit.
== ENVIRONMENT
LOCK_BLOCK_DEVICE=<mode>::
use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
== EXIT STATUS
The exit status returned by *mkfs.minix* is one of the following:
0::
No errors
8::
Operational error
16::
Usage or syntax error
== SEE ALSO
*fsck*(8),
*mkfs*(8),
*reboot*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

112
disk-utils/mkswap.8.adoc Normal file
View File

@ -0,0 +1,112 @@
////
Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
May be distributed under the GNU General Public License
////
= mkswap(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: mkswap
== NAME
mkswap - set up a Linux swap area
== SYNOPSIS
*mkswap* [_options_] _device_ [_size_]
== DESCRIPTION
*mkswap* sets up a Linux swap area on a device or in a file.
The _device_ argument will usually be a disk partition (something like _/dev/sdb7_) but can also be a file. The Linux kernel does not look at partition IDs, but many installation scripts will assume that partitions of hex type 82 (LINUX_SWAP) are meant to be swap partitions. (*Warning: Solaris also uses this type. Be careful not to kill your Solaris partitions.*)
The _size_ parameter is superfluous but retained for backwards compatibility. (It specifies the desired size of the swap area in 1024-byte blocks. *mkswap* will use the entire partition or file if it is omitted. Specifying it is unwise - a typo may destroy your disk.)
After creating the swap area, you need the *swapon* command to start using it. Usually swap areas are listed in _/etc/fstab_ so that they can be taken into use at boot time by a *swapon -a* command in some boot script.
== WARNING
The swap header does not touch the first block. A boot loader or disk label can be there, but it is not a recommended setup. The recommended setup is to use a separate partition for a Linux swap area.
*mkswap*, like many others mkfs-like utils, *erases the first partition block to make any previous filesystem invisible.*
However, *mkswap* refuses to erase the first block on a device with a disk label (SUN, BSD, ...).
== OPTIONS
*-c*, *--check*::
Check the device (if it is a block device) for bad blocks before creating the swap area. If any bad blocks are found, the count is printed.
*-f*, *--force*::
Go ahead even if the command is stupid. This allows the creation of a swap area larger than the file or partition it resides on. +
Also, without this option, *mkswap* will refuse to erase the first block on a device with a partition table.
*-L*, *--label* _label_::
Specify a _label_ for the device, to allow *swapon* by label.
*--lock*[=_mode_]::
Use exclusive BSD lock for device or file it operates. The optional argument _mode_ can be *yes*, *no* (or 1 and 0) or *nonblock*. If the _mode_ argument is omitted, it defaults to *"yes"*. This option overwrites environment variable *$LOCK_BLOCK_DEVICE*. The default is not to use any lock at all, but it's recommended to avoid collisions with udevd or other tools.
*-p*, *--pagesize* _size_::
Specify the page _size_ (in bytes) to use. This option is usually unnecessary; *mkswap* reads the size from the kernel.
*-U*, *--uuid* _UUID_::
Specify the _UUID_ to use. The default is to generate a UUID.
*-v*, *--swapversion 1*::
Specify the swap-space version. (This option is currently pointless, as the old *-v 0* option has become obsolete and now only *-v 1* is supported. The kernel has not supported v0 swap-space format since 2.5.22 (June 2002). The new version v1 is supported since 2.1.117 (August 1998).)
*--verbose*::
Verbose execution. With this option *mkswap* will output more details about detected problems during swap area set up.
*-h*, *--help*::
Display help text and exit.
*-V*, *--version*::
Display version information and exit.
== ENVIRONMENT
LIBBLKID_DEBUG=all::
enables libblkid debug output.
LOCK_BLOCK_DEVICE=<mode>::
use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
== NOTES
The maximum useful size of a swap area depends on the architecture and the kernel version.
The maximum number of the pages that is possible to address by swap area header is 4294967295 (32-bit unsigned int). The remaining space on the swap device is ignored.
Presently, Linux allows 32 swap areas. The areas in use can be seen in the file _/proc/swaps_.
*mkswap* refuses areas smaller than 10 pages.
If you don't know the page size that your machine uses, you may be able to look it up with "cat /proc/cpuinfo" (or you may not NDASH the contents of this file depend on architecture and kernel version).
To set up a swap file, it is necessary to create that file before initializing it with *mkswap*, e.g. using a command like
....
# dd if=/dev/zero of=swapfile bs=1MiB count=$((8*1024))
....
to create 8GiB swapfile.
Please read notes from *swapon*(8) about *the swap file use restrictions* (holes, preallocation and copy-on-write issues).
== SEE ALSO
*fdisk*(8),
*swapon*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

151
disk-utils/partx.8.adoc Normal file
View File

@ -0,0 +1,151 @@
////
partx.8 -- man page for partx
Copyright 2007 Karel Zak <kzak@redhat.com>
Copyright 2007 Red Hat, Inc.
Copyright 2010 Davidlohr Bueso <dave@gnu.org>
May be distributed under the GNU General Public License
////
= partx(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: partx
== NAME
partx - tell the kernel about the presence and numbering of on-disk partitions
== SYNOPSIS
*partx* [*-a*|*-d*|*-P*|*-r*|*-s*|*-u*] [*-t* _type_] [*-n* _M_:_N_] [-] _disk_
*partx* [*-a*|*-d*|*-P*|*-r*|*-s*|*-u*] [*-t* _type_] _partition_ [_disk_]
== DESCRIPTION
Given a device or disk-image, *partx* tries to parse the partition table and list its contents. It can also tell the kernel to add or remove partitions from its bookkeeping.
The _disk_ argument is optional when a _partition_ argument is provided. To force scanning a partition as if it were a whole disk (for example to list nested subpartitions), use the argument "-" (hyphen-minus). For example:
____
partx --show - /dev/sda3
____
This will see sda3 as a whole-disk rather than as a partition.
*partx is not an fdisk program* - adding and removing partitions does not change the disk, it just tells the kernel about the presence and numbering of on-disk partitions.
== OPTIONS
*-a*, *--add*::
Add the specified partitions, or read the disk and add all partitions.
*-b*, *--bytes*::
Print the SIZE column in bytes rather than in human-readable format.
*-d*, *--delete*::
Delete the specified partitions or all partitions. It is not error to remove non-existing partitions, so this option is possible to use together with large *--nr* ranges without care about the current partitions set on the device.
*-g*, *--noheadings*::
Do not print a header line with *--show* or *--raw*.
*-l*, *--list*::
List the partitions. Note that all numbers are in 512-byte sectors. This output format is DEPRECATED in favour of *--show*. Do not use it in newly written scripts.
*-n*, *--nr* __M__**:**_N_::
Specify the range of partitions. For backward compatibility also the format __M__**-**_N_ is supported. The range may contain negative numbers, for example *--nr -1:-1* means the last partition, and *--nr -2:-1* means the last two partitions. Supported range specifications are: +
_M_;;
Specifies just one partition (e.g. *--nr 3*).
__M__**:**;;
Specifies the lower limit only (e.g. *--nr 2:*).
**:**__N__;;
Specifies the upper limit only (e.g. *--nr :4*).
__M__**:**_N_;;
Specifies the lower and upper limits (e.g. *--nr 2:4*).
*-o*, *--output* _list_::
Define the output columns to use for *--show*, *--pairs* and *--raw* output. If no output arrangement is specified, then a default set is used. Use *--help* to get _list_ of all supported columns. This option cannot be combined with the *--add*, *--delete*, *--update* or *--list* options.
*--output-all*::
Output all available columns.
*-P*, *--pairs*::
List the partitions using the KEY="value" format.
*-r*, *--raw*::
List the partitions using the raw output format.
*-s*, *--show*::
List the partitions. The output columns can be selected and rearranged with the *--output* option. All numbers (except SIZE) are in 512-byte sectors.
*-t*, *--type* _type_::
Specify the partition table type.
*--list-types*::
List supported partition types and exit.
*-u*, *--update*::
Update the specified partitions.
*-S*, *--sector-size* _size_::
Overwrite default sector size.
*-v*, *--verbose*::
Verbose mode.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== ENVIRONMENT
LIBBLKID_DEBUG=all::
enables libblkid debug output.
== EXAMPLE
partx --show /dev/sdb3::
partx --show --nr 3 /dev/sdb::
partx --show /dev/sdb3 /dev/sdb::
All three commands list partition 3 of /dev/sdb.
partx --show - /dev/sdb3::
Lists all subpartitions on /dev/sdb3 (the device is used as whole-disk).
partx -o START -g --nr 5 /dev/sdb::
Prints the start sector of partition 5 on /dev/sdb without header.
partx -o SECTORS,SIZE /dev/sda5 /dev/sda::
Lists the length in sectors and human-readable size of partition 5 on /dev/sda.
partx --add --nr 3:5 /dev/sdd::
Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd.
partx -d --nr :-1 /dev/sdd::
Removes the last partition on /dev/sdd.
== AUTHORS
mailto:dave@gnu.org[Davidlohr Bueso] +
mailto:kzak@redhat.com[Karel Zak] +
The original version was written by mailto:aeb@cwi.nl[Andries E. Brouwer]
== SEE ALSO
*addpart*(8),
*delpart*(8),
*fdisk*(8),
*parted*(8),
*partprobe*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

70
disk-utils/raw.8.adoc Normal file
View File

@ -0,0 +1,70 @@
= raw(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: raw
== NAME
raw - bind a Linux raw character device
== SYNOPSIS
*raw* _/dev/raw/raw<N>_ _<major>_ _<minor>_
*raw* _/dev/raw/raw<N>_ _/dev/<blockdev>_
*raw* *-q* _/dev/raw/raw<N>_
*raw* *-qa*
== DESCRIPTION
*raw* is used to bind a Linux raw character device to a block device. Any block device may be used: at the time of binding, the device driver does not even have to be accessible (it may be loaded on demand as a kernel module later).
*raw* is used in two modes: it either sets raw device bindings, or it queries existing bindings. When setting a raw device, _/dev/raw/raw<N>_ is the device name of an existing raw device node in the filesystem. The block device to which it is to be bound can be specified either in terms of its _major_ and _minor_ device numbers, or as a path name _/dev/<blockdev>_ to an existing block device file.
The bindings already in existence can be queried with the *-q* option, which is used either with a raw device filename to query that one device, or with the *-a* option to query all bound raw devices.
Unbinding can be done by specifying major and minor 0.
Once bound to a block device, a raw device can be opened, read and written, just like the block device it is bound to. However, the raw device does not behave exactly like the block device. In particular, access to the raw device bypasses the kernel's block buffer cache entirely: all I/O is done directly to and from the address space of the process performing the I/O. If the underlying block device driver can support DMA, then no data copying at all is required to complete the I/O.
Because raw I/O involves direct hardware access to a process's memory, a few extra restrictions must be observed. All I/Os must be correctly aligned in memory and on disk: they must start at a sector offset on disk, they must be an exact number of sectors long, and the data buffer in virtual memory must also be aligned to a multiple of the sector size. The sector size is 512 bytes for most devices.
== OPTIONS
*-q*, *--query*::
Set query mode. *raw* will query an existing binding instead of setting a new one.
*-a*, *--all*::
With *-q*, specify that all bound raw devices should be queried.
*-h*, *--help*::
Display help text and exit.
*-V*, *--version*::
Display version information and exit.
== NOTES
Rather than using raw devices applications should prefer open2 devices, such as _/dev/sda1_, with the *O_DIRECT* flag.
== BUGS
The Linux dd1 command should be used without the *bs=* option, or the blocksize needs to be a multiple of the sector size of the device (512 bytes usually), otherwise it will fail with "Invalid Argument" messages (*EINVAL*).
Raw I/O devices do not maintain cache coherency with the Linux block device buffer cache. If you use raw I/O to overwrite data already in the buffer cache, the buffer cache will no longer correspond to the contents of the actual storage device underneath. This is deliberate, but is regarded as either a bug or a feature, depending on who you ask!
== AUTHORS
mailto:sct@redhat.com[Stephen Tweedie]
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,54 @@
////
resizepart.8 -- man page for resizepart
Copyright 2012 Vivek Goyal <vgoyal@redhat.com>
Copyright 2012 Red Hat, Inc.
May be distributed under the GNU General Public License
////
= resizepart(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: resizepart
== NAME
resizepart - tell the kernel about the new size of a partition
== SYNOPSIS
*resizepart* _device partition length_
== DESCRIPTION
*resizepart* tells the Linux kernel about the new size of the specified partition. The command is a simple wrapper around the "resize partition" ioctl.
This command doesn't manipulate partitions on a block device.
== PARAMETERS
_device_::
The disk device.
_partition_::
The partition number.
_length_::
The new length of the partition (in 512-byte sectors).
== SEE ALSO
*addpart*(8),
*delpart*(8),
*fdisk*(8),
*parted*(8),
*partprobe*(8),
*partx*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

405
disk-utils/sfdisk.8.adoc Normal file
View File

@ -0,0 +1,405 @@
////
sfdisk.8 -- man page for sfdisk
Copyright (C) 2014 Karel Zak <kzak@redhat.com>
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
////
= sfdisk(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: sfdisk
== NAME
sfdisk - display or manipulate a disk partition table
== SYNOPSIS
*sfdisk* [_options_] _device_ [*-N* _partition-number_]
*sfdisk* [_options_] _command_]
== DESCRIPTION
*sfdisk* is a script-oriented tool for partitioning any block device. It runs in interactive mode if executed on a terminal (stdin refers to a terminal).
Since version 2.26 *sfdisk* supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any functionality for CHS (Cylinder-Head-Sector) addressing. CHS has never been important for Linux, and this addressing concept does not make any sense for new devices.
*sfdisk* protects the first disk sector when create a new disk label. The option *--wipe always* disables this protection. Note that *fdisk*(8) and *cfdisk*(8) completely erase this area by default.
*sfdisk* (since version 2.26) *aligns the start and end of partitions* to block-device I/O limits when relative sizes are specified, when the default values are used or when multiplicative suffixes (e.g., MiB) are used for sizes. It is possible that partition size will be optimized (reduced or enlarged) due to alignment if the start offset is specified exactly in sectors and partition size relative or by multiplicative suffixes.
The recommended way is not to specify start offsets at all and specify partition size in MiB, GiB (or so). In this case *sfdisk* aligns all partitions to block-device I/O limits (or when I/O limits are too small then to megabyte boundary to keep disk layout portable). If this default behaviour is unwanted (usually for very small partitions) then specify offsets and sizes in sectors. In this case *sfdisk* entirely follows specified numbers without any optimization.
*sfdisk* does not create the standard system partitions for SGI and SUN disk labels like *fdisk*(8) does. It is necessary to explicitly create all partitions including whole-disk system partitions.
*sfdisk* uses *BLKRRPART* (reread partition table) ioctl to make sure that the device is not used by system or other tools (see also *--no-reread*). It's possible that this feature or another *sfdisk* activity races with *udevd*. The recommended way how to avoid possible collisions is to use *--lock* option. The exclusive lock will cause udevd to skip the event handling on the device.
The *sfdisk* prompt is only a hint for users and a displayed partition number does not mean that the same partition table entry will be created (if *-N* not specified), especially for tables with gaps.
== COMMANDS
The commands are mutually exclusive.
[*-N* _partition-number_] __device__::
The default *sfdisk* command is to read the specification for the desired partitioning of _device_ from standard input, and then create a partition table according to the specification. See below for the description of the input format. If standard input is a terminal, then *sfdisk* starts an interactive session. +
If the option *-N* is specified, then the changes are applied to the partition addressed by _partition-number_. The unspecified fields of the partition are not modified. +
Note that it's possible to address an unused partition with *-N*. For example, an MBR always contains 4 partitions, but the number of used partitions may be smaller. In this case *sfdisk* follows the default values from the partition table and does not use built-in defaults for the unused partition given with *-N*. See also *--append*.
*-A*, *--activate* __device__ [__partition-number__...]::
Switch on the bootable flag for the specified partitions and switch off the bootable flag on all unspecified partitions. The special placeholder '-' may be used instead of the partition numbers to switch off the bootable flag on all partitions. +
The activation command is supported for MBR and PMBR only. If a GPT label is detected, then *sfdisk* prints warning and automatically enters PMBR. +
If no _partition-number_ is specified, then list the partitions with an enabled flag.
*--delete* _device_ [__partition-number__...]::
Delete all or the specified partitions.
*-d*, *--dump* _device_::
Dump the partitions of a device in a format that is usable as input to *sfdisk*. See the section *BACKING UP THE PARTITION TABLE*.
*-g*, *--show-geometry* [__device__...]::
List the geometry of all or the specified devices. For backward compatibility the deprecated option *--show-pt-geometry* have the same meaning as this one.
*-J*, *--json* _device_::
Dump the partitions of a device in JSON format. Note that *sfdisk* is not able to use JSON as input format.
*-l*, *--list* [__device__...]::
List the partitions of all or the specified devices. This command can be used together with *--verify*.
*-F*, *--list-free* [__device__...]::
List the free unpartitioned areas on all or the specified devices.
*--part-attrs* _device partition-number_ [__attributes__]::
Change the GPT partition attribute bits. If _attributes_ is not specified, then print the current partition settings. The _attributes_ argument is a comma- or space-delimited list of bits numbers or bit names. For example, the string "RequiredPartition,50,51" sets three bits. The currently supported attribute bits are: +
*Bit 0 (RequiredPartition)*;;
If this bit is set, the partition is required for the platform to function. The creator of the partition indicates that deletion or modification of the contents can result in loss of platform features or failure for the platform to boot or operate. The system cannot function normally if this partition is removed, and it should be considered part of the hardware of the system.
*Bit 1 (NoBlockIOProtocol)*;;
EFI firmware should ignore the content of the partition and not try to read from it.
*Bit 2 (LegacyBIOSBootable)*;;
The partition may be bootable by legacy BIOS firmware.
*Bits 3-47*;;
Undefined and must be zero. Reserved for expansion by future versions of the UEFI specification.
*Bits 48-63*;;
Reserved for GUID specific use. The use of these bits will vary depending on the partition type. For example Microsoft uses bit 60 to indicate read-only, 61 for shadow copy of another partition, 62 for hidden partitions and 63 to disable automount.
*--part-label* _device partition-number_ [__label__]::
Change the GPT partition name (label). If _label_ is not specified, then print the current partition label.
*--part-type* _device partition-number_ [__type__]::
Change the partition type. If _type_ is not specified, then print the current partition type. +
The _type_ argument is hexadecimal for MBR, GUID for GPT, type alias (e.g. "linux") or type shortcut (e.g. 'L'). For backward compatibility the options *-c* and *--id* have the same meaning as this one.
*--part-uuid* _device partition-number_ [__uuid__]::
Change the GPT partition UUID. If _uuid_ is not specified, then print the current partition UUID.
*--disk-id* _device_ [__id__]::
Change the disk identifier. If _id_ is not specified, then print the current identifier. The identifier is UUID for GPT or unsigned integer for MBR.
*-r*, *--reorder* _device_::
Renumber the partitions, ordering them by their start offset.
*-s*, *--show-size* [__device__...]::
List the sizes of all or the specified devices in units of 1024 byte size. This command is DEPRECATED in favour of *blockdev*(8).
*-T*, *--list-types*::
Print all supported types for the current disk label or the label specified by *--label*.
*-V*, *--verify* [__device__...]::
Test whether the partition table and partitions seem correct.
*--relocate* _oper_ _device_::
Relocate partition table header. This command is currently supported for GPT header only. The argument _oper_ can be: +
*gpt-bak-std*;;
Move GPT backup header to the standard location at the end of the device.
*gpt-bak-mini*;;
Move GPT backup header behind the last partition. Note that UEFI standard requires the backup header at the end of the device and partitioning tools can automatically relocate the header to follow the standard.
== OPTIONS
*-a*, *--append*::
Don't create a new partition table, but only append the specified partitions. +
Note that unused partition maybe be re-used in this case although it is not the last partition in the partition table. See also *-N* to specify entry in the partition table.
*-b*, *--backup*::
Back up the current partition table sectors before starting the partitioning. The default backup file name is _~/sfdisk-<device>-<offset>.bak_; to use another name see option *-O*, *--backup-file*.
*--color*[**=**__when__]::
Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled; for the current built-in default see the *--help* output. See also the *COLORS* section.
*-f*, *--force*::
Disable all consistency checking.
*--Linux*::
Deprecated and ignored option. Partitioning that is compatible with Linux (and other modern operating systems) is the default.
*--lock*[=_mode_]::
Use exclusive BSD lock for device or file it operates. The optional argument _mode_ can be *yes*, *no* (or 1 and 0) or *nonblock*. If the _mode_ argument is omitted, it defaults to *"yes"*. This option overwrites environment variable *$LOCK_BLOCK_DEVICE*. The default is not to use any lock at all, but it's recommended to avoid collisions with udevd or other tools.
*-n*, *--no-act*::
Do everything except writing to the device.
*--no-reread*::
Do not check through the re-read-partition-table ioctl whether the device is in use.
*--no-tell-kernel*::
Don't tell the kernel about partition changes. This option is recommended together with *--no-reread* to modify a partition on used disk. The modified partition should not be used (e.g., mounted).
*-O*, *--backup-file* _path_::
Override the default backup file name. Note that the device name and offset are always appended to the file name.
*--move-data*[**=**__path__]::
Move data after partition relocation, for example when moving the beginning of a partition to another place on the disk. The size of the partition has to remain the same, the new and old location may overlap. This option requires option *-N* in order to be processed on one specific partition only. +
The optional _path_ specifies log file name. The log file contains information about all read/write operations on the partition data. The word "@default" as a _path_ forces sfdisk to use _~/sfdisk-<devname>.move_ for the log. The log is optional since v2.35. +
Note that this operation is risky and not atomic. *Don't forget to backup your data!* +
See also *--move-use-fsync*. +
In the example below, the first command creates a 100MiB free area before the first partition and moves the data it contains (e.g., a filesystem), the next command creates a new partition from the free space (at offset 2048), and the last command reorders partitions to match disk order (the original sdc1 will become sdc2). +
*echo '+100M,' | sfdisk --move-data /dev/sdc -N 1* *echo '2048,' | sfdisk /dev/sdc --append* *sfdisk /dev/sdc --reorder*
*--move-use-fsync*::
Use the *fsync*(2) system call after each write when moving data to a new location by *--move-data*.
*-o*, *--output* _list_::
Specify which output columns to print. Use *--help* to get a list of all supported columns. +
The default list of columns may be extended if _list_ is specified in the format _+list_ (e.g., *-o +UUID*).
*-q*, *--quiet*::
Suppress extra info messages.
*-u*, *--unit S*::
Deprecated option. Only the sector unit is supported. This option is not supported when using the *--show-size* command.
*-X*, *--label* _type_::
Specify the disk label type (e.g., *dos*, *gpt*, ...). If this option is not given, then *sfdisk* defaults to the existing label, but if there is no label on the device yet, then the type defaults to *dos*. The default or the current label may be overwritten by the "label: <name>" script header line. The option *--label* does not force *sfdisk* to create empty disk label (see the *EMPTY DISK LABEL* section below).
*-Y*, *--label-nested* _type_::
Force editing of a nested disk label. The primary disk label has to exist already. This option allows editing for example a hybrid/protective MBR on devices with GPT.
*-w*, *--wipe* _when_::
Wipe filesystem, RAID and partition-table signatures from the device, in order to avoid possible collisions. The argument _when_ can be *auto*, *never* or *always*. When this option is not given, the default is *auto*, in which case signatures are wiped only when in interactive mode; except the old partition-table signatures which are always wiped before create a new partition-table if the argument _when_ is not *never*. The *auto* mode also does not wipe the first sector (boot sector), it is necessary to use the *always* mode to wipe this area. In all cases detected signatures are reported by warning messages before a new partition table is created. See also the *wipefs*(8) command.
*-W*, *--wipe-partitions* _when_::
Wipe filesystem, RAID and partition-table signatures from a newly created partitions, in order to avoid possible collisions. The argument _when_ can be *auto*, *never* or *always*. When this option is not given, the default is *auto*, in which case signatures are wiped only when in interactive mode and after confirmation by user. In all cases detected signatures are reported by warning messages after a new partition is created. See also *wipefs*(8) command.
*-v*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== INPUT FORMATS
*sfdisk* supports two input formats and generic header lines.
=== Header lines
The optional header lines specify generic information that apply to the partition table. The header-line format is:
*<name>: <value>*
The currently recognized headers are:
*unit*::
Specify the partitioning unit. The only supported unit is *sectors*.
*label*::
Specify the partition table type. For example *dos* or *gpt*.
*label-id*::
Specify the partition table identifier. It should be a hexadecimal number (with a 0x prefix) for MBR and a UUID for GPT.
*first-lba*::
Specify the first usable sector for GPT partitions.
*last-lba*::
Specify the last usable sector for GPT partitions.
*table-length*::
Specify the maximal number of GPT partitions.
*grain*::
Specify minimal size in bytes used to calculate partitions alignment. The default is 1MiB and it's strongly recommended to use the default. Do not modify this variable if you're not sure.
*sector-size*::
Specify sector size. This header is informative only and it is not used when sfdisk creates a new partition table, in this case the real device specific value is always used and sector size from the dump is ignored.
Note that it is only possible to use header lines before the first partition is specified in the input.
=== Unnamed-fields format
____
_start size type bootable_
____
where each line fills one partition descriptor.
Fields are separated by whitespace, comma or semicolon possibly followed by whitespace; initial and trailing whitespace is ignored. Numbers can be octal, decimal or hexadecimal; decimal is the default. When a field is absent, empty or specified as '-' a default value is used. But when the *-N* option (change a single partition) is given, the default for each field is its previous value.
The default value of _start_ is the first non-assigned sector aligned according to device I/O limits. The default start offset for the first partition is 1 MiB. The offset may be followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then the number is interpreted as offset in bytes.
The default value of _size_ indicates "as much as possible"; i.e., until the next partition or end-of-device. A numerical argument is by default interpreted as a number of sectors, however if the size is followed by one of the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then the number is interpreted as the size of the partition in bytes and it is then aligned according to the device I/O limits. A '+' can be used instead of a number to enlarge the partition as much as possible. Note '+' is equivalent to the default behaviour for a new partition; existing partitions will be resized as required.
The partition _type_ is given in hex for MBR (DOS) where 0x prefix is optional; a GUID string for GPT; a shortcut or an alias. It's recommended to use two letters for MBR hex codes to avoid collision between deprecated shortcut 'E' and '0E' MBR hex code. For backward compatibility *sfdisk* tries to interpret _type_ as a shortcut as a first possibility in partitioning scripts although on other places (e.g. *--part-type* command) it tries shortcuts as the last possibility.
Since v2.36 libfdisk supports partition type aliases as extension to shortcuts. The alias is a simple human readable word (e.g. "linux").
Since v2.37 libfdisk supports partition type names on input, ignoring the case of the characters and all non-alphanumeric and non-digit characters in the name (e.g. "Linux /usr x86" is the same as "linux usr-x86").
Supported shortcuts and aliases:
*L - alias 'linux'*::
Linux; means 83 for MBR and 0FC63DAF-8483-4772-8E79-3D69D8477DE4 for GPT.
*S - alias 'swap'*::
swap area; means 82 for MBR and 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F for GPT
*Ex - alias 'extended'*::
MBR extended partition; means 05 for MBR. The original shortcut 'E' is deprecated due to collision with 0x0E MBR partition type.
*H - alias 'home'*::
home partition; means 933AC7E1-2EB4-4F13-B844-0E14E2AEF915 for GPT
*U - alias 'uefi'*::
EFI System partition, means EF for MBR and C12A7328-F81F-11D2-BA4B-00A0C93EC93B for GPT
*R - alias 'raid'*::
Linux RAID; means FD for MBR and A19D880F-05FC-4D3B-A006-743F0F84911E for GPT
*V - alias 'lvm'*::
LVM; means 8E for MBR and E6D6D379-F507-44C2-A23C-238F2A3DF928 for GPT
The default _type_ value is _linux_.
The shortcut 'X' for Linux extended partition (85) is deprecated in favour of 'Ex'.
_bootable_ is specified as [*****|*-*], with as default not-bootable. The value of this field is irrelevant for Linux - when Linux runs it has been booted already - but it might play a role for certain boot loaders and for other operating systems.
=== Named-fields format
This format is more readable, robust, extensible and allows specifying additional information (e.g., a UUID). It is recommended to use this format to keep your scripts more readable.
____
[_device_ *:*] _name_[**=**__value__], ...
____
The _device_ field is optional. *sfdisk* extracts the partition number from the device name. It allows specifying the partitions in random order. This functionality is mostly used by *--dump*. Don't use it if you are not sure.
The _value_ can be between quotation marks (e.g., name="This is partition name"). The currently supported fields are:
**start=**__number__::
The first non-assigned sector aligned according to device I/O limits. The default start offset for the first partition is 1 MiB. The offset may be followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then the number is interpreted as offset in bytes.
**size=**__number__::
Specify the partition size in sectors. The number may be followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then it's interpreted as size in bytes and the size is aligned according to device I/O limits.
*bootable*::
Mark the partition as bootable.
**attrs=**__string__::
Partition attributes, usually GPT partition attribute bits. See *--part-attrs* for more details about the GPT-bits string format.
**uuid=**__string__::
GPT partition UUID.
**name=**__string__::
GPT partition name.
**type=**__code__::
A hexadecimal number (without 0x) for an MBR partition, a GUID for a GPT partition, a shortcut as for unnamed-fields format or a type name (e.g. type="Linux /usr (x86)"). See above the section about the unnamed-fields format for more details. For backward compatibility the *Id=* field has the same meaning.
== EMPTY DISK LABEL
*sfdisk* does not create partition table without partitions by default. The lines with partitions are expected in the script by default. The empty partition table has to be explicitly requested by "label: <name>" script header line without any partitions lines. For example:
____
*echo 'label: gpt' | sfdisk /dev/sdb*
____
creates empty GPT partition table. Note that the *--append* disables this feature.
== BACKING UP THE PARTITION TABLE
It is recommended to save the layout of your devices. *sfdisk* supports two ways.
Use the *--dump* option to save a description of the device layout to a text file. The dump format is suitable for later *sfdisk* input. For example:
____
*sfdisk --dump /dev/sda > sda.dump*
____
This can later be restored by:
____
*sfdisk /dev/sda < sda.dump*
____
If you want to do a full (binary) backup of all sectors where the partition table is stored, then use the *--backup* option. It writes the sectors to _~/sfdisk-<device>-<offset>.bak_ files. The default name of the backup file can be changed with the *--backup-file* option. The backup files contain only raw data from the _device_. Note that the same concept of backup files is used by *wipefs*(8). For example:
____
*sfdisk --backup /dev/sda*
____
The GPT header can later be restored by:
____
dd if=~/sfdisk-sda-0x00000200.bak of=/dev/sda \
seek=$((0x00000200)) bs=1 conv=notrunc
____
Note that *sfdisk* since version 2.26 no longer provides the *-I* option to restore sectors. *dd*(1) provides all necessary functionality.
[[doclifter-colors]]
== COLORS
Implicit coloring can be disabled by an empty file _/etc/terminal-colors.d/sfdisk.disable_.
See *terminal-colors.d*(5) for more details about colorization configuration. The logical color names supported by *sfdisk* are:
*header*::
The header of the output tables.
*warn*::
The warning messages.
*welcome*::
The welcome message.
== ENVIRONMENT
SFDISK_DEBUG=all::
enables *sfdisk* debug output.
LIBFDISK_DEBUG=all::
enables libfdisk debug output.
LIBBLKID_DEBUG=all::
enables libblkid debug output.
LIBSMARTCOLS_DEBUG=all::
enables libsmartcols debug output.
LOCK_BLOCK_DEVICE=<mode>::
use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
== NOTES
Since version 2.26 *sfdisk* no longer provides the *-R* or *--re-read* option to force the kernel to reread the partition table. Use *blockdev --rereadpt* instead.
Since version 2.26 *sfdisk* does not provide the *--DOS*, *--IBM*, *--DOS-extended*, *--unhide*, *--show-extended*, *--cylinders*, *--heads*, *--sectors*, *--inside-outer*, *--not-inside-outer* options.
== AUTHORS
mailto:kzak@redhat.com[Karel Zak]
The current *sfdisk* implementation is based on the original *sfdisk* from Andries E. Brouwer.
== SEE ALSO
*fdisk*(8),
*cfdisk*(8),
*parted*(8),
*partprobe*(8),
*partx*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,60 @@
////
Copyright 2010 Jason Borden <jborden@bluehost.com>
This file may be copied under the terms of the GNU Public License.
////
= swaplabel(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: swaplabel
== NAME
swaplabel - print or change the label or UUID of a swap area
== SYNOPSIS
*swaplabel* [*-L* _label_] [*-U* _UUID_] _device_
== DESCRIPTION
*swaplabel* will display or change the label or UUID of a swap partition located on _device_ (or regular file).
If the optional arguments *-L* and *-U* are not given, *swaplabel* will simply display the current swap-area label and UUID of _device_.
If an optional argument is present, then *swaplabel* will change the appropriate value on _device_. These values can also be set during swap creation using *mkswap*(8). The *swaplabel* utility allows changing the label or UUID on an actively used swap device.
== OPTIONS
*-h*, *--help*::
Display help text and exit.
*-L*, *--label* _label_::
Specify a new _label_ for the device. Swap partition labels can be at most 16 characters long. If _label_ is longer than 16 characters, *swaplabel* will truncate it and print a warning message.
*-U*, *--uuid* _UUID_::
Specify a new _UUID_ for the device. The _UUID_ must be in the standard 8-4-4-4-12 character format, such as is output by *uuidgen*(1).
== ENVIRONMENT
LIBBLKID_DEBUG=all::
enables libblkid debug output.
== AUTHORS
*swaplabel* was written by mailto:jborden@bluehost.com[Jason Borden] and mailto:kzak@redhat.com[Karel Zak].
== SEE ALSO
*uuidgen*(1),
*mkswap*(8),
*swapon*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]