Penguin
Annotated edit history of cfdisk(8) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 CFDISK
2 !!!CFDISK
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 DOS 6.x WARNING
7 COMMANDS
8 OPTIONS
9 EXIT STATUS
10 SEE ALSO
11 BUGS
12 AUTHOR
13 ----
14 !!NAME
15
16
17 cfdisk - Curses based disk partition table manipulator for Linux
18 !!SYNOPSIS
19
20
21 __cfdisk [[ -agvz ] [[ -c__ ''cylinders'' __] [[ -h__
22 ''heads'' __] [[ -s__ ''sectors-per-track'' __] [[
23 -P__ ''opt'' __] [[__ ''device''
24 __]__
25 !!DESCRIPTION
26
27
28 __cfdisk__ is a curses based program for partitioning any
29 hard disk drive. Typical values of the ''device''
30 argument are:
31
32
33 /dev/hda [[default]
34 /dev/hdb
35 /dev/sda
36 /dev/sdb
37 /dev/sdc
38 /dev/sdd
39 In order to write the partition table __cfdisk__ needs something called the `geometry' of the disk: the number of `heads' and the number of `sectors per track'. Linux does not use any geometry, so if the disk will not be accessed by other operating systems, you can safely accept the defaults that __cfdisk__ chooses for you. The geometry used by __cfdisk__ is found as follows. First the partition table is examined, to see what geometry was used by the previous program that changed it. If the partition table is empty, or contains garbage, or does not point at a consistent geometry, the kernel is asked for advice. If nothing works 255 heads and 63 sectors/track is assumed. The geometry can be overridden on the command line or by use of the `g' command. When partitioning an empty large modern disk, picking 255 heads and 63 sectors/track is always a good idea. There is no need to set the number of cylinders, since __cfdisk__ knows the disk size.
40
41
42 Next, __cfdisk__ tries to read the current partition
43 table from the disk drive. If it is unable to figure out the
44 partition table, an error is displayed and the program will
45 exit. This might also be caused by incorrect geometry
46 information, and can be overridden on the command line.
47 Another way around this problem is with the __-z__
48 option. This will ignore the partition table on the
49 disk.
50
51
52 The main display is composed of four sections, from top to
53 bottom: the header, the partitions, the command line and a
54 warning line. The header contains the program name and
55 version number followed by the disk drive and its geometry.
56 The partitions section always displays the current partition
57 table. The command line is the place where commands and text
58 are entered. The available commands are usually displayed in
59 brackets. The warning line is usually empty except when
60 there is important information to be displayed. The current
61 partition is highlighted with reverse video (or an arrow if
62 the __-a__ option is given). All partition specific
63 commands apply to the current partition.
64
65
66 The format of the partition table in the partitions section
67 is, from left to right: Name, Flags, Partition Type,
68 Filesystem Type and Size. The name is the partition device
69 name. The flags can be ''Boot'', which designates a
70 bootable partition or ''NC'', which stands for
71 ''cfdisk__ allows you to recover these
72 __m__). ''Note:''
73 fdisk(8) and some early versions of DOS create all
74 partitions with the number of sectors already maximized. For
75 more information, see the maximize command below. The
76 partition type can be one of ''Primary'' or
77 ''Logical''. For unallocated space on the drive, the
78 partition type can also be ''Pri/Log'', or empty (if the
79 space is unusable). The filesystem type section displays the
80 name of the filesystem used on the partition, if known. If
81 it is unknown, then ''Unknown'' and the hex value of the
82 filesystem type are displayed. A special case occurs when
83 there are sections of the disk drive that cannot be used
84 (because all of the primary partitions are used). When this
85 is detected, the filesystem type is displayed as
86 ''Unusable''. The size field displays the size of the
87 partition in megabytes (by default). It can also display the
88 size in sectors and cylinders (see the change units command
89 below). If an asterisks (__*__) appears after the size,
90 this means that the partition is not aligned on cylinder
91 boundaries.
92 !!DOS 6.x WARNING
93
94
95 The DOS 6.x FORMAT command looks for some information in the
96 first sector of the data area of the partition, and treats
97 this information as more reliable than the information in
98 the partition table. DOS FORMAT expects DOS FDISK to clear
99 the first 512 bytes of the data area of a partition whenever
100 a size change occurs. DOS FORMAT will look at this extra
101 information even if the /U flag is given -- we consider this
102 a bug in DOS FORMAT and DOS FDISK.
103
104
105 The bottom line is that if you use cfdisk or fdisk to change
106 the size of a DOS partition table entry, then you must also
107 use __dd__ to zero the first 512 bytes of that partition
108 before using DOS FORMAT to format the partition. For
109 example, if you were using cfdisk to make a DOS partition
110 table entry for /dev/hda1, then (after exiting fdisk or
111 cfdisk and rebooting Linux so that the partition table
112 information is valid) you would use the command
113 __
114
115
116 __BE EXTREMELY CAREFUL__ if you use the __dd__
117 command, since a small typo can make all of the data on your
118 disk useless.
119
120
121 For best results, you should always use an OS-specific
122 partition table program. For example, you should make DOS
123 partitions with the DOS FDISK program and Linux partitions
124 with the Linux fdisk or Linux cfdisk program.
125 !!COMMANDS
126
127
128 __cfdisk__ commands can be entered by pressing the
129 desired key (pressing ''Enter'' after the command is not
130 necessary). Here is a list of the available
131 commands:
132
133
134 __b__
135
136
137 Toggle bootable flag of the current partition. This allows
138 you to select which primary partition is bootable on the
139 drive.
140
141
142 __d__
143
144
145 Delete the current partition. This will convert the current
146 partition into free space and merge it with any free space
147 immediately surrounding the current partition. A partition
148 already marked as free space or marked as unusable cannot be
149 deleted.
150
151
152 __g__
153
154
155 Change the disk geometry (cylinders, heads, or
156 sectors-per-track). __WARNING:__ This option should only
157 be used by people who know what they are doing. A command
158 line option is also available to change the disk geometry.
159 While at the change disk geometry command line, you can
160 choose to change cylinders (__c__), heads (__h__), and
161 sectors per track (__s__). The default value will be
162 printed at the prompt which you can accept by simply
163 pressing the ''Enter'' key, or you can exit without
164 changes by pressing the ''ESC'' key. If you want to
165 change the default value, simply enter the desired value and
166 press ''Enter''. The altered disk parameter values do not
167 take effect until you return the main menu (by pressing
168 ''Enter'' or ''ESC'' at the change disk geometry
169 command line. If you change the geometry such that the disk
170 appears larger, the extra sectors are added at the end of
171 the disk as free space. If the disk appears smaller, the
172 partitions that are beyond the new last sector are deleted
173 and the last partition on the drive (or the free space at
174 the end of the drive) is made to end at the new last
175 sector.
176
177
178 __h__
179
180
181 Print the help screen.
182
183
184 __m__
185
186
187 Maximize disk usage of the current partition. This command
188 will recover the the unused space between the partition
189 table and the beginning of the partition, but at the cost of
190 making the partition incompatible with DOS, OS/2 and
191 possibly other operating systems. This option will toggle
192 between maximal disk usage and DOS, OS/2, etc. compatible
193 disk usage. The default when creating a partition is to
194 create DOS, OS/2, etc. compatible partitions.
195
196
197 __n__
198
199
200 Create new partition from free space. If the partition type
201 is ''Primary'' or ''Logical'', a partition of that
202 type will be created, but if the partition type is
203 ''Pri/Log'', you will be prompted for the type you want
204 to create. Be aware that (1) there are only four slots
205 available for primary partitions and (2) since there can be
206 only one extended partition, which contains all of the
207 logical drives, all of the logical drives must be contiguous
208 (with no intervening primary partition). __cfdisk__ next
209 prompts you for the size of the partition you want to
210 create. The default size, equal to the entire free space of
211 the current partition, is display in megabytes. You can
212 either press the ''Enter'' key to accept the default size
213 or enter a different size at the prompt. __cfdisk__
214 accepts size entries in megabytes (__M__) [[default],
215 kilobytes (__K__), cylinders (__C__) and sectors
216 (__S__) by entering the number immediately followed by
217 one of (__M__, __K__, __C__ or __S__). If the
218 partition fills the free space available, the partition is
219 created and you are returned to the main command line.
220 Otherwise, the partition can be created at the beginning or
221 the end of the free space, and __cfdisk__ will ask you to
222 choose where to place the partition. After the partition is
223 created, __cfdisk__ automatically adjusts the other
224 partition's partition types if all of the primary partitions
225 are used.
226
227
228 __p__
229
230
231 Print the partition table to the screen or to a file. There
232 are several different formats for the partition that you can
233 choose from:
234
235
236 __r__
237
238
239 Raw data format (exactly what would be written to
240 disk)
241
242
243 __s__
244
245
246 Partition table in sector order format
247
248
249 __t__
250
251
252 Partition table in raw format
253
254
255 The ''raw data format'' will print the sectors that would
256 be written to disk if a __w__rite command is selected.
257 First, the primary partition table is printed, followed by
258 the partition tables associated with each logical partition.
259 The data is printed in hex byte by byte with 16 bytes per
260 line.
261
262
263 The ''partition table in sector order format'' will print
264 the partition table ordered by sector number. The fields,
265 from left to right, are the number of the partition, the
266 partition type, the first sector, the last sector, the
267 offset from the first sector of the partition to the start
268 of the data, the length of the partition, the filesystem
269 type (with the hex value in parenthesis), and the flags
270 (with the hex value in parenthesis). In addition to the
271 primary and logical partitions, free and unusable space is
272 printed and the extended partition is printed before the
273 first logical partition.
274
275
276 If a partition does not start or end on a cylinder boundary
277 or if the partition length is not divisible by the cylinder
278 size, an asterisks (__*__) is printed after the
279 non-aligned sector number/count. This usually indicates that
280 a partition was created by an operating system that either
281 does not align partitions to cylinder boundaries or that
282 used different disk geometry information. If you know the
283 disk geometry of the other operating system, you could enter
284 the geometry information with the change geometry command
285 (__g__).
286
287
288 For the first partition on the disk and for all logical
289 partitions, if the offset from the beginning of the
290 partition is not equal to the number of sectors per track
291 (i.e., the data does not start on the first head), a number
292 sign (__#__) is printed after the offset. For the
293 remaining partitions, if the offset is not zero, a number
294 sign will be printed after the offset. This corresponds to
295 the ''NC'' flag in the partitions section of the main
296 display.
297
298
299 The ''partition table in raw format'' will print the
300 partition table ordered by partition number. It will leave
301 out all free and unusable space. The fields, from left to
302 right, are the number of the partition, the flags (in hex),
303 the starting head, sector and cylinder, the filesystem ID
304 (in hex), the ending head, sector and cylinder, the starting
305 sector in the partition and the number of sectors in the
306 partition. The information in this table can be directly
307 translated to the ''raw data format''.
308
309
310 The partition table entries only have 10 bits available to
311 represent the starting and ending cylinders. Thus, when the
312 absolute starting (ending) sector number is on a cylinder
313 greater than 1023, the maximal values for starting (ending)
314 head, sector and cylinder are printed. This is the method
315 used by OS/2, and thus fixes the problems associated with
316 OS/2's fdisk rewriting the partition table when it is not in
317 this format. Since Linux and OS/2 use absolute sector
318 counts, the values in the starting and ending head, sector
319 and cylinder are not used.
320
321
322 __q__
323
324
325 Quit program. This will exit the program without writing any
326 data to disk.
327
328
329 __t__
330
331
332 Change the filesystem type. By default, new partitions are
333 created as ''Linux'' partitions, but since __cfdisk__
334 can create partitions for other operating systems, change
335 partition type allows you to enter the hex value of the
336 filesystem you desire. A list of the know filesystem types
337 is displayed. You can type in the filesystem type at the
338 prompt or accept the default filesystem type
339 [[''Linux''].
340
341
342 __u__
343
344
345 Change units of the partition size display. It will rotate
346 through megabytes, sectors and cylinders.
347
348
349 __W__
350
351
352 Write partition table to disk (must enter an upper case W).
353 Since this might destroy data on the disk, you must either
354 confirm or deny the write by entering `yes' or `no'. If you
355 enter `yes', __cfdisk__ will write the partition table to
356 disk and the tell the kernel to re-read the partition table
357 from the disk. The re-reading of the partition table works
358 is most cases, but I have seen it fail. Don't panic. It will
359 be correct after you reboot the system. In all cases, I
360 still recommend rebooting the system--just to be
361 safe.
362
363
364 ''Up Arrow''
365
366
367 ''Down Arrow''
368
369
370 Move cursor to the previous or next partition. If there are
371 more partitions than can be displayed on a screen, you can
372 display the next (previous) set of partitions by moving down
373 (up) at the last (first) partition displayed on the
374 screen.
375
376
377 ''CTRL-L''
378
379
380 Redraws the screen. In case something goes wrong and you
381 cannot read anything, you can refresh the screen from the
382 main command line.
383
384
385 __?__
386
387
388 Print the help screen.
389
390
391 All of the commands can be entered with either upper or
392 lower case letters (except for __W__rites). When in a
393 sub-menu or at a prompt to enter a filename, you can hit the
394 ''ESC'' key to return to the main command
395 line.
396 !!OPTIONS
397
398
399 __-a__
400
401
402 Use an arrow cursor instead of reverse video for
403 highlighting the current partition.
404
405
406 __-g__
407
408
409 Do not use the geometry given by the disk driver, but try to
410 guess a geometry from the partition table.
411
412
413 __-v__
414
415
416 Print the version number and copyright.
417
418
419 __-z__
420
421
422 Start with zeroed partition table. This option is useful
423 when you want to repartition your entire disk. ''Note:''
424 this option does not zero the partition table on the disk;
425 rather, it simply starts the program without reading the
426 existing partition table.
427
428
429 __-c__ ''cylinders''
430
431
432 __-h__ ''heads''
433
434
435 __-s__ ''sectors-per-track''
436
437
438 Override the number of cylinders, heads and sectors per
439 track read from the BIOS. If your BIOS or adapter does not
440 supply this information or if it supplies incorrect
441 information, use these options to set the disk geometry
442 values.
443
444
445 __-P__ ''opt''
446
447
448 Prints the partition table in specified formats. ''opt''
449 can be one or more of
450 ''p__rint command (above) for more
451 information on the print formats.
452 !!EXIT STATUS
453
454
455 0: No errors; 1: Invocation error; 2: I/O error; 3: cannot
456 get geometry; 4: bad partition table on disk.
457 !!SEE ALSO
458
459
460 fdisk(8), parted(8),
461 sfdisk(8)
462 !!BUGS
463
464
465 The current version does not support multiple
466 disks.
467 !!AUTHOR
468
469
470 Kevin E. Martin (martin@cs.unc.edu)
471 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.