1CFDISK(8) System Administration CFDISK(8)
2
3
4
6 cfdisk - display or manipulate a disk partition table
7
9 cfdisk [options] [device]
10
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
37 -h, --help
38 Display help text and exit.
39
40 -L, --color[=when]
41 Colorize the output. The optional argument when can be auto, never
42 or always. If the when argument is omitted, it defaults to auto.
43 The colors can be disabled, for the current built-in default see
44 --help output. See also the COLORS section.
45
46 --lock[=mode]
47 Use exclusive BSD lock for device or file it operates. The optional
48 argument mode can be yes, no (or 1 and 0) or nonblock. If the mode
49 argument is omitted, it defaults to "yes". This option overwrites
50 environment variable $LOCK_BLOCK_DEVICE. The default is not to use
51 any lock at all, but it’s recommended to avoid collisions with
52 udevd or other tools.
53
54 -r, --read-only
55 Forced open in read-only mode.
56
57 -V, --version
58 Display version information and exit.
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
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 sfdisk-compatible
120 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
158 Implicit coloring can be disabled by creating the empty file
159 /etc/terminal-colors.d/cfdisk.disable.
160
161 See terminal-colors.d(5) for more details about colorization
162 configuration.
163
164 cfdisk does not support color customization with a color-scheme file.
165
167 CFDISK_DEBUG=all
168 enables cfdisk debug output.
169
170 LIBFDISK_DEBUG=all
171 enables libfdisk debug output.
172
173 LIBBLKID_DEBUG=all
174 enables libblkid debug output.
175
176 LIBSMARTCOLS_DEBUG=all
177 enables libsmartcols debug output.
178
179 LIBSMARTCOLS_DEBUG_PADDING=on
180 use visible padding characters. Requires enabled
181 LIBSMARTCOLS_DEBUG.
182
183 LOCK_BLOCK_DEVICE=<mode>
184 use exclusive BSD lock. The mode is "1" or "0". See --lock for more
185 details.
186
188 Karel Zak <kzak@redhat.com>
189
190 The current cfdisk implementation is based on the original cfdisk from
191 Kevin E. Martin <martin@cs.unc.edu>.
192
194 fdisk(8), parted(8), partprobe(8), partx(8), sfdisk(8)
195
197 For bug reports, use the issue tracker at
198 https://github.com/karelzak/util-linux/issues.
199
201 The cfdisk command is part of the util-linux package which can be
202 downloaded from Linux Kernel Archive
203 <https://www.kernel.org/pub/linux/utils/util-linux/>.
204
205
206
207util-linux 2.37.2 2021-08-10 CFDISK(8)