resetting manifest requested domain to floor
[platform/upstream/gptfdisk.git] / cgdisk.html
1 Content-type: text/html
2
3 <HTML><HEAD><TITLE>Manpage of CGDISK</TITLE>
4 </HEAD><BODY>
5 <H1>CGDISK</H1>
6 Section: GPT fdisk Manual (8)<BR>Updated: 0.8.5<BR><A HREF="#index">Index</A>
7 <A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
8
9 <A NAME="lbAB">&nbsp;</A>
10 <H2>NAME</H2>
11
12 cgdisk - Curses-based GUID partition table (GPT) manipulator
13 <A NAME="lbAC">&nbsp;</A>
14 <H2>SYNOPSIS</H2>
15
16 <B>cgdisk </B>
17
18 <I>device</I>
19
20 <P>
21 <A NAME="lbAD">&nbsp;</A>
22 <H2>DESCRIPTION</H2>
23
24 <P>
25 GPT fdisk is a text-mode family of programs for creation and manipulation
26 of partition tables. The <B>cgdisk</B> member of this family employs a
27 curses-based user interface for interaction using a text-mode menuing
28 system. It will automatically convert an old-style Master Boot Record
29 (MBR) partition table or BSD disklabel stored without an MBR carrier
30 partition to the newer Globally Unique Identifier (GUID) Partition Table
31 (GPT) format, or will load a GUID partition table. Other members of this
32 program family are <B>gdisk</B> (the most feature-rich program of the group,
33 with a non-curses-based interactive user interface) and <B>sgdisk</B> (which
34 is driven via command-line options for use by experts or in scripts).
35 FixParts is a related program for fixing a limited set of problems with MBR
36 disks.
37 <P>
38 For information on MBR vs. GPT, as well as GPT terminology and structure,
39 see the extended GPT fdisk documentation at
40 <I><A HREF="http://www.rodsbooks.com/gdisk/">http://www.rodsbooks.com/gdisk/</A></I> or consult Wikipedia.
41 <P>
42 The <B>cgdisk</B> program employs a user interface similar to that of Linux's
43 <B>cfdisk</B>, but <B>cgdisk</B> modifies GPT partitions. It also has the
44 capability of transforming MBR partitions or BSD disklabels into GPT
45 partitions. Like the original <B>cfdisk</B> program, <B>cgdisk</B> does not
46 modify disk structures until you explicitly write them to disk, so if you
47 make a mistake, you can exit from the program with the Quit option to leave
48 your partitions unmodified.
49 <P>
50 Ordinarily, <B>cgdisk</B> operates on disk device files, such as
51 <I>/dev/sda</I> or <I>/dev/hda</I> under Linux, <I>/dev/disk0</I> under
52 Mac OS X, or <I>/dev/ad0</I> or <I>/dev/da0</I> under FreeBSD. The program
53 can also operate on disk image files, which can be either copies of whole
54 disks (made with <B>dd</B>, for instance) or raw disk images used by
55 emulators such as QEMU or VMWare. Note that only <I>raw</I> disk images
56 are supported; <B>cgdisk</B> cannot work on compressed or other advanced
57 disk image formats.
58 <P>
59 Upon start, <B>cgdisk</B> attempts to identify the partition type in use on
60 the disk. If it finds valid GPT data, <B>cgdisk</B> will use it. If
61 <B>cgdisk</B> finds a valid MBR or BSD disklabel but no GPT data, it will
62 attempt to convert the MBR or disklabel into GPT form. (BSD disklabels are
63 likely to have unusable first and/or final partitions because they overlap
64 with the GPT data structures, though.) Upon exiting with the 'w' option,
65 <B>cgdisk</B> replaces the MBR or disklabel with a GPT. <I>This action is
66 potentially dangerous!</I> Your system may become unbootable, and partition
67 type codes may become corrupted if the disk uses unrecognized type codes.
68 Boot problems are particularly likely if you're multi-booting with any
69 GPT-unaware OS. If you mistakenly launch <B>cgdisk</B> on an MBR disk, you
70 can safely exit the program without making any changes by using the Quit
71 option.
72 <P>
73 When creating a fresh partition table, certain considerations may be in
74 order:
75 <P>
76 <DL COMPACT>
77 <DT><B>*</B>
78
79 <DD>
80 For data (non-boot) disks, and for boot disks used on BIOS-based computers
81 with GRUB as the boot loader, partitions may be created in whatever order
82 and in whatever sizes are desired.
83 <P>
84 <DT><B>*</B>
85
86 <DD>
87 Boot disks for EFI-based systems require an <I>EFI System
88 Partition</I> (GPT fdisk internal code 0xEF00) formatted as FAT-32.
89 The recommended size of this partition is between 100 and 300 MiB.
90 Boot-related files are stored here. (Note that GNU Parted identifies
91 such partitions as having the &quot;boot flag&quot; set.)
92 <P>
93 <DT><B>*</B>
94
95 <DD>
96 The GRUB 2 boot loader for BIOS-based systems makes use of a <I>BIOS Boot
97 Partition</I> (GPT fdisk internal code 0xEF02), in which the secondary
98 boot loader is stored, without the benefit of a filesystem. This partition
99 can typically be quite small (roughly 32 KiB to 1 MiB), but you should
100 consult your boot loader documentation for details.
101 <P>
102 <DT><B>*</B>
103
104 <DD>
105 If Windows is to boot from a GPT disk, a partition of type <I>Microsoft
106 Reserved</I> (GPT fdisk
107 internal code 0x0C01) is recommended. This partition should be about 128 MiB
108 in size. It ordinarily follows the EFI System Partition and immediately
109 precedes the Windows data partitions. (Note that old versions of GNU Parted
110 create all FAT partitions as this type, which actually makes the partition
111 unusable for normal file storage in both Windows and Mac OS X.)
112 <P>
113 <DT><B>*</B>
114
115 <DD>
116 Some OSes' GPT utilities create some blank space (typically 128 MiB) after
117 each partition. The intent is to enable future disk utilities to use this
118 space. Such free space is not required of GPT disks, but creating it may
119 help in future disk maintenance. You can use GPT fdisk's relative partition
120 positioning option (specifying the starting sector as '+128M', for
121 instance) to simplify creating such gaps.
122 <P>
123 </DL>
124 <A NAME="lbAE">&nbsp;</A>
125 <H2>OPTIONS</H2>
126
127 <P>
128 <P>
129
130 <P>
131 Interactions with <B>cgdisk</B> occur with its interactive text-mode menus.
132 The display is broken into two interactive parts:
133 <P>
134 <DL COMPACT>
135 <DT><B>*</B>
136
137 <DD>
138 The partition display area, in which partitions and gaps between them
139 (marked as &quot;free space&quot;) are summarized.
140 <P>
141 <DT><B>*</B>
142
143 <DD>
144 The option selection area, in which buttons for the main options appear.
145 <P>
146 </DL>
147 <P>
148
149 <P>
150 In addition, the top of the display shows the program's name and version
151 number, the device filename associated with the disk, and the disk's size
152 in both sectors and IEEE-1541 units (GiB, TiB, and so on).
153 <P>
154 You can use the following keys to move among the various options and to
155 select among them:
156 <P>
157 <DL COMPACT>
158 <DT><B>up arrow</B>
159
160 <DD>
161 This key moves the partition selection up by one partition.
162 <P>
163 <DT><B>down arrow</B>
164
165 <DD>
166 This key moves the partition selection down by one partition.
167 <P>
168 <DT><B>Page Up</B>
169
170 <DD>
171 This key moves the partition selection up by one screen.
172 <P>
173 <DT><B>Page Down</B>
174
175 <DD>
176 This key moves the partition selection down by one screen.
177 <P>
178 <DT><B>right arrow</B>
179
180 <DD>
181 This key moves the option selection to the right by one item.
182 <P>
183 <DT><B>left arrow</B>
184
185 <DD>
186 This key moves the option selection to the left by one item.
187 <P>
188 <DT><B>Enter</B>
189
190 <DD>
191 This key activates the currently selected option. You can also activate an
192 option by typing the capitalized letter in the option's name on the
193 keyboard, such as <B>a</B> to activate the Align option.
194 <P>
195 </DL>
196 <P>
197
198 <P>
199 If more partitions exist than can be displayed in one screen, you can
200 scroll between screens using the partition selection keys, much as in a
201 text editor.
202 <P>
203 Available options are as described below. (Note that <B>cgdisk</B> provides
204 a much more limited set of options than its sibling <B>gdisk</B>. If you
205 need to perform partition table recovery, hybrid MBR modifcation, or other
206 advanced operations, you should consult the <B>gdisk</B> documentation.)
207 <P>
208 <DL COMPACT>
209 <DT><B>Align</B>
210
211 <DD>
212 Change the sector alignment value. Disks with more logical sectors than
213 physical sectors (such as modern Advanced Format drives), some RAID
214 configurations, and many SSD devices, can suffer performance problems if
215 partitions are not aligned properly for their internal data structures. On
216 new disks, GPT fdisk attempts to align partitions on 2048-sector (1MiB)
217 boundaries by default, which optimizes performance for all of these disk
218 types. On pre-partitioned disks, GPT fdisk attempts to identify the
219 alignment value used on that disk, but will set 8-sector alignment on disks
220 larger than 300 GB even if lesser alignment values are detected. In either
221 case, it can be changed by using this option.
222 <P>
223 <DT><B>Backup</B>
224
225 <DD>
226 Save partition data to a backup file. You can back up your current
227 in-memory partition table to a disk file using this option. The resulting
228 file is a binary file consisting of the protective MBR, the main GPT
229 header, the backup GPT header, and one copy of the partition table, in that
230 order. Note that the backup is of the current in-memory data structures, so
231 if you launch the program, make changes, and then use this option, the
232 backup will reflect your changes.
233 <P>
234 <DT><B>Delete</B>
235
236 <DD>
237 Delete a partition. This action deletes the entry from the partition table
238 but does not disturb the data within the sectors originally allocated to
239 the partition on the disk. If a corresponding hybrid MBR partition exists,
240 <B>gdisk</B> deletes it, as well, and expands any adjacent 0xEE (EFI GPT)
241 MBR protective partition to fill the new free space.
242 <P>
243 <DT><B>Help</B>
244
245 <DD>
246 Print brief descriptions of all the options.
247 <P>
248 <DT><B>Info</B>
249
250 <DD>
251 Show detailed partition information. The summary information shown in the
252 partition display area necessarily omits many details, such as the
253 partitions' unique GUIDs and the partitions' sector-exact start and end
254 points. The Info option displays this information for a single partition.
255 <P>
256 <DT><B>Load</B>
257
258 <DD>
259 Load partition data from a backup file. This option is the reverse of the
260 Backup option. Note that restoring partition data from anything but the
261 original disk is not recommended.
262 <P>
263 <DT><B>naMe</B>
264
265 <DD>
266 Change the GPT name of a partition. This name is encoded as a UTF-16
267 string, but proper entry and display of anything beyond basic ASCII values
268 requires suitable locale and font support. For the most part, Linux ignores
269 the partition name, but it may be important in some OSes. GPT fdisk sets a
270 default name based on the partition type code. Note that the GPT partition
271 name is different from the filesystem name, which is encoded in the
272 filesystem's data structures. Note also that to activate this item by
273 typing its alphabetic equivalent, you must use <B>M</B>, not the more
274 obvious <B>N</B>, because the latter is used by the next option....
275 <P>
276 <DT><B>New</B>
277
278 <DD>
279 Create a new partition. You enter a starting sector, a size, a type code,
280 and a name. The start sector can be specified in absolute terms as a sector
281 number or as a position measured in kibibytes (K), mebibytes (M), gibibytes
282 (G), tebibytes (T), or pebibytes (P); for instance, <I></I><B>40M</B>
283 specifies a position 40MiB from the start of the disk. You can specify
284 locations relative to the start or end of the specified default range by
285 preceding the number by a '+' symbol, as in <I></I><B>+2G</B> to specify a
286 point 2GiB after the default start sector. The size value can use the K, M,
287 G, T, and P suffixes, too. Pressing the Enter key with no input specifies
288 the default value, which is the start of the largest available block for
289 the start sector and the full available size for the size.
290 <P>
291 <DT><B>Quit</B>
292
293 <DD>
294 Quit from the program <I>without saving your changes</I>.
295 Use this option if you just wanted to view information or if you make a
296 mistake and want to back out of all your changes.
297 <P>
298 <DT><B>Type</B>
299
300 <DD>
301 Change a single partition's type code. You enter the type code using a
302 two-byte hexadecimal number. You may also enter a GUID directly, if you
303 have one and <B>cgdisk</B> doesn't know it. If you don't know the type code
304 for your partition, you can type <B>L</B> to see a list of known type codes.
305 <P>
306 <DT><B>Verify</B>
307
308 <DD>
309 Verify disk. This option checks for a variety of problems, such as
310 incorrect CRCs and mismatched main and backup data. This option does not
311 automatically correct most problems, though; for that, you must use
312 <B>gdisk</B>. If no problems are found, this command displays a summary of
313 unallocated disk space.
314 <P>
315 <DT><B>Write</B>
316
317 <DD>
318 Write data. Use this command to save your changes.
319 <P>
320 </DL>
321 <A NAME="lbAF">&nbsp;</A>
322 <H2>BUGS</H2>
323
324 <P>
325 As of May 2012 (version 0.8.5), <B>cgdisk</B> should be considered
326 beta software. Although the underlying partition manipulation code is much
327 older, the <B>cgdisk</B> ncurses user interface is brand new with GPT fdisk
328 version 0.8.0. Known bugs and limitations include:
329 <P>
330 <DL COMPACT>
331 <DT><B>*</B>
332
333 <DD>
334 The program compiles correctly only on Linux, FreeBSD, and Mac OS X. In
335 theory, it should compile under Windows if the Ncurses library for Windows
336 is installed, but I have not tested this capability. Linux versions for
337 x86-64 (64-bit), x86 (32-bit), and PowerPC (32-bit) have been tested,
338 with the x86-64 version having seen the most testing. Under FreeBSD,
339 32-bit (x86) and 64-bit (x86-64) versions have been tested. Only 32-bit
340 versions for Mac OS X has been tested by the author.
341 <P>
342 <DT><B>*</B>
343
344 <DD>
345 The FreeBSD version of the program can't write changes to the partition
346 table to a disk when existing partitions on that disk are mounted. (The
347 same problem exists with many other FreeBSD utilities, such as
348 <B>gpt</B>, <B>fdisk</B>, and <B>dd</B>.) This limitation can be overcome
349 by typing <B>sysctl kern.geom.debugflags=16</B> at a shell prompt.
350 <P>
351 <DT><B>*</B>
352
353 <DD>
354 The program can load only up to 128 partitions (4 primary partitions and
355 124 logical partitions) when converting from MBR format. This limit can
356 be raised by changing the <I>#define MAX_MBR_PARTS</I> line in the
357 <I>basicmbr.h</I> source code file and recompiling; however, such a change
358 will require using a larger-than-normal partition table. (The limit
359 of 128 partitions was chosen because that number equals the 128 partitions
360 supported by the most common partition table size.)
361 <P>
362 <DT><B>*</B>
363
364 <DD>
365 Converting from MBR format sometimes fails because of insufficient space at
366 the start or (more commonly) the end of the disk. Resizing the partition
367 table (using the 's' option in the experts' menu in <B>gdisk</B>) can
368 sometimes overcome this problem; however, in extreme cases it may be
369 necessary to resize a partition using GNU Parted or a similar tool prior to
370 conversion with GPT fdisk.
371 <P>
372 <DT><B>*</B>
373
374 <DD>
375 MBR conversions work only if the disk has correct LBA partition
376 descriptors. These descriptors should be present on any disk over 8 GiB in
377 size or on smaller disks partitioned with any but very ancient software.
378 <P>
379 <DT><B>*</B>
380
381 <DD>
382 BSD disklabel support can create first and/or last partitions that overlap
383 with the GPT data structures. This can sometimes be compensated by
384 adjusting the partition table size, but in extreme cases the affected
385 partition(s) may need to be deleted.
386 <P>
387 <DT><B>*</B>
388
389 <DD>
390 Because of the highly variable nature of BSD disklabel structures,
391 conversions from this form may be unreliable -- partitions may be dropped,
392 converted in a way that creates overlaps with other partitions, or
393 converted with incorrect start or end values. Use this feature with
394 caution!
395 <P>
396 <DT><B>*</B>
397
398 <DD>
399 Booting after converting an MBR or BSD disklabel disk is likely to be
400 disrupted. Sometimes re-installing a boot loader will fix the problem, but
401 other times you may need to switch boot loaders. Except on EFI-based
402 platforms, Windows through at least Windows 7 doesn't support booting from
403 GPT disks. Creating a hybrid MBR (using the 'h' option on the recovery &amp;
404 transformation menu in <B>gdisk</B>) or abandoning GPT in favor of MBR may
405 be your only options in this case.
406 <P>
407 <DT><B>*</B>
408
409 <DD>
410 The <B>cgdisk</B> Verify function and the partition type listing obtainable
411 by typing <I>L</I> in the Type function (or when specifying a partition type
412 while creating a new partition) both currently exit ncurses mode. This
413 limitation is a minor cosmetic blemish that does not affect functionality.
414 <P>
415 </DL>
416 <A NAME="lbAG">&nbsp;</A>
417 <H2>AUTHORS</H2>
418
419 Primary author: Roderick W. Smith (<A HREF="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</A>)
420 <P>
421 Contributors:
422 <P>
423 * Yves Blusseau (<A HREF="mailto:1otnwmz02@sneakemail.com">1otnwmz02@sneakemail.com</A>)
424 <P>
425 * David Hubbard (<A HREF="mailto:david.c.hubbard@gmail.com">david.c.hubbard@gmail.com</A>)
426 <P>
427 * Justin Maggard (<A HREF="mailto:justin.maggard@netgear.com">justin.maggard@netgear.com</A>)
428 <P>
429 * Dwight Schauer (<A HREF="mailto:dschauer@ti.com">dschauer@ti.com</A>)
430 <P>
431 * Florian Zumbiehl (<A HREF="mailto:florz@florz.de">florz@florz.de</A>)
432 <P>
433 <P>
434 <A NAME="lbAH">&nbsp;</A>
435 <H2>SEE ALSO</H2>
436
437 <B>cfdisk (8)</B>,
438 <B>fdisk (8)</B>,
439 <B>gdisk (8)</B>,
440 <B>mkfs (8)</B>,
441 <B>parted (8)</B>,
442 <B>sfdisk (8)</B>
443 <B>sgdisk (8)</B>
444 <B>fixparts (8)</B>
445 <P>
446 <I><A HREF="http://en.wikipedia.org/wiki/GUID_Partition_Table">http://en.wikipedia.org/wiki/GUID_Partition_Table</A></I>
447 <P>
448 <I><A HREF="http://developer.apple.com/technotes/tn2006/tn2166.html">http://developer.apple.com/technotes/tn2006/tn2166.html</A></I>
449 <P>
450 <I><A HREF="http://www.rodsbooks.com/gdisk/">http://www.rodsbooks.com/gdisk/</A></I>
451 <P>
452 <A NAME="lbAI">&nbsp;</A>
453 <H2>AVAILABILITY</H2>
454
455 The <B>cgdisk</B> command is part of the <I>GPT fdisk</I> package and is
456 available from Rod Smith.
457 <P>
458
459 <HR>
460 <A NAME="index">&nbsp;</A><H2>Index</H2>
461 <DL>
462 <DT><A HREF="#lbAB">NAME</A><DD>
463 <DT><A HREF="#lbAC">SYNOPSIS</A><DD>
464 <DT><A HREF="#lbAD">DESCRIPTION</A><DD>
465 <DT><A HREF="#lbAE">OPTIONS</A><DD>
466 <DT><A HREF="#lbAF">BUGS</A><DD>
467 <DT><A HREF="#lbAG">AUTHORS</A><DD>
468 <DT><A HREF="#lbAH">SEE ALSO</A><DD>
469 <DT><A HREF="#lbAI">AVAILABILITY</A><DD>
470 </DL>
471 <HR>
472 This document was created by
473 <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
474 using the manual pages.<BR>
475 Time: 15:38:43 GMT, May 30, 2012
476 </BODY>
477 </HTML>