resetting manifest requested domain to floor
[platform/upstream/gptfdisk.git] / gdisk.html
1 Content-type: text/html
2
3 <HTML><HEAD><TITLE>Manpage of GDISK</TITLE>
4 </HEAD><BODY>
5 <H1>GDISK</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 gdisk - Interactive GUID partition table (GPT) manipulator
13 <A NAME="lbAC">&nbsp;</A>
14 <H2>SYNOPSIS</H2>
15
16 <B>gdisk </B>
17
18 [ -l ]
19 <I>device</I>
20
21 <P>
22 <A NAME="lbAD">&nbsp;</A>
23 <H2>DESCRIPTION</H2>
24
25 GPT fdisk (aka <B>gdisk</B>) is a text-mode menu-driven program for
26 creation and manipulation of partition tables. It will automatically
27 convert an old-style Master Boot Record (MBR) partition table or BSD
28 disklabel stored without an MBR carrier partition to the newer Globally
29 Unique Identifier (GUID) Partition Table (GPT) format, or will load a GUID
30 partition table. When used with the <I>-l</I> command-line option, the
31 program displays the current partition table and then exits.
32 <P>
33 GPT fdisk operates mainly on the GPT headers and partition tables; however,
34 it can and will generate a fresh protective MBR, when required. (Any boot
35 loader code in the protective MBR will not be disturbed.) If you've created
36 an unusual protective MBR, such as a hybrid MBR created by
37 <B>gptsync</B> or <B>gdisk</B>'s own hybrid MBR creation feature,
38 this should not be disturbed by most ordinary actions. Some advanced data
39 recovery options require you to understand the distinctions between the
40 main and backup data, as well as between the GPT headers and the partition
41 tables. For information on MBR vs. GPT, as well as GPT terminology and
42 structure, see the extended <B>gdisk</B> documentation at
43 <I><A HREF="http://www.rodsbooks.com/gdisk/">http://www.rodsbooks.com/gdisk/</A></I> or consult Wikipedia.
44 <P>
45 The <B>gdisk</B> program employs a user interface similar to that of Linux's
46 <B>fdisk</B>, but <B>gdisk</B> modifies GPT partitions. It also has the
47 capability of transforming MBR partitions or BSD disklabels into GPT
48 partitions. Like the original <B>fdisk</B> program, <B>gdisk</B> does not
49 modify disk structures until you explicitly write them to disk, so if you
50 make a mistake, you can exit from the program with the 'q' option to leave
51 your partitions unmodified.
52 <P>
53 Ordinarily, <B>gdisk</B> operates on disk device files, such as
54 <I>/dev/sda</I> or <I>/dev/hda</I> under Linux, <I>/dev/disk0</I> under
55 Mac OS X, or <I>/dev/ad0</I> or <I>/dev/da0</I> under FreeBSD. The program
56 can also operate on disk image files, which can be either copies of whole
57 disks (made with <B>dd</B>, for instance) or raw disk images used by
58 emulators such as QEMU or VMWare. Note that only <I>raw</I> disk images
59 are supported; <B>gdisk</B> cannot work on compressed or other advanced
60 disk image formats.
61 <P>
62 The MBR partitioning system uses a combination of cylinder/head/sector
63 (CHS) addressing and logical block addressing (LBA). The former is klunky
64 and limiting. GPT drops CHS addressing and uses 64-bit LBA mode
65 exclusively. Thus, GPT data structures, and therefore
66 <B>gdisk</B>, do not need to deal with CHS geometries and all the problems
67 they create. Users of <B>fdisk</B> will note that <B>gdisk</B>
68 lacks the options and limitations associated with CHS geometries.
69 <P>
70 For best results, you should use an OS-specific partition table
71 program whenever possible. For example, you should make Mac OS X
72 partitions with the Mac OS X Disk Utility program and Linux partitions
73 with the Linux <B>gdisk</B> or GNU Parted program.
74 <P>
75 Upon start, <B>gdisk</B> attempts to identify the partition type in use on
76 the disk. If it finds valid GPT data, <B>gdisk</B> will use it. If
77 <B>gdisk</B> finds a valid MBR or BSD disklabel but no GPT data, it will
78 attempt to convert the MBR or disklabel into GPT form. (BSD disklabels are
79 likely to have unusable first and/or final partitions because they overlap
80 with the GPT data structures, though.) GPT fdisk can identify, but not use
81 data in, Apple Partition Map (APM) disks, which are used on 680x0- and
82 PowerPC-based Macintoshes. Upon exiting with the 'w' option, <B>gdisk</B>
83 replaces the MBR or disklabel with a GPT. <I>This action is potentially
84 dangerous!</I> Your system may become unbootable, and partition type codes
85 may become corrupted if the disk uses unrecognized type codes. Boot
86 problems are particularly likely if you're multi-booting with any
87 GPT-unaware OS. If you mistakenly launch <B>gdisk</B> on an MBR disk, you
88 can safely exit the program without making any changes by using the 'q'
89 option.
90 <P>
91 The MBR-to-GPT conversion will leave at least one gap in the partition
92 numbering if the original MBR used logical partitions. These gaps are
93 harmless, but you can eliminate them by using the 's' option, if you like.
94 (Doing this may require you to update your <I>/etc/fstab</I> file.)
95 <P>
96 When creating a fresh partition table, certain considerations may be in
97 order:
98 <P>
99 <DL COMPACT>
100 <DT><B>*</B>
101
102 <DD>
103 For data (non-boot) disks, and for boot disks used on BIOS-based computers
104 with GRUB as the boot loader, partitions may be created in whatever order
105 and in whatever sizes are desired.
106 <P>
107 <DT><B>*</B>
108
109 <DD>
110 Boot disks for EFI-based systems require an <I>EFI System
111 Partition</I> (<B>gdisk</B> internal code 0xEF00) formatted as FAT-32.
112 The recommended size of this partition is between 100 and 300 MiB.
113 Boot-related files are stored here. (Note that GNU Parted identifies
114 such partitions as having the &quot;boot flag&quot; set.)
115 <P>
116 <DT><B>*</B>
117
118 <DD>
119 Some boot loaders for BIOS-based systems make use of a <I>BIOS Boot
120 Partition</I> (<B>gdisk</B> internal code 0xEF02), in which the secondary
121 boot loader is stored, possibly without the benefit of a filesystem. (GRUB2
122 may optionally use such a partition.) This partition can typically be quite
123 small (roughly 32 to 200 KiB), but you should consult your boot loader
124 documentation for details.
125 <P>
126 <DT><B>*</B>
127
128 <DD>
129 If Windows is to boot from a GPT disk, a partition of type <I>Microsoft
130 Reserved</I> (<B>gdisk</B>
131 internal code 0x0C01) is recommended. This partition should be about 128 MiB
132 in size. It ordinarily follows the EFI System Partition and immediately
133 precedes the Windows data partitions. (Note that old versions of GNU Parted
134 create all FAT partitions as this type, which actually makes the partition
135 unusable for normal file storage in both Windows and Mac OS X.)
136 <P>
137 <DT><B>*</B>
138
139 <DD>
140 Some OSes' GPT utilities create some blank space (typically 128 MiB) after
141 each partition. The intent is to enable future disk utilities to use this
142 space. Such free space is not required of GPT disks, but creating it may
143 help in future disk maintenance. You can use GPT fdisk's relative partition
144 positioning option (specifying the starting sector as '+128M', for
145 instance) to simplify creating such gaps.
146 <P>
147 </DL>
148 <A NAME="lbAE">&nbsp;</A>
149 <H2>OPTIONS</H2>
150
151 <DL COMPACT>
152 <DT><B>-l</B>
153
154 <DD>
155 List the partition tables for the specified devices and then exit.
156 </DL>
157 <P>
158
159 <P>
160 Most interactions with <B>gdisk</B>
161 occur with its interactive text-mode menus. Three menus exist: the main
162 menu, the recovery &amp; transformation menu, and the experts' menu. The main
163 menu provides the functions that are most likely to be useful for typical partitioning tasks, such as creating and deleting partitions, changing partition type codes, and so on. Specific functions are:
164 <P>
165 <DL COMPACT>
166 <DT><B>b</B>
167
168 <DD>
169 Save partition data to a backup file. You can back up your current
170 in-memory partition table to a disk file using this option. The resulting
171 file is a binary file consisting of the protective MBR, the main GPT
172 header, the backup GPT header, and one copy of the partition table, in that
173 order. Note that the backup is of the current in-memory data structures, so
174 if you launch the program, make changes, and then use this option, the
175 backup will reflect your changes. Note also that the restore option is on
176 the recovery &amp; transformation menu; the backup option is on the main menu
177 to encourage its use.
178 <P>
179 <P>
180 <DT><B>c</B>
181
182 <DD>
183 Change the GPT name of a partition. This name is encoded as a UTF-16
184 string, but proper entry and display of anything beyond basic ASCII values
185 requires suitable locale and font support. For the most part, Linux ignores
186 the partition name, but it may be important in some OSes. GPT fdisk sets a
187 default name based on the partition type code. Note that the GPT partition
188 name is different from the filesystem name, which is encoded in the
189 filesystem's data structures.
190 <P>
191 <DT><B>d</B>
192
193 <DD>
194 Delete a partition. This action deletes the entry from the partition table
195 but does not disturb the data within the sectors originally allocated to
196 the partition on the disk. If a corresponding hybrid MBR partition exists,
197 <B>gdisk</B> deletes it, as well, and expands any adjacent 0xEE (EFI GPT)
198 MBR protective partition to fill the new free space.
199 <P>
200 <DT><B>i</B>
201
202 <DD>
203 Show detailed partition information. The summary information produced by
204 the 'p' command necessarily omits many details, such as the partition's
205 unique GUID and the translation of <B>gdisk</B>'s
206 internal partition type code to a plain type name. The 'i' option
207 displays this information for a single partition.
208 <P>
209 <DT><B>l</B>
210
211 <DD>
212 Display a summary of partition types. GPT uses a GUID to identify partition
213 types for particular OSes and purposes. For ease of data entry, <B>gdisk</B>
214 compresses these into two-byte (four-digit hexadecimal) values that are
215 related to their equivalent MBR codes. Specifically, the MBR code is
216 multiplied by hexadecimal 0x0100. For instance, the code for Linux swap
217 space in MBR is 0x82, and it's 0x8200 in <B>gdisk</B>. A one-to-one
218 correspondence is impossible, though. Most notably, the codes for all
219 varieties of FAT and NTFS partition correspond to a single GPT code
220 (entered as 0x0700 in <B>sgdisk</B>). Some OSes use a single MBR code but
221 employ many more codes in GPT. For these, <B>gdisk</B> adds code numbers
222 sequentially, such as 0xa500 for a FreeBSD disklabel, 0xa501 for FreeBSD
223 boot, 0xa502 for FreeBSD swap, and so on. Note that these two-byte codes
224 are unique to <B>gdisk</B>.
225 <P>
226 <DT><B>n</B>
227
228 <DD>
229 Create a new partition. This command is modelled after the equivalent
230 <B>fdisk</B> option, although some differences exist. You enter a partition
231 number, starting sector, and an ending sector. Both start and end sectors
232 can be specified in absolute terms as sector numbers or as positions
233 measured in kibibytes (K), mebibytes (M), gibibytes (G), tebibytes (T), or
234 pebibytes (P); for instance, <I></I><B>40M</B> specifies a position 40MiB
235 from the start of the disk. You can specify locations relative to the start
236 or end of the specified default range by preceding the number by a '+' or '-'
237 symbol, as in <I></I><B>+2G</B> to specify a point 2GiB after the
238 default start sector, or <I></I><B>-200M</B> to specify a point 200MiB
239 before the last available sector. Pressing the Enter key with no input
240 specifies the default value, which is the start of the largest available
241 block for the start sector and the end of the same block for the end
242 sector.
243 <P>
244 <DT><B>o</B>
245
246 <DD>
247 Clear out all partition data. This includes GPT header data,
248 all partition definitions, and the protective MBR. The sector alignment
249 is reset to the default (2048 sectors, or 1MB).
250 <P>
251 <DT><B>p</B>
252
253 <DD>
254 Display basic partition summary data. This includes partition
255 numbers, starting and ending sector numbers, partition sizes,
256 <B>gdisk</B>'s partition types codes, and partition names. For
257 additional information, use the 'i' command.
258 <P>
259 <DT><B>q</B>
260
261 <DD>
262 Quit from the program <I>without saving your changes</I>.
263 Use this option if you just wanted to view information or if you make a
264 mistake and want to back out of all your changes.
265 <P>
266 <DT><B>r</B>
267
268 <DD>
269 Enter the recovery &amp; transformation menu. This menu includes emergency
270 recovery options (to fix damaged GPT data structures) and options to
271 transform to or from other partitioning systems, including creating
272 hybrid MBRs.
273 <P>
274 <DT><B>s</B>
275
276 <DD>
277 Sort partition entries. GPT partition numbers need not match the order of
278 partitions on the disk. If you want them to match, you can use this option.
279 Note that some partitioning utilities sort partitions whenever they make
280 changes. Such changes will be reflected in your device filenames, so you
281 may need to edit <I>/etc/fstab</I> if you use this option.
282 <P>
283 <DT><B>t</B>
284
285 <DD>
286 Change a single partition's type code. You enter the type code using a
287 two-byte hexadecimal number, as described earlier. You may also enter a
288 GUID directly, if you have one and <B>gdisk</B> doesn't know it.
289 <P>
290 <DT><B>v</B>
291
292 <DD>
293 Verify disk. This option checks for a variety of problems, such as
294 incorrect CRCs and mismatched main and backup data. This option does not
295 automatically correct most problems, though; for that, you must use
296 options on the recovery &amp; transformation menu. If no problems are found,
297 this command displays a summary of unallocated disk space.
298 <P>
299 <DT><B>w</B>
300
301 <DD>
302 Write data. Use this command to save your changes.
303 <P>
304 <DT><B>x</B>
305
306 <DD>
307 Enter the experts' menu. Using this option provides access to features you
308 can use to get into even more trouble than the main menu allows.
309 </DL>
310 <P>
311
312 <P>
313 <DL COMPACT>
314 <DT><B>?</B>
315
316 <DD>
317 Print the menu. Type this command (or any other unrecognized command) to
318 see a summary of available options.
319 <P>
320 </DL>
321 <P>
322
323 The second <B>gdisk</B> menu is the recovery &amp; transformation menu, which
324 provides access to data recovery options and features related to the
325 transformation of partitions between partitioning schemes (converting
326 BSD disklabels into GPT partitions or creating hybrid MBRs, for instance).
327 A few options on this menu duplicate functionality on the main
328 menu, for the sake of convenience. The options on this menu are:
329 <P>
330 <DL COMPACT>
331 <DT><B>b</B>
332
333 <DD>
334 Rebuild GPT header from backup. You can use the backup GPT header to
335 rebuild the main GPT header with this option. It's likely to be useful if
336 your main GPT header was damaged or destroyed (say, by sloppy use of
337 <B>dd</B>).
338 <P>
339 <DT><B>c</B>
340
341 <DD>
342 Load backup partition table. Ordinarily, <B>gdisk</B>
343 uses only the main partition table (although the backup's integrity is
344 checked when you launch the program). If the main partition table has been
345 damaged, you can use this option to load the backup from disk and use it
346 instead. Note that this will almost certainly produce no or strange
347 partition entries if you've just converted an MBR disk to GPT format, since
348 there will be no backup partition table on disk.
349 <P>
350 <DT><B>d</B>
351
352 <DD>
353 Use main GPT header and rebuild the backup. This option is likely to be
354 useful if the backup GPT header has been damaged or destroyed.
355 <P>
356 <DT><B>e</B>
357
358 <DD>
359 Load main partition table. This option reloads the main partition table
360 from disk. It's only likely to be useful if you've tried to use the backup
361 partition table (via 'c') but it's in worse shape then the main partition
362 table.
363 <P>
364 <DT><B>f</B>
365
366 <DD>
367 Load MBR and build fresh GPT from it. Use this option if your GPT is corrupt
368 or conflicts with the MBR and you want to use the MBR as the basis for a new
369 set of GPT partitions.
370 <P>
371 <DT><B>g</B>
372
373 <DD>
374 Convert GPT into MBR and exit. This option converts as many partitions as possible
375 into MBR form, destroys the GPT data structures, saves the new MBR, and exits.
376 Use this option if you've tried GPT and find that MBR works better for you.
377 Note that this function generates up to four primary MBR partitions or three
378 primary partitions and as many logical partitions as can be generated. Each
379 logical partition requires at least one unallocated block immediately before
380 its first block. Therefore, it may be possible to convert a maximum of four
381 partitions on disks with tightly-packed partitions; however, if free space was
382 inserted between partitions when they were created, and if the disk is under
383 2 TiB in size, it should be possible to convert all the partitions to MBR form.
384 See also the 'h' option.
385 <P>
386 <DT><B>h</B>
387
388 <DD>
389 Create a hybrid MBR. This is an ugly workaround that enables GPT-unaware
390 OSes, or those that can't boot from a GPT disk, to access up to three of
391 the partitions on the disk by creating MBR entries for them. Note that
392 these hybrid MBR entries can easily go out of sync with the GPT entries,
393 particularly when hybrid-unaware GPT utilities are used to edit the disk.
394 Thus, you may need to recreate the hybrid MBR if you use such tools. Unlike
395 the 'g' option, this option does not support converting any partitions into
396 MBR logical partitions.
397 <P>
398 <DT><B>i</B>
399
400 <DD>
401 Show detailed partition information. This option is identical to the 'i'
402 option on the main menu.
403 <P>
404 <DT><B>l</B>
405
406 <DD>
407 Load partition data from a backup file. This option is the reverse of the 'b'
408 option on the main menu. Note that restoring partition data from anything
409 but the original disk is not recommended.
410 <P>
411 <DT><B>m</B>
412
413 <DD>
414 Return to the main menu. This option enables you to enter main-menu commands.
415 <P>
416 <DT><B>o</B>
417
418 <DD>
419 Print protective MBR data. You can see a summary of the protective MBR's
420 partitions with this option. This may enable you to spot glaring problems
421 or help identify the partitions in a hybrid MBR.
422 <P>
423 <DT><B>p</B>
424
425 <DD>
426 Print the partition table. This option is identical to the 'p' option in
427 the main menu.
428 <P>
429 <DT><B>q</B>
430
431 <DD>
432 Quit without saving changes. This option is identical to the 'q' option in
433 the main menu.
434 <P>
435 <DT><B>t</B>
436
437 <DD>
438 Transform BSD partitions into GPT partitions. This option works on BSD
439 disklabels held within GPT (or converted MBR) partitions. Converted
440 partitions' type codes are likely to need manual adjustment. <B>gdisk</B>
441 will attempt to convert BSD disklabels stored on the main disk when
442 launched, but this conversion is likely to produce first and/or last
443 partitions that are unusable. The many BSD variants means that the
444 probability of <B>gdisk</B> being unable to convert a BSD disklabel is
445 high compared to the likelihood of problems with an MBR conversion.
446 <P>
447 <DT><B>v</B>
448
449 <DD>
450 Verify disk. This option is identical to the 'v' option in the main menu.
451 <P>
452 <DT><B>w</B>
453
454 <DD>
455 Write table to disk and exit. This option is identical to the 'w' option in
456 the main menu.
457 <P>
458 <DT><B>x</B>
459
460 <DD>
461 Enter the experts' menu. This option is identical to the 'x' option in the
462 main menu.
463 <P>
464 <DT><B>?</B>
465
466 <DD>
467 Print the menu. This option (or any unrecognized entry) displays a summary
468 of the menu options.
469 <P>
470 </DL>
471 <P>
472
473 The third <B>gdisk</B> menu is the experts' menu. This menu provides advanced
474 options that aren't closely related to recovery or transformation between
475 partitioning systems. Its options are:
476 <P>
477 <DL COMPACT>
478 <DT><B>a</B>
479
480 <DD>
481 Set attributes. GPT provides a 64-bit attributes field that can be used to
482 set features for each partition. <B>gdisk</B> supports four attributes:
483 <I>system partition</I>, <I>read-only</I>, <I>hidden</I>, and
484 <I>do not automount</I>. You can set other attributes, but their numbers
485 aren't translated into anything useful. In practice, most OSes seem to
486 ignore these attributes.
487 <P>
488 <DT><B>c</B>
489
490 <DD>
491 Change partition GUID. You can enter a custom unique GUID for a partition
492 using this option. (Note this refers to the GUID that uniquely identifies a
493 partition, not to its type code, which you can change with the 't' main-menu
494 option.) Ordinarily, <B>gdisk</B> assigns this number randomly; however,
495 you might want to adjust the number manually if you've wound up with the
496 same GUID on two partitions because of buggy GUID assignments (hopefully
497 not in <B>gdisk</B>) or sheer incredible coincidence.
498 <P>
499 <DT><B>d</B>
500
501 <DD>
502 Display the sector alignment value. See the
503 description of the 'l' option for more details.
504 <P>
505 <DT><B>e</B>
506
507 <DD>
508 Move backup GPT data structures to the end of the disk. Use this command if
509 you've added disks to a RAID array, thus creating a virtual disk with space
510 that follows the backup GPT data structures. This command moves the backup
511 GPT data structures to the end of the disk, where they belong.
512 <P>
513 <DT><B>f</B>
514
515 <DD>
516 Randomize the disk's GUID and all partitions' unique GUIDs (but not their
517 partition type code GUIDs). This function may be used after cloning a disk
518 with another utility in order to render all GUIDs once again unique.
519 <P>
520 <DT><B>g</B>
521
522 <DD>
523 Change disk GUID. Each disk has a unique GUID code, which <B>gdisk</B>
524 assigns randomly upon creation of the GPT data structures. You can generate
525 a fresh random GUID or enter one manually with this option.
526 <P>
527 <DT><B>h</B>
528
529 <DD>
530 Recompute CHS values in protective or hybrid MBR. This option can sometimes
531 help if a disk utility, OS, or BIOS doesn't like the CHS values used by the
532 partitions in the protective or hybrid MBR. In particular, the GPT
533 specification requires a CHS value of 0xFFFFFF for over-8GiB partitions,
534 but this value is technically illegal by the usual standards. Some BIOSes
535 hang if they encounter this value. This option will recompute a more normal
536 CHS value -- 0xFEFFFF for over-8GiB partitions, enabling these BIOSes to
537 boot.
538 <P>
539 <DT><B>i</B>
540
541 <DD>
542 Show detailed partition information. This option is identical to the 'i'
543 option on the main menu.
544 <P>
545 <DT><B>l</B>
546
547 <DD>
548 Change the sector alignment value. Disks with more logical sectors per
549 physical sectors (such as modern Advanced Format drives), some RAID
550 configurations, and many SSD devices, can suffer performance problems if
551 partitions are not aligned properly for their internal data structures. On
552 new disks, GPT fdisk attempts to align partitions on 2048-sector (1MiB)
553 boundaries by default, which optimizes performance for all of these disk
554 types. On pre-partitioned disks, GPT fdisk attempts to identify the
555 alignment value used on that disk, but will set 8-sector alignment on disks
556 larger than 300 GB even if lesser alignment values are detected. In either
557 case, it can be changed by using this option.
558 <P>
559 <DT><B>m</B>
560
561 <DD>
562 Return to the main menu. This option enables you to enter main-menu commands.
563 <P>
564 <DT><B>n</B>
565
566 <DD>
567 Create a new protective MBR. Use this option if the current protective MBR
568 is damaged in a way that <B>gdisk</B> doesn't automatically detect and
569 correct, or if you want to convert a hybrid MBR into a &quot;pure&quot; GPT with a
570 conventional protective MBR.
571 <P>
572 <DT><B>o</B>
573
574 <DD>
575 Print protective MBR data. You can see a summary of the protective MBR's
576 partitions with this option. This may enable you to spot glaring problems
577 or help identify the partitions in a hybrid MBR.
578 <P>
579 <DT><B>p</B>
580
581 <DD>
582 Print the partition table. This option is identical to the 'p' option in
583 the main menu.
584 <P>
585 <DT><B>q</B>
586
587 <DD>
588 Quit without saving changes. This option is identical to the 'q' option in
589 the main menu.
590 <P>
591 <DT><B>r</B>
592
593 <DD>
594 Enter the recovery &amp; transformations menu. This option is identical to
595 the 'r' option on the main menu.
596 <P>
597 <DT><B>s</B>
598
599 <DD>
600 Resize partition table. The default partition table size is 128 entries.
601 Officially, sizes of less than 16KB (128 entries, given the normal entry
602 size) are unsupported by the GPT specification; however, in practice they
603 seem to work, and can sometimes be useful in converting MBR disks. Larger
604 sizes also work fine. OSes may impose their own limits on the number of
605 partitions, though.
606 <P>
607 <DT><B>t</B>
608
609 <DD>
610 Swap two partitions' entries in the partition table. One partition may be
611 empty. For instance, if partitions 1-4 are defined, transposing 1 and 5
612 results in a table with partitions numbered from 2-5. Transposing
613 partitions in this way has no effect on their disk space allocation; it
614 only alters their order in the partition table.
615 <P>
616 <DT><B>u</B>
617
618 <DD>
619 Replicate the current device's partition table on another device. You will
620 be prompted to type the new device's filename. After the write operation
621 completes, you can continue editing the original device's partition table.
622 Note that the replicated partition table is an exact copy, including all
623 GUIDs; if the device should have its own unique GUIDs, you should use the
624 <B>f</B> option on the new disk.
625 <P>
626 <DT><B>v</B>
627
628 <DD>
629 Verify disk. This option is identical to the 'v' option in the main menu.
630 <P>
631 <DT><B>z</B>
632
633 <DD>
634 Zap (destroy) the GPT data structures and exit. Use this option if you want to
635 repartition a GPT disk using <B>fdisk</B> or some other GPT-unaware program.
636 You'll be given the choice of preserving the existing MBR, in case it's a
637 hybrid MBR with salvageable partitions or if you've already created new MBR
638 partitions and want to erase the remnants of your GPT partitions. <I>If you've
639 already created new MBR partitions, it's conceivable that this option will
640 damage the first and/or last MBR partitions!</I> Such an event is unlikely, but
641 could occur if your new MBR partitions overlap the old GPT data structures.
642 <P>
643 <DT><B>?</B>
644
645 <DD>
646 Print the menu. This option (or any unrecognized entry) displays a summary
647 of the menu options.
648 <P>
649 </DL>
650 <P>
651
652 In many cases, you can press the Enter key to select a default option when
653 entering data. When only one option is possible, <B>gdisk</B>
654 usually bypasses the prompt entirely.
655 <P>
656 <A NAME="lbAF">&nbsp;</A>
657 <H2>BUGS</H2>
658
659 As of May 2012 (version 0.8.5), <B>gdisk</B>
660 should be considered beta software. Known bugs and limitations include:
661 <P>
662 <DL COMPACT>
663 <DT><B>*</B>
664
665 <DD>
666 The program compiles correctly only on Linux, FreeBSD, Mac OS X, and Windows.
667 Linux versions for x86-64 (64-bit), x86 (32-bit), and PowerPC (32-bit) have been
668 tested, with the x86-64 version having seen the most testing. Under FreeBSD,
669 32-bit (x86) and 64-bit (x86-64) versions have been tested. Only 32-bit
670 versions for Mac OS X and Windows have been tested by the author, although
671 I've heard of 64-bit versions being successfully compiled.
672 <P>
673 <DT><B>*</B>
674
675 <DD>
676 The FreeBSD version of the program can't write changes to the partition
677 table to a disk when existing partitions on that disk are mounted. (The
678 same problem exists with many other FreeBSD utilities, such as
679 <B>gpt</B>, <B>fdisk</B>, and <B>dd</B>.) This limitation can be overcome
680 by typing <B>sysctl kern.geom.debugflags=16</B> at a shell prompt.
681 <P>
682 <DT><B>*</B>
683
684 <DD>
685 The fields used to display the start and end sector numbers for partitions
686 in the 'p' command are 14 characters wide. This translates to a limitation
687 of about 45 PiB. On larger disks, the displayed columns will go out of
688 alignment.
689 <P>
690 <DT><B>*</B>
691
692 <DD>
693 In the Windows version, only ASCII characters are supported in the
694 partition name field. If an existing partition uses non-ASCII UTF-16
695 characters, they're likely to be corrupted in the 'i' and 'p' menu options'
696 displays; however, they should be preserved when loading and saving
697 partitions. Binaries for Linux, FreeBSD, and OS X support full UTF-16
698 partition names.
699 <P>
700 <DT><B>*</B>
701
702 <DD>
703 The program can load only up to 128 partitions (4 primary partitions and
704 124 logical partitions) when converting from MBR format. This limit can
705 be raised by changing the <I>#define MAX_MBR_PARTS</I> line in the
706 <I>basicmbr.h</I> source code file and recompiling; however, such a change
707 will require using a larger-than-normal partition table. (The limit
708 of 128 partitions was chosen because that number equals the 128 partitions
709 supported by the most common partition table size.)
710 <P>
711 <DT><B>*</B>
712
713 <DD>
714 Converting from MBR format sometimes fails because of insufficient space at
715 the start or (more commonly) the end of the disk. Resizing the partition
716 table (using the 's' option in the experts' menu) can sometimes overcome
717 this problem; however, in extreme cases it may be necessary to resize a
718 partition using GNU Parted or a similar tool prior to conversion with
719 <B>gdisk</B>.
720 <P>
721 <DT><B>*</B>
722
723 <DD>
724 MBR conversions work only if the disk has correct LBA partition
725 descriptors. These descriptors should be present on any disk over 8 GiB in
726 size or on smaller disks partitioned with any but very ancient software.
727 <P>
728 <DT><B>*</B>
729
730 <DD>
731 BSD disklabel support can create first and/or last partitions that overlap
732 with the GPT data structures. This can sometimes be compensated by
733 adjusting the partition table size, but in extreme cases the affected
734 partition(s) may need to be deleted.
735 <P>
736 <DT><B>*</B>
737
738 <DD>
739 Because of the highly variable nature of BSD disklabel structures,
740 conversions from this form may be unreliable -- partitions may be dropped,
741 converted in a way that creates overlaps with other partitions, or
742 converted with incorrect start or end values. Use this feature with
743 caution!
744 <P>
745 <DT><B>*</B>
746
747 <DD>
748 Booting after converting an MBR or BSD disklabel disk is likely to be
749 disrupted. Sometimes re-installing a boot loader will fix the problem, but
750 other times you may need to switch boot loaders. Except on EFI-based
751 platforms, Windows through at least Windows 7 doesn't support booting
752 from GPT disks. Creating a hybrid MBR (using the 'h' option on the recovery &amp;
753 transformation menu) or abandoning GPT in favor of MBR may be your only
754 options in this case.
755 <P>
756 </DL>
757 <P>
758
759 <P>
760 <A NAME="lbAG">&nbsp;</A>
761 <H2>AUTHORS</H2>
762
763 Primary author: Roderick W. Smith (<A HREF="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</A>)
764 <P>
765 Contributors:
766 <P>
767 * Yves Blusseau (<A HREF="mailto:1otnwmz02@sneakemail.com">1otnwmz02@sneakemail.com</A>)
768 <P>
769 * David Hubbard (<A HREF="mailto:david.c.hubbard@gmail.com">david.c.hubbard@gmail.com</A>)
770 <P>
771 * Justin Maggard (<A HREF="mailto:justin.maggard@netgear.com">justin.maggard@netgear.com</A>)
772 <P>
773 * Dwight Schauer (<A HREF="mailto:dschauer@ti.com">dschauer@ti.com</A>)
774 <P>
775 * Florian Zumbiehl (<A HREF="mailto:florz@florz.de">florz@florz.de</A>)
776 <P>
777 <P>
778 <A NAME="lbAH">&nbsp;</A>
779 <H2>SEE ALSO</H2>
780
781 <B>cfdisk (8)</B>,
782 <B>cgdisk (8)</B>,
783 <B>fdisk (8)</B>,
784 <B>mkfs (8)</B>,
785 <B>parted (8)</B>,
786 <B>sfdisk (8)</B>
787 <B>sgdisk (8)</B>
788 <B>fixparts (8)</B>
789 <P>
790 <I><A HREF="http://en.wikipedia.org/wiki/GUID_Partition_Table">http://en.wikipedia.org/wiki/GUID_Partition_Table</A></I>
791 <P>
792 <I><A HREF="http://developer.apple.com/technotes/tn2006/tn2166.html">http://developer.apple.com/technotes/tn2006/tn2166.html</A></I>
793 <P>
794 <I><A HREF="http://www.rodsbooks.com/gdisk/">http://www.rodsbooks.com/gdisk/</A></I>
795 <P>
796 <A NAME="lbAI">&nbsp;</A>
797 <H2>AVAILABILITY</H2>
798
799 The <B>gdisk</B> command is part of the <I>GPT fdisk</I> package and is
800 available from Rod Smith.
801 <P>
802
803 <HR>
804 <A NAME="index">&nbsp;</A><H2>Index</H2>
805 <DL>
806 <DT><A HREF="#lbAB">NAME</A><DD>
807 <DT><A HREF="#lbAC">SYNOPSIS</A><DD>
808 <DT><A HREF="#lbAD">DESCRIPTION</A><DD>
809 <DT><A HREF="#lbAE">OPTIONS</A><DD>
810 <DT><A HREF="#lbAF">BUGS</A><DD>
811 <DT><A HREF="#lbAG">AUTHORS</A><DD>
812 <DT><A HREF="#lbAH">SEE ALSO</A><DD>
813 <DT><A HREF="#lbAI">AVAILABILITY</A><DD>
814 </DL>
815 <HR>
816 This document was created by
817 <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
818 using the manual pages.<BR>
819 Time: 15:38:43 GMT, May 30, 2012
820 </BODY>
821 </HTML>