]>
Commit | Line | Data |
---|---|---|
726f69e2 KZ |
1 | .\" cfdisk.8 -- man page for cfdisk |
2 | .\" Copyright 1994 Kevin E. Martin (martin@cs.unc.edu) | |
3 | .\" | |
4 | .\" Permission is granted to make and distribute verbatim copies of this | |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
12 | .\" | |
13 | .\" " for hilit mode | |
14 | .TH CFDISK 8 "25 April 1994" "The BOGUS Linux Release" "Linux Programmer's Manual" | |
15 | .SH NAME | |
16 | cfdisk \- Curses based disk partition table manipulator for Linux | |
17 | .SH SYNOPSIS | |
18 | .BI "cfdisk [ \-avz ] [ \-c " cylinders " ] [ \-h " heads " ]" | |
19 | .BI "[ \-s " sectors-per-track " ] [ -P " opt " ] [ " device " ]" | |
20 | .SH DESCRIPTION | |
21 | .B cfdisk | |
22 | is a curses based program for partitioning a hard disk drive. The | |
23 | .I device | |
24 | can be any one of the following: | |
25 | .sp | |
26 | .nf | |
27 | .RS | |
28 | /dev/hda [default] | |
29 | /dev/hdb | |
30 | /dev/sda | |
31 | /dev/sdb | |
32 | /dev/sdc | |
33 | /dev/sdd | |
34 | .RE | |
35 | .fi | |
36 | ||
37 | .B cfdisk | |
38 | first tries to read the geometry of the hard disk. If it fails, an | |
39 | error message is displayed and | |
40 | .B cfdisk | |
41 | exits. This should only happen when partitioning a SCSI drive on an | |
42 | adapter without a BIOS. To correct this problem, you can set the | |
43 | .IR cylinders ", " heads " and " sectors-per-track | |
44 | on the command line. Next, | |
45 | .B cfdisk | |
46 | tries to read the current partition table from the disk drive. If it | |
47 | is unable to figure out the partition table, an error is displayed and | |
48 | the program will exit. This might also be caused by incorrect | |
49 | geometry information, and can be overridden on the command line. | |
50 | Another way around this problem is with the | |
51 | .B \-z | |
52 | option. This will ignore the partition table on the disk. | |
53 | ||
54 | The main display is composed of four sections, from top to bottom: the | |
55 | header, the partitions, the command line and a warning line. The | |
56 | header contains the program name and version number followed by the | |
57 | disk drive and its geometry. The partitions section always displays | |
58 | the current partition table. The command line is the place where | |
59 | commands and text are entered. The available commands are usually | |
60 | displayed in brackets. The warning line is usually empty except when | |
61 | there is important information to be displayed. The current partition | |
62 | is highlighted with reverse video (or an arrow if the | |
63 | .B \-a | |
64 | option is given). All partition specific commands apply to the | |
65 | current partition. | |
66 | ||
67 | The format of the partition table in the partitions section is, from | |
68 | left to right: Name, Flags, Partition Type, Filesystem Type and Size. | |
69 | The name is the partition device name. The flags can be | |
70 | .IR Boot , | |
71 | which designates a bootable partition or | |
72 | .IR NC , | |
73 | which stands for "Not Compatible with DOS or OS/2". DOS, OS/2 and | |
74 | possibly other operating systems require the first sector of the first | |
75 | partition on the disk and all logical partitions to begin on the | |
76 | second head. This wastes the second through the last sector of the | |
77 | first track of the first head (the first sector is taken by the | |
78 | partition table itself). | |
79 | .B cfdisk | |
80 | allows you to recover these "lost" sectors with the maximize command | |
81 | .RB ( m ). | |
82 | .I Note: | |
83 | .BR fdisk (8) | |
84 | and some early versions of DOS create all partitions with the number | |
85 | of sectors already maximized. For more information, see the maximize | |
86 | command below. The partition type can be one of | |
87 | .IR Primary " or " Logical . | |
88 | For unallocated space on the drive, the partition type can also be | |
89 | .IR Pri/Log , | |
90 | or empty (if the space is unusable). The filesystem type section | |
91 | displays the name of the filesystem used on the partition, if known. | |
92 | If it is unknown, then | |
93 | .I Unknown | |
94 | and the hex value of the filesystem type are displayed. A special | |
95 | case occurs when there are sections of the disk drive that cannot be | |
96 | used (because all of the primary partitions are used). When this is | |
97 | detected, the filesystem type is displayed as | |
98 | .IR Unusable . | |
99 | The size field displays the size of the partition in megabytes (by | |
100 | default). It can also display the size in sectors and cylinders (see | |
101 | the change units command below). If an asterisks | |
102 | .RB ( * ) | |
103 | appears after the size, this means that the partition is not aligned | |
104 | on cylinder boundaries. | |
105 | .SH "DOS 6.x WARNING" | |
106 | ||
107 | The DOS 6.x FORMAT command looks for some information in the first | |
108 | sector of the data area of the partition, and treats this information | |
109 | as more reliable than the information in the partition table. DOS | |
110 | FORMAT expects DOS FDISK to clear the first 512 bytes of the data area | |
111 | of a partition whenever a size change occurs. DOS FORMAT will look at | |
112 | this extra information even if the /U flag is given -- we consider | |
113 | this a bug in DOS FORMAT and DOS FDISK. | |
114 | ||
115 | The bottom line is that if you use cfdisk or fdisk to change the size of a | |
116 | DOS partition table entry, then you must also use | |
117 | .B dd | |
118 | to zero the first 512 bytes of that partition before using DOS FORMAT to | |
119 | format the partition. For example, if you were using cfdisk to make a DOS | |
120 | partition table entry for /dev/hda1, then (after exiting fdisk or cfdisk | |
121 | and rebooting Linux so that the partition table information is valid) you | |
122 | would use the command "dd if=/dev/zero of=/dev/hda1 bs=512 count=1" to zero | |
123 | the first 512 bytes of the partition. | |
124 | .B BE EXTREMELY CAREFUL | |
125 | if you use the | |
126 | .B dd | |
127 | command, since a small typo can make all of the data on your disk useless. | |
128 | ||
129 | .B BE EXTREMELY CAREFUL | |
130 | if you use the | |
131 | .B dd | |
132 | command, since a small typo can make all of the data on your disk useless. | |
133 | ||
134 | For best resutls, you should always use an OS-specific partition table | |
135 | program. For example, you should make DOS partitions with the DOS FDISK | |
136 | program and Linux partitions with the Linux fdisk or Linux cfdisk program. | |
137 | ||
138 | .SH COMMANDS | |
139 | .B cfdisk | |
140 | commands can be entered by pressing the desired key (pressing | |
141 | .I Enter | |
142 | after the command is not necessary). Here is a list of the available | |
143 | commands: | |
144 | .TP | |
145 | .B b | |
146 | Toggle bootable flag of the current partition. This allows you to | |
147 | select which primary partition is bootable on the drive. | |
148 | .TP | |
149 | .B d | |
150 | Delete the current partition. This will convert the current partition | |
151 | into free space and merge it with any free space immediately | |
152 | surrounding the current partition. A partition already marked as free | |
153 | space or marked as unusable cannot be deleted. | |
154 | .TP | |
155 | .B g | |
156 | Change the disk geometry (cylinders, heads, or sectors-per-track). | |
157 | .B WARNING: | |
158 | This option should only be used by people who know what they are | |
159 | doing. A command line option is also available to change the disk | |
160 | geometry. While at the change disk geometry command line, you can | |
161 | choose to change cylinders | |
162 | .RB ( c ), | |
163 | heads | |
164 | .RB ( h ), | |
165 | and sectors per track | |
166 | .RB ( s ). | |
167 | The default value will be printed at the prompt which you can accept | |
168 | by simply pressing the | |
169 | .I Enter | |
170 | key, or you can exit without changes by pressing the | |
171 | .I ESC | |
172 | key. If you want to change the default value, simply enter the | |
173 | desired value and press | |
174 | .IR Enter . | |
175 | The altered disk parameter values do not take effect until you return | |
176 | the main menu (by pressing | |
177 | .IR Enter " or " ESC | |
178 | at the change disk geometry command line. If you change the geometry | |
179 | such that the disk appears larger, the extra sectors are added at the | |
180 | end of the disk as free space. If the disk appears smaller, the | |
181 | partitions that are beyond the new last sector are deleted and the | |
182 | last partition on the drive (or the free space at the end of the | |
183 | drive) is made to end at the new last sector. | |
184 | .TP | |
185 | .B h | |
186 | Print the help screen. | |
187 | .TP | |
188 | .B m | |
189 | Maximize disk usage of the current partition. This command will | |
190 | recover the the unused space between the partition table and the | |
191 | beginning of the partition, but at the cost of making the partition | |
192 | incompatible with DOS, OS/2 and possibly other operating systems. | |
193 | This option will toggle between maximal disk usage and DOS, OS/2, | |
194 | etc. compatible disk usage. The default when creating a partition is | |
195 | to create DOS, OS/2, etc. compatible partitions. | |
196 | .TP | |
197 | .B n | |
198 | Create new partition from free space. If the partition type is | |
199 | .IR Primary " or " Logical , | |
200 | a partition of that type will be created, but if the partition type is | |
201 | .IR Pri/Log , | |
202 | you will be prompted for the type you want to create. Be aware that | |
203 | (1) there are only four slots available for primary partitions and (2) | |
204 | since there can be only one extended partition, which contains all of | |
205 | the logical drives, all of the logical drives must be contiguous (with | |
206 | no intervening primary partition). | |
207 | .B cfdisk | |
208 | next prompts you for the size of the partition you want to create. | |
209 | The default size, equal to the entire free space of the current | |
210 | partition, is display in megabytes. You can either press the | |
211 | .I Enter | |
212 | key to accept the default size or enter a different size at the | |
213 | prompt. | |
214 | .B cfdisk | |
215 | accepts size entries in megabytes | |
216 | .RB ( M ) | |
217 | [default], kilobytes | |
218 | .RB ( K ), | |
219 | cylinders | |
220 | .RB ( C ) | |
221 | and sectors | |
222 | .RB ( S ) | |
223 | by entering the number immediately followed by one of | |
224 | .RB ( M ", " K ", " C " or " S ). | |
225 | If the partition fills the free space available, the partition is | |
226 | created and you are returned to the main command line. Otherwise, the | |
227 | partition can be created at the beginning or the end of the free | |
228 | space, and | |
229 | .B cfdisk | |
230 | will ask you to choose where to place the partition. After the | |
231 | partition is created, | |
232 | .B cfdisk | |
233 | automatically adjusts the other partition's partition types if all of | |
234 | the primary partitions are used. | |
235 | .TP | |
236 | .B p | |
237 | Print the partition table to the screen or to a file. There are | |
238 | several different formats for the partition that you can choose from: | |
239 | .sp | |
240 | .RS | |
241 | .TP | |
242 | .B r | |
243 | Raw data format (exactly what would be written to disk) | |
244 | .TP | |
245 | .B s | |
246 | Partition table in sector order format | |
247 | .TP | |
248 | .B t | |
249 | Partition table in raw format | |
250 | .RE | |
251 | ||
252 | .RS | |
253 | The | |
254 | .I raw data format | |
255 | will print the sectors that would be written to disk if a | |
256 | .BR w rite | |
257 | command is selected. First, the primary partition table is printed, | |
258 | followed by the partition tables associated with each logical | |
259 | partition. The data is printed in hex byte by byte with 16 bytes per | |
260 | line. | |
261 | ||
262 | The | |
263 | .I partition table in sector order format | |
264 | will print the partition table ordered by sector number. The fields, | |
265 | from left to right, are the number of the partition, the partition | |
266 | type, the first sector, the last sector, the offset from the first | |
267 | sector of the partition to the start of the data, the length of the | |
268 | partition, the filesystem type (with the hex value in parenthesis), | |
269 | and the flags (with the hex value in parenthesis). In addition to the | |
270 | primary and logical partitions, free and unusable space is printed and | |
271 | the extended partition is printed before the first logical partition. | |
272 | ||
273 | If a partition does not start or end on a cylinder boundary or if the | |
274 | partition length is not divisible by the cylinder size, an asterisks | |
275 | .RB ( * ) | |
276 | is printed after the non-aligned sector number/count. This usually | |
277 | indicates that a partition was created by an operating system that | |
278 | either does not align partitions to cylinder boundaries or that used | |
279 | different disk geometry information. If you know the disk geometry of | |
280 | the other operating system, you could enter the geometry information | |
281 | with the change geometry command | |
282 | .RB ( g ). | |
283 | ||
284 | For the first partition on the disk and for all logical partitions, if | |
285 | the offset from the beginning of the partition is not equal to the | |
286 | number of sectors per track (i.e., the data does not start on the | |
287 | first head), a number sign | |
288 | .RB ( # ) | |
289 | is printed after the offset. For the remaining partitions, if the | |
290 | offset is not zero, a number sign will be printed after the offset. | |
291 | This corresponds to the | |
292 | .I NC | |
293 | flag in the partitions section of the main display. | |
294 | ||
295 | The | |
296 | .I partition table in raw format | |
297 | will print the partition table ordered by partition number. It will | |
298 | leave out all free and unusable space. The fields, from left to | |
299 | right, are the number of the partition, the flags (in hex), the | |
300 | starting head, sector and cylinder, the filesystem ID (in hex), the | |
301 | ending head, sector and cylinder, the starting sector in the partition | |
302 | and the number of sectors in the partition. The information in this | |
303 | table can be directly translated to the | |
304 | .IR "raw data format" . | |
305 | ||
306 | The partition table entries only have 10 bits available to represent | |
307 | the starting and ending cylinders. Thus, when the absolute starting | |
308 | (ending) sector number is on a cylinder greater than 1023, the maximal | |
309 | values for starting (ending) head, sector and cylinder are printed. | |
310 | This is the method used by OS/2, and thus fixes the problems | |
311 | associated with OS/2's fdisk rewriting the partition table when it is | |
312 | not in this format. Since Linux and OS/2 use absolute sector counts, | |
313 | the values in the starting and ending head, sector and cylinder are | |
314 | not used. | |
315 | .RE | |
316 | .TP | |
317 | .B q | |
318 | Quit program. This will exit the program without writing any data to | |
319 | disk. | |
320 | .TP | |
321 | .B t | |
322 | Change the filesystem type. By default, new partitions are created as | |
323 | .I Linux | |
324 | partitions, but since | |
325 | .B cfdisk | |
326 | can create partitions for other operating systems, change partition | |
327 | type allows you to enter the hex value of the filesystem you desire. | |
328 | A list of the know filesystem types is displayed. You can type in the | |
329 | filesystem type at the prompt or accept the default filesystem type | |
330 | .RI [ Linux ]. | |
331 | .TP | |
332 | .B u | |
333 | Change units of the partition size display. It will rotate through | |
334 | megabytes, sectors and cylinders. | |
335 | .TP | |
336 | .B W | |
337 | Write partition table to disk (must enter an upper case W). Since | |
338 | this might destroy data on the disk, you must either confirm or deny | |
339 | the write by entering `yes' or `no'. If you enter `yes', | |
340 | .B cfdisk | |
341 | will write the partition table to disk and the tell the kernel to | |
342 | re-read the partition table from the disk. The re-reading of the | |
343 | partition table works is most cases, but I have seen it fail. Don't | |
344 | panic. It will be correct after you reboot the system. In all cases, | |
345 | I still recommend rebooting the system--just to be safe. | |
346 | .TP | |
347 | .I Up Arrow | |
348 | .TP | |
349 | .I Down Arrow | |
350 | Move cursor to the previous or next partition. If there are more | |
351 | partitions than can be displayed on a screen, you can display the next | |
352 | (previous) set of partitions by moving down (up) at the last (first) | |
353 | partition displayed on the screen. | |
354 | .TP | |
355 | .I CTRL-L | |
356 | Redraws the screen. In case something goes wrong and you cannot read | |
357 | anything, you can refresh the screen from the main command line. | |
358 | .TP | |
359 | .B ? | |
360 | Print the help screen. | |
361 | ||
362 | .RE | |
363 | All of the commands can be entered with either upper or lower case | |
364 | letters (except for | |
365 | .BR W rites). | |
366 | When in a sub-menu or at a prompt to enter a filename, you can hit the | |
367 | .I ESC | |
368 | key to return to the main command line. | |
369 | .SH OPTIONS | |
370 | .TP | |
371 | .B \-a | |
372 | Use an arrow cursor instead of reverse video for highlighting the | |
373 | current partition. | |
374 | .TP | |
375 | .B \-v | |
376 | Print the version number and copyright. | |
377 | .TP | |
378 | .B \-z | |
379 | Start with zeroed partition table. This option is useful when you | |
380 | want to repartition your entire disk. | |
381 | .I Note: | |
382 | this option does not zero the partition table on the disk; rather, it | |
383 | simply starts the program without reading the existing partition | |
384 | table. | |
385 | .TP | |
386 | .BI \-c " cylinders" | |
387 | .TP | |
388 | .BI \-h " heads" | |
389 | .TP | |
390 | .BI \-s " sectors-per-track" | |
391 | Override the number of cylinders, heads and sectors per track read | |
392 | from the BIOS. If your BIOS or adapter does not supply this | |
393 | information or if it supplies incorrect information, use these options | |
394 | to set the disk geometry values. | |
395 | .TP | |
396 | .BI \-P " opt" | |
397 | Prints the partition table in specified formats. | |
398 | .I opt | |
399 | can be one or more of "r", "s" or "t". See the | |
400 | .BR p rint | |
401 | command (above) for more information on the print formats. | |
402 | .SH "SEE ALSO" | |
403 | fdisk(8) | |
404 | .SH BUGS | |
405 | The current version does not support multiple disks (future addition). | |
406 | .SH AUTHOR | |
407 | Kevin E. Martin (martin@cs.unc.edu) |