1CFDISK(8)                    System Administration                   CFDISK(8)
2
3
4

NAME

6       cfdisk - display or manipulate a disk partition table
7

SYNOPSIS

9       cfdisk [options] [device]
10

DESCRIPTION

12       cfdisk is a curses-based program for partitioning any block device. The
13       default device is /dev/sda.
14
15       Note that cfdisk provides basic partitioning functionality with a
16       user-friendly interface. If you need advanced features, use fdisk(8)
17       instead.
18
19       All disk label changes will remain in memory only, and the disk will be
20       unmodified until you decide to write your changes. Be careful before
21       using the write command.
22
23       Since version 2.25 cfdisk supports MBR (DOS), GPT, SUN and SGI disk
24       labels, but no longer provides any functionality for CHS
25       (Cylinder-Head-Sector) addressing. CHS has never been important for
26       Linux, and this addressing concept does not make any sense for new
27       devices.
28
29       Since version 2.25 cfdisk also does not provide a 'print' command any
30       more. This functionality is provided by the utilities partx(8) and
31       lsblk(8) in a very comfortable and rich way.
32
33       If you want to remove an old partition table from a device, use
34       wipefs(8).
35

OPTIONS

37       -h, --help
38           Display help text and exit.
39
40       -V, --version
41           Print version and exit.
42
43       -L, --color[=when]
44           Colorize the output. The optional argument when can be auto, never
45           or always. If the when argument is omitted, it defaults to auto.
46           The colors can be disabled, for the current built-in default see
47           --help output. See also the COLORS section.
48
49       --lock[=mode]
50           Use exclusive BSD lock for device or file it operates. The optional
51           argument mode can be yes, no (or 1 and 0) or nonblock. If the mode
52           argument is omitted, it defaults to yes. This option overwrites
53           environment variable $LOCK_BLOCK_DEVICE. The default is not to use
54           any lock at all, but it’s recommended to avoid collisions with
55           systemd-udevd(8) or other tools.
56
57       -r, --read-only
58           Forced open in read-only mode.
59
60       -z, --zero
61           Start with an in-memory zeroed partition table. This option does
62           not zero the partition table on the disk; rather, it simply starts
63           the program without reading the existing partition table. This
64           option allows you to create a new partition table from scratch or
65           from an sfdisk(8)-compatible script.
66

COMMANDS

68       The commands for cfdisk can be entered by pressing the corresponding
69       key (pressing Enter after the command is not necessary). Here is a list
70       of the available commands:
71
72       b
73           Toggle the bootable flag of the current partition. This allows you
74           to select which primary partition is bootable on the drive. This
75           command may not be available for all partition label types.
76
77       d
78           Delete the current partition. This will convert the current
79           partition into free space and merge it with any free space
80           immediately surrounding the current partition. A partition already
81           marked as free space or marked as unusable cannot be deleted.
82
83       h
84           Show the help screen.
85
86       n
87           Create a new partition from free space. cfdisk then prompts you for
88           the size of the partition you want to create. The default size is
89           equal to the entire available free space at the current position.
90
91           The size may be followed by a multiplicative suffix: KiB (=1024),
92           MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB
93           (the "iB" is optional, e.g., "K" has the same meaning as "KiB").
94
95       q
96           Quit the program. This will exit the program without writing any
97           data to the disk.
98
99       r
100           Reduce or enlarge the current partition. cfdisk then prompts you
101           for the new size of the partition. The default size is the current
102           size. A partition marked as free space or marked as unusable cannot
103           be resized.
104
105           Note that reducing the size of a partition might destroy data on
106           that partition.
107
108       s
109           Sort the partitions in ascending start-sector order. When deleting
110           and adding partitions, it is likely that the numbering of the
111           partitions will no longer match their order on the disk. This
112           command restores that match.
113
114       t
115           Change the partition type. By default, new partitions are created
116           as Linux partitions.
117
118       u
119           Dump the current in-memory partition table to an
120           sfdisk(8)-compatible script file.
121
122           The script files are compatible between cfdisk, fdisk(8) sfdisk(8)
123           and other libfdisk applications. For more details see sfdisk(8).
124
125           It is also possible to load an sfdisk-script into cfdisk if there
126           is no partition table on the device or when you start cfdisk with
127           the --zero command-line option.
128
129       W
130           Write the partition table to disk (you must enter an uppercase W).
131           Since this might destroy data on the disk, you must either confirm
132           or deny the write by entering `yes' or `no'. If you enter `yes',
133           cfdisk will write the partition table to disk and then tell the
134           kernel to re-read the partition table from the disk.
135
136           The re-reading of the partition table does not always work. In such
137           a case you need to inform the kernel about any new partitions by
138           using partprobe(8) or partx(8), or by rebooting the system.
139
140       x
141           Toggle extra information about a partition.
142
143       Up Arrow, Down Arrow
144           Move the cursor to the previous or next partition. If there are
145           more partitions than can be displayed on a screen, you can display
146           the next (previous) set of partitions by moving down (up) at the
147           last (first) partition displayed on the screen.
148
149       Left Arrow, Right Arrow
150           Select the preceding or the next menu item. Hitting Enter will
151           execute the currently selected item.
152
153       All commands can be entered with either uppercase or lowercase letters
154       (except for Write). When in a submenu or at a prompt, you can hit the
155       Esc key to return to the main menu.
156

COLORS

158       The output colorization is implemented by terminal-colors.d(5)
159       functionality. Implicit coloring can be disabled by an empty file
160
161          /etc/terminal-colors.d/cfdisk.disable
162
163       for the cfdisk command or for all tools by
164
165          /etc/terminal-colors.d/disable
166
167       The user-specific $XDG_CONFIG_HOME/terminal-colors.d or
168       $HOME/.config/terminal-colors.d overrides the global setting.
169
170       Note that the output colorization may be enabled by default, and in
171       this case terminal-colors.d directories do not have to exist yet.
172
173       cfdisk does not support color customization with a color-scheme file.
174

ENVIRONMENT

176       CFDISK_DEBUG=all
177           enables cfdisk debug output.
178
179       LIBFDISK_DEBUG=all
180           enables libfdisk debug output.
181
182       LIBBLKID_DEBUG=all
183           enables libblkid debug output.
184
185       LIBSMARTCOLS_DEBUG=all
186           enables libsmartcols debug output.
187
188       LIBSMARTCOLS_DEBUG_PADDING=on
189           use visible padding characters. Requires enabled
190           LIBSMARTCOLS_DEBUG.
191
192       LOCK_BLOCK_DEVICE=<mode>
193           use exclusive BSD lock. The mode is "1" or "0". See --lock for more
194           details.
195

AUTHORS

197       Karel Zak <kzak@redhat.com>
198
199       The current cfdisk implementation is based on the original cfdisk from
200       Kevin E. Martin <martin@cs.unc.edu>.
201

SEE ALSO

203       fdisk(8), parted(8), partprobe(8), partx(8), sfdisk(8)
204

REPORTING BUGS

206       For bug reports, use the issue tracker at
207       https://github.com/util-linux/util-linux/issues.
208

AVAILABILITY

210       The cfdisk command is part of the util-linux package which can be
211       downloaded from Linux Kernel Archive
212       <https://www.kernel.org/pub/linux/utils/util-linux/>.
213
214
215
216util-linux 2.38.1                 2022-05-11                         CFDISK(8)
Impressum