]> git.ipfire.org Git - thirdparty/util-linux.git/blob - disk-utils/cfdisk.8
libblkid: make example more robust
[thirdparty/util-linux.git] / disk-utils / cfdisk.8
1 .\" cfdisk.8 -- man page for cfdisk
2 .\" Copyright 1994 Kevin E. Martin (martin@cs.unc.edu)
3 .\" Copyright (C) 2014 Karel Zak <kzak@redhat.com>
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .TH CFDISK 8 "March 2014" "util-linux" "System Administration"
15 .SH NAME
16 cfdisk \- display or manipulate a disk partition table
17 .SH SYNOPSIS
18 .B cfdisk
19 [options]
20 .RI [ device ]
21 .SH DESCRIPTION
22 .B cfdisk
23 is a curses-based program for partitioning any block device.
24 The default device is
25 .IR /dev/sda .
26
27 Note that
28 .B cfdisk
29 provides basic partitioning functionality with a user-friendly interface.
30 If you need advanced features, use
31 .BR fdisk (8)
32 instead.
33
34 Since version 2.25
35 .B cfdisk
36 supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any
37 functionality for CHS (Cylinder-Head-Sector) addressing. CHS has
38 never been important for Linux, and this addressing concept does not make any
39 sense for new devices.
40
41 Since version 2.25
42 .B cfdisk
43 also does not provide a 'print' command any more.
44 This functionality is provided by the utilities
45 .BR partx (8)
46 and
47 .BR lsblk (8)
48 in a very comfortable and rich way.
49
50 If you want to remove an old partition table from a device, use
51 .BR wipefs (8).
52
53 .SH OPTIONS
54 .TP
55 .BR \-h , " \-\-help"
56 Display help text and exit.
57 .TP
58 .BR \-L , " \-\-color" [ = \fIwhen\fR]
59 Colorize the output. The optional argument \fIwhen\fP
60 can be \fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted,
61 it defaults to \fBauto\fR. The colors can be disabled, for the current built-in default
62 see \fB\-\-help\fR output. See also the COLORS section.
63 .TP
64 .BR \-V , " \-\-version"
65 Display version information and exit.
66 .TP
67 .BR \-z , " \-\-zero"
68 Start with an in-memory zeroed partition table. This option does not zero the
69 partition table on the disk; rather, it simply starts the program without
70 reading the existing partition table. This option allows you to create a new
71 partition table from scratch or from an sfdisk-compatible script.
72
73 .SH COMMANDS
74 The commands for
75 .B cfdisk
76 can be entered by pressing the corresponding key (pressing
77 .I Enter
78 after the command is not necessary). Here is a list of the available
79 commands:
80 .TP
81 .B b
82 Toggle the bootable flag of the current partition. This allows you to
83 select which primary partition is bootable on the drive. This command may not
84 be available for all partition label types.
85 .TP
86 .B d
87 Delete the current partition. This will convert the current partition
88 into free space and merge it with any free space immediately
89 surrounding the current partition. A partition already marked as free
90 space or marked as unusable cannot be deleted.
91 .TP
92 .B h
93 Show the help screen.
94 .TP
95 .B n
96 Create a new partition from free space.
97 .B cfdisk
98 then prompts you for the size of the partition you want to create.
99 The default size is equal to the entire available free space at the current
100 position.
101
102 The size may be followed by a multiplicative suffix: KiB (=1024),
103 MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB
104 (the "iB" is optional, e.g. "K" has the same meaning as "KiB").
105 .TP
106 .B q
107 Quit the program. This will exit the program without writing any data to
108 the disk.
109 .TP
110 .B s
111 Sort the partitions in ascending start-sector order. When deleting and
112 adding partitions, it is likely that the numbering of the partitions will
113 no longer match their order on the disk. This command restores that match.
114 .TP
115 .B t
116 Change the partition type. By default, new partitions are created as
117 .I Linux
118 partitions.
119 .TP
120 .B u
121 Dump the current in-memory partition table to an sfdisk-compatible script file.
122 .sp
123 The script files are compatible between \fBcfdisk\fR, \fBfdisk\fR, \fBsfdisk\fR
124 and other libfdisk applications. For more details see
125 .BR sfdisk (8).
126 .sp
127 It is also possible to load an sfdisk-script into \fBcfdisk\fR if there is
128 no partition table on the device or when you start \fBcfdisk\fR with the
129 \fB--zero\fR command-line option.
130 .TP
131 .B W
132 Write the partition table to disk (you must enter an uppercase W). Since
133 this might destroy data on the disk, you must either confirm or deny
134 the write by entering `yes' or `no'. If you enter `yes',
135 .B cfdisk
136 will write the partition table to disk and then tell the kernel to re-read the
137 partition table from the disk.
138
139 The re-reading of the partition table does not always work. In such a
140 case you need to inform the kernel about any new partitions by using
141 .BR partprobe (8)
142 or
143 .BR partx (8),
144 or by rebooting the system.
145 .TP
146 .B x
147 Toggle extra information about a partition.
148 .TP
149 .IR "Up Arrow" , " Down Arrow"
150 Move the cursor to the previous or next partition. If there are more
151 partitions than can be displayed on a screen, you can display the next
152 (previous) set of partitions by moving down (up) at the last (first)
153 partition displayed on the screen.
154 .TP
155 .IR "Left Arrow" , " Right Arrow"
156 Select the preceding or the next menu item. Hitting \fIEnter\fR will
157 execute the currently selected item.
158
159 .PP
160 All commands can be entered with either uppercase or lowercase
161 letters (except for
162 .BR W rite).
163 When in a submenu or at a prompt, you can hit the
164 .I Esc
165 key to return to the main menu.
166
167 .SH COLORS
168 Implicit coloring can be disabled by creating the empty file
169 .IR /etc/terminal-colors.d/cfdisk.disable .
170
171 See
172 .BR terminal-colors.d (5)
173 for more details about colorization configuration.
174
175 .B cfdisk
176 does not support color customization with a color-scheme file.
177
178 .SH ENVIRONMENT
179 .IP CFDISK_DEBUG=all
180 enables cfdisk debug output.
181 .IP LIBFDISK_DEBUG=all
182 enables libfdisk debug output.
183 .IP LIBBLKID_DEBUG=all
184 enables libblkid debug output.
185 .IP LIBSMARTCOLS_DEBUG=all
186 enables libsmartcols debug output.
187 .IP LIBSMARTCOLS_DEBUG_PADDING=on
188 use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
189
190 .SH "SEE ALSO"
191 .BR fdisk (8),
192 .BR parted (8),
193 .BR partprobe (8),
194 .BR partx (8),
195 .BR sfdisk (8)
196 .SH AUTHOR
197 Karel Zak <kzak@redhat.com>
198 .PP
199 The current cfdisk implementation is based on the original cfdisk
200 from Kevin E. Martin (martin@cs.unc.edu).
201
202 .SH AVAILABILITY
203 The cfdisk command is part of the util-linux package and is available from
204 https://www.kernel.org/pub/linux/utils/util-linux/.