-v, --version
Print version number of sfdisk and exit immediately.
|
-h, --help
Print a usage message and exit immediately.
|
-T, --list-types
Print the recognized types (system Id's).
|
-s, --show-size
List the size of a partition.
|
-g, --show-geometry
List the kernel's idea of the geometry of the indicated disk(s).
|
-G, --show-pt-geometry
List the geometry of the indicated disks guessed by looking at the partition table.
|
-l, --list
List the partitions of a device.
|
-d, --dump
Dump the partitions of a device in a format that is usable as input to /fBsfdisk/fR. For example,
% sfdisk -d /dev/hda > hda.out
% sfdisk /dev/hda < hda.out
will correct the bad last extended partition that the OS/2 fdisk creates.
|
-V, --verify
Test whether partitions seem correct. (See the third invocation type above.)
|
-i, --increment
Number cylinders etc. starting from 1 instead of 0.
|
-N number
Change only the single partition indicated. For example:
% sfdisk /dev/hdb -N5
,,,*
will make the fifth partition on /dev/hdb bootable (`active') and change nothing else. (Probably
this fifth partition is called /dev/hdb5, but you are free to call it something else, like
`/my_equipment/disks/2/5' or so).
|
-A, --activate number
Make the indicated partition(s) active, and all others inactive.
|
-c, --id number [Id]
If no Id argument given: print the partition Id of the indicated partition. If an Id argument is
present: change the type (Id) of the indicated partition to the given value. This option has two
longer forms, --print-id and --change-id. For example:
% sfdisk --print-id /dev/hdb 5
6
% sfdisk --change-id /dev/hdb 5 83
OK
first reports that /dev/hdb5 has Id 6, and then changes that into 83.
|
-u, --unit letter
Interpret the input and show the output in the units specified by letter. This letter can be one
of S, C, B or M, meaning Sectors, Cylinders, Blocks and Megabytes, respectively. The default is
cylinders, at least when the geometry is known.
|
-x, --show-extended
Also list non-primary extended partitions on output, and expect descriptors for them on input.
|
-C, --cylinders cylinders
Specify the number of cylinders, possibly overriding what the kernel thinks.
|
-H, --heads heads
Specify the number of heads, possibly overriding what the kernel thinks.
|
-S, --sectors sectors
Specify the number of sectors, possibly overriding what the kernel thinks.
|
-f, --force
Do what I say, even if it is stupid.
|
-q, --quiet
Suppress warning messages.
|
-L, --Linux
Do not complain about things irrelevant for Linux.
|
-D, --DOS
For DOS-compatibility: waste a little space. (More precisely: if a partition cannot contain
sector 0, e.g. because that is the MBR of the device, or contains the partition table of an
extended partition, then sfdisk would make it start the next sector. However, when this option is
given it skips to the start of the next track, wasting for example 33 sectors (in case of 34
sectors/track), just like certain versions of DOS do.) Certain Disk Managers and boot loaders
(such as OSBS, but not LILO or the OS/2 Boot Manager) also live in this empty space, so maybe you
want this option if you use one.
|
-E, --DOS-extended
Take the starting sector numbers of "inner" extended partitions to be relative to the starting
cylinder boundary of the outer one (like some versions of DOS do), rather than relative to the
actual starting sector (like Linux does). (The fact that there is a difference here means that
one should always let extended partitions start at cylinder boundaries if DOS and Linux should
interpret the partition table in the same way. Of course one can only know where cylinder
boundaries are when one knows what geometry DOS will use for this disk.)
|
--IBM, --leave-last
Certain IBM diagnostic programs assume that they can use the last cylinder on a disk for disk-
testing purposes. If you think you might ever run such programs, use this option to tell sfdisk
that it should not allocate the last cylinder. Sometimes the last cylinder contains a bad sector
table.
|
-n Go through all the motions, but do not actually write to disk.
|
-R, --re-read
Only execute the BLKRRPART ioctl (to make the kernel re-read the partition table). This can be
useful for checking in advance that the final BLKRRPART will be successful, and also when you
changed the partition table `by hand' (e.g., using dd from a backup). If the kernel complains
(`device busy for revalidation (usage = 2)') then something still uses the device, and you still
have to unmount some file system, or say swapoff to some swap partition.
|
--no-reread
When starting a repartitioning of a disk, sfdisk checks that this disk is not mounted, or in use
as a swap device, and refuses to continue if it is. This option suppresses the test. (On the
other hand, the -f option would force sfdisk to continue even when this test fails.)
|
--in-order
Caution, see warning section. To be documented.
|
--not-in-order
Caution, see warning section. To be documented.
|
--inside-outer
Caution, see warning section. Chaining order.
|
--not-inside-outer
Caution, see warning section. Chaining order.
|
--nested
Caution, see warning section. Every partition is contained in the surrounding partitions and is
disjoint from all others.
|
--chained
Caution, see warning section. Every data partition is contained in the surrounding partitions and
disjoint from all others, but extended partitions may lie outside (insofar as allowed by
all_logicals_inside_outermost_extended).
|
--onesector
Caution, see warning section. All data partitions are mutually disjoint; extended partitions each
use one sector only (except perhaps for the outermost one).
|
-O file
Just before writing the new partition, output the sectors that are going to be overwritten to file
(where hopefully file resides on another disk, or on a floppy).
|
-I file
After destroying your filesystems with an unfortunate sfdisk command, you would have been able to
restore the old situation if only you had preserved it using the -O flag.
|