]> git.ipfire.org Git - thirdparty/util-linux.git/blame - disk-utils/cfdisk.8.adoc
unshare: make sure map_range.next is initialized [coverity scan]
[thirdparty/util-linux.git] / disk-utils / cfdisk.8.adoc
CommitLineData
295b3979 1//po4a: entry man manual
c6a568fc
MB
2////
3cfdisk.8 -- man page for cfdisk
4Copyright 1994 Kevin E. Martin (martin@cs.unc.edu)
5Copyright (C) 2014 Karel Zak <kzak@redhat.com>
6
7Permission is granted to make and distribute verbatim copies of this
8manual provided the copyright notice and this permission notice are
9preserved on all copies.
10
11Permission is granted to copy and distribute modified versions of this
12manual under the conditions for verbatim copying, provided that the
13entire resulting derived work is distributed under the terms of a
14permission notice identical to this one.
15////
16= cfdisk(8)
17:doctype: manpage
18:man manual: System Administration
19:man source: util-linux {release-version}
20:page-layout: base
21:command: cfdisk
22
23== NAME
24
25cfdisk - display or manipulate a disk partition table
26
27== SYNOPSIS
28
4d297435 29*cfdisk* [options] [_device_]
c6a568fc
MB
30
31== DESCRIPTION
32
33*cfdisk* is a curses-based program for partitioning any block device. The default device is _/dev/sda_.
34
35Note that *cfdisk* provides basic partitioning functionality with a user-friendly interface. If you need advanced features, use *fdisk*(8) instead.
36
37All 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.
38
39Since 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.
40
41Since 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.
42
43If you want to remove an old partition table from a device, use *wipefs*(8).
44
45== OPTIONS
46
2b2d3172 47include::man-common/help-version.adoc[]
c6a568fc
MB
48
49*-L*, *--color*[**=**__when__]::
c83a52f0 50Colorize 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.
c6a568fc
MB
51
52*--lock*[=_mode_]::
bd67ca44 53Use 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 *systemd-udevd*(8) or other tools.
c6a568fc
MB
54
55*-r*, *--read-only*::
299604dd 56Forced open in read-only mode.
c6a568fc 57
c6a568fc 58*-z*, *--zero*::
299604dd 59Start 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*(8)-compatible script.
c6a568fc
MB
60
61== COMMANDS
62
63The 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:
64
65*b*::
299604dd 66Toggle 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.
c6a568fc
MB
67
68*d*::
299604dd 69Delete 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.
c6a568fc
MB
70
71*h*::
299604dd 72Show the help screen.
c6a568fc
MB
73
74*n*::
299604dd
MB
75Create 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.
76+
77The 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").
c6a568fc
MB
78
79*q*::
299604dd 80Quit the program. This will exit the program without writing any data to the disk.
c6a568fc
MB
81
82*r*::
299604dd
MB
83Reduce 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.
84+
85*Note that reducing the size of a partition might destroy data on that partition.*
c6a568fc
MB
86
87*s*::
299604dd 88Sort 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.
c6a568fc
MB
89
90*t*::
299604dd 91Change the partition type. By default, new partitions are created as _Linux_ partitions.
c6a568fc
MB
92
93*u*::
e6743239 94Dump the current in-memory partition table to an **sfdisk**(8)-compatible script file.
299604dd
MB
95+
96The script files are compatible between *cfdisk*, *fdisk*(8) *sfdisk*(8) and other libfdisk applications. For more details see *sfdisk*(8).
97+
98It 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.
c6a568fc
MB
99
100*W*::
299604dd
MB
101Write 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.
102+
103The 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.
c6a568fc
MB
104
105*x*::
299604dd 106Toggle extra information about a partition.
c6a568fc
MB
107
108_Up Arrow_, _Down Arrow_::
299604dd 109Move 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.
c6a568fc
MB
110
111_Left Arrow_, _Right Arrow_::
299604dd 112Select the preceding or the next menu item. Hitting _Enter_ will execute the currently selected item.
c6a568fc
MB
113
114All 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.
115
6c62faf1 116include::man-common/colors.adoc[]
c6a568fc
MB
117*cfdisk* does not support color customization with a color-scheme file.
118
119== ENVIRONMENT
120
121*CFDISK_DEBUG*=all::
299604dd 122enables cfdisk debug output.
c6a568fc
MB
123
124*LIBFDISK_DEBUG*=all::
299604dd 125enables libfdisk debug output.
c6a568fc
MB
126
127*LIBBLKID_DEBUG*=all::
299604dd 128enables libblkid debug output.
c6a568fc
MB
129
130*LIBSMARTCOLS_DEBUG*=all::
299604dd 131enables libsmartcols debug output.
c6a568fc
MB
132
133*LIBSMARTCOLS_DEBUG_PADDING*=on::
299604dd 134use visible padding characters. Requires enabled *LIBSMARTCOLS_DEBUG*.
c6a568fc
MB
135
136*LOCK_BLOCK_DEVICE*=<mode>::
299604dd 137use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
c6a568fc
MB
138
139== AUTHORS
140
141mailto:kzak@redhat.com[Karel Zak]
142
299604dd 143The current *cfdisk* implementation is based on the original *cfdisk* from mailto:martin@cs.unc.edu[Kevin E. Martin].
c6a568fc
MB
144
145== SEE ALSO
146
147*fdisk*(8),
148*parted*(8),
149*partprobe*(8),
150*partx*(8),
151*sfdisk*(8)
152
625e9c61 153include::man-common/bugreports.adoc[]
c6a568fc 154
625e9c61 155include::man-common/footer.adoc[]
c6a568fc
MB
156
157ifdef::translation[]
625e9c61 158include::man-common/translation.adoc[]
c6a568fc 159endif::[]