blob: dfdd9a718ec09a11b806f899c0ec6814b34c6d7a [file] [log] [blame]
srs569455d92612010-03-07 22:16:07 -05001.\" Copyright 2010 Roderick W. Smith (rodsmith@rodsbooks.com)
srs569473ba4792010-01-12 18:18:17 -05002.\" May be distributed under the GNU General Public License
srs56949ddc14b2010-08-22 22:44:42 -04003.TH "SGDISK" "8" "0.6.10" "Roderick W. Smith" "GPT fdisk Manual"
srs569473ba4792010-01-12 18:18:17 -05004.SH "NAME"
5sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and Unix
6.SH "SYNOPSIS"
7.BI "sgdisk "
8[ options ]
9.I device
10
11.SH "DESCRIPTION"
12GPT fdisk is a text\-mode menu\-driven package for creation and manipulation of
13partition tables. It consists of two programs: the text\-mode interactive
14\fBgdisk\fR and the command\-line \fBsgdisk\fR. Either program will
15automatically convert an old\-style Master Boot Record (MBR) partition table
16or BSD disklabel stored without an MBR carrier partition to the newer Globally
17Unique Identifier (GUID) Partition Table (GPT) format, or will load a GUID
18partition table. This man page documents the command\-line \fBsgdisk\fR
19program.
20
21Some advanced data manipulation and
22recovery options require you to understand the distinctions between the
23main and backup data, as well as between the GPT headers and the partition
24tables. For information on MBR vs. GPT, as well as GPT terminology and
25structure, see the extended \fBgdisk\fR documentation at
26\fIhttp://www.rodsbooks.com/gdisk/\fR or consult Wikipedia.
27
28The \fBsgdisk\fR program employs a user interface that's based entirely on
29the command line, making it suitable for use in scripts or by experts who
30want to make one or two quick changes to a disk. (The program may query the
31user when certain errors are encountered, though.) The program's name is
32based on \fBsfdisk\fR, but the user options of the two programs are
33entirely different from one another.
34
35Ordinarily, \fBsgdisk\fR operates on disk device files, such as
36\fI/dev/sda\fR or \fI/dev/hda\fR under Linux, \fI/dev/disk0\fR under
37Mac OS X, or \fI/dev/ad0\fR or \fI/dev/da0\fR under FreeBSD. The program
38can also operate on disk image files, which can be either copies of whole
39disks (made with \fBdd\fR, for instance) or raw disk images used by
40emulators such as QEMU or VMWare. Note that only \fIraw\fR disk images
41are supported; \fBsgdisk\fR cannot work on compressed or other advanced
42disk image formats.
43
44The MBR partitioning system uses a combination of cylinder/head/sector
45(CHS) addressing and logical block addressing (LBA). The former is klunky
46and limiting. GPT drops CHS addressing and uses 64\-bit LBA mode
47exclusively. Thus, GPT data structures, and therefore
48\fBsgdisk\fR, do not need to deal with CHS geometries and all the problems
49they create.
50
51For best results, you should use an OS\-specific partition table
52program whenever possible. For example, you should make Mac OS X
53partitions with the Mac OS X Disk Utility program and Linux partitions
54with the Linux \fBgdisk\fR, \fBsgdisk\fR, or GNU Parted programs.
55
56Upon start, \fBsgdisk\fR attempts to identify the partition type in use on
57the disk. If it finds valid GPT data, \fBsgdisk\fR will use it. If
58\fBsgdisk\fR finds a valid MBR or BSD disklabel but no GPT data, it will
59attempt to convert the MBR or disklabel into GPT form. (BSD disklabels are
60likely to have unusable first and/or final partitions because they overlap
61with the GPT data structures, though.) GPT fdisk can identify, but not use
62data in, Apple Partition Map (APM) disks, which are used on 680x0\- and
srs569408bb0da2010-02-19 17:19:55 -050063PowerPC\-based Macintoshes. If you specify any option that results in
64changes to an MBR or BSD disklabel, \fBsgdisk\fR ignores those changes
65unless the \fI\-g\fR (\fI\-\-mbrtogpt\fR), \fI\-z\fR (\fI\-\-zap\fR), or
66\fI\-Z\fR (\fI\-\-zap\-all\fR) option is used. If you use the \fI\-g\fR
67option, \fBsgdisk\fR replaces the MBR or disklabel with a GPT. \fIThis
68action is potentially dangerous!\fR Your system may become unbootable, and
69partition type codes may become corrupted if the disk uses unrecognized
70type codes. Boot problems are particularly likely if you're multi\-booting
71with any GPT\-unaware OS.
srs569473ba4792010-01-12 18:18:17 -050072
73The MBR\-to\-GPT conversion will leave at least one gap in the partition
74numbering if the original MBR used logical partitions. These gaps are
75harmless, but you can eliminate them by using the \fI\-s\fR (\fI\-\-sort\fR)
76option, if you like. (Doing this may require you to update your
77\fI/etc/fstab\fR file.)
78
79When creating a fresh partition table, certain considerations may be in
80order:
81
82.TP
83.B *
84For data (non\-boot) disks, and for boot disks used on BIOS\-based computers
85with GRUB as the boot loader, partitions may be created in whatever order
86and in whatever sizes are desired.
87
88.TP
89.B *
90Boot disks for EFI\-based systems require an \fIEFI System
91Partition\fR (\fBsgdisk\fR internal code 0xEF00) formatted as FAT\-32.
92The recommended size of this partition is between 100 and 200 MiB.
93Boot\-related files are stored here. (Note that GNU Parted identifies
94such partitions as having the "boot flag" set.)
95
96.TP
97.B *
98Some boot loaders for BIOS\-based systems make use of a \fIBIOS Boot
99Partition\fR (\fBsgdisk\fR internal code 0xEF02), in which the secondary
100boot loader is stored, possibly without the benefit of a filesystem. This
101partition can typically be quite small (roughly 32 to 200 KiB), but you
102should consult your boot loader documentation for details.
103
104.TP
105.B *
106If Windows is to boot from a GPT disk, a partition of type \fIMicrosoft
107Reserved\fR (\fBsgdisk\fR
108internal code 0x0C01) is recommended. This partition should be about 128 MiB
109in size. It ordinarily follows the EFI System Partition and immediately
110precedes the Windows data partitions. (Note that GNU Parted creates all
111FAT partitions as this type, which actually makes the partition unusable
112for normal file storage in both Windows and Mac OS X.)
113
114.TP
115.B *
116Some OSes' GPT utilities create some blank space (typically 128 MiB) after
117each partition. The intent is to enable future disk utilities to use this
118space. Such free space is not required of GPT disks, but creating it may
119help in future disk maintenance.
120
121.SH "OPTIONS"
122Some options take no arguments, others take one argument (typically a partition
123number), and others take compound arguments with colon delimitation. For
124instance, \fI\-n\fR (\fI\-\-new\fR) takes a partition number, a starting
125sector number, and an ending sector number, as in \fBsgdisk \-n 2:2000:50000
126/dev/sdc\fR, which creates a new partition, numbered 2, starting at sector
1272000 an ending at sector 50,000, on \fI/dev/sdc\fR.
128
129Unrelated options may be combined; however, some such combinations will be
130nonsense (such as deleting a partition and then changing its GUID type code).
131\fBsgdisk\fR interprets options in the order in which they're entered, so
132effects can vary depending on order. For instance, \fBsgdisk \-s \-d 2\fR
133sorts the partition table entries and then deletes partition 2 from the
134newly\-sorted list; but \fBsgdisk \-d 2 \-s\fR deletes the original partition
1352 and then sorts the modified partition table.
136
137Error checking and opportunities to correct mistakes in \fBsgdisk\fR are
138minimal. Although the program endeavors to keep the GPT data structures legal,
139it does not prompt for verification before performing its actions. Unless you
140require a command\-line\-driven program, you should use the interactive
141\fBgdisk\fR instead of \fBsgdisk\fR, since \fBgdisk\fR allows you to
142quit without saving your changes, should you make a mistake.
143
144Although \fBsgdisk\fR is based on the same partition\-manipulation code as
145\fBgdisk\fR, \fBsgdisk\fR implements fewer features than its interactive
146sibling. Options available in \fBsgdisk\fR are:
147
148.TP
149.B \-a, \-\-set\-alignment=value
150Set the sector alignment multiple. GPT fdisk aligns the start of partitions
srs56948a4ddfc2010-03-21 19:05:49 -0400151to sectors that are multiples of this value, which defaults to 2048 on
152freshly formatted disks. This alignment value is necessary to obtain optimum
153performance with Western Digital Advanced Format and similar drives with larger
154physical than logical sector sizes and with some types of RAID arrays.
srs569473ba4792010-01-12 18:18:17 -0500155
srs56949ddc14b2010-08-22 22:44:42 -0400156.TP
157.B \-A, \-\-attributes=list|[partnum:show|or|nand|xor|=|set|clear|toggle|get[:bitnum|hexbitmask]]
158View or set partition attributes. Use \fIlist\fR to see defined (known)
159attribute values. Omit the partition number (and even the device filename)
160when using this option. The others require a partition number. The
161\fIshow\fR and \fIget\fR options show the current attribute settings
162(all attributes or for a particular bit, respectively). The \fIor\fR,
163\fInand\fR, \fIxor\fR, \fI\=\fR, \fIset\fR, \fIclear\fR, and
164\fItoggle\fR options enable you to change the attribute bit value. The
165\fIset\fR, \fIclear\fR, \fItoggle\fR, and \fIget\fR options work on a
166bit number; the others work on a hexadecimal bit mask. For example, type
167\fBsgdisk -A 4:set:2 /dev/sdc\fR to set the bit 2 attribute (legacy BIOS
168bootable) on partition 4 on \fI/dev/sdc\fR.
169
srs569473ba4792010-01-12 18:18:17 -0500170.TP
171.B \-b, \-\-backup=file
172Save partition data to a backup file. You can back up your current
173in\-memory partition table to a disk file using this option. The resulting
174file is a binary file consisting of the protective MBR, the main GPT
175header, the backup GPT header, and one copy of the partition table, in that
176order. Note that the backup is of the current in\-memory data structures, so
177if you launch the program, make changes, and then use this option, the
178backup will reflect your changes. If the GPT data structures are damaged,
179the backup may not accurately reflect the damaged state; instead, they
180will reflect GPT fdisk's first\-pass interpretation of the GPT.
181
182.TP
srs56949ba54212010-05-18 23:24:02 -0400183.B \-c, \-\-change\-name=partnum:name
srs569473ba4792010-01-12 18:18:17 -0500184Change the GPT name of a partition. This name is encoded as a UTF\-16
185string, but \fBsgdisk\fR
186supports only ASCII characters as names. For the most part, Linux ignores
187the partition name, but it may be important in some OSes. GPT fdisk sets
188a default name based on the partition type code. If you want to set a name
189that includes a space, enclose it in quotation marks, as in
srs5694c54e9b42010-05-01 21:04:23 -0400190\fIsgdisk \-c 1:"Sample Name" /dev/sdb\fR. Note that the GPT name of a
191partition is distinct from the filesystem name, which is encoded in the
192filesystem's data structures.
srs569473ba4792010-01-12 18:18:17 -0500193
srs56949ba54212010-05-18 23:24:02 -0400194.TP
195.B \-C, \-\-recompute-chs
196Recompute CHS values in protective or hybrid MBR. This option can sometimes
197help if a disk utility, OS, or BIOS doesn't like the CHS values used by the
198partitions in the protective or hybrid MBR. In particular, the GPT
199specification requires a CHS value of 0xFFFFFF for over-8GiB partitions,
200but this value is technically illegal by the usual standards. Some BIOSes
201hang if they encounter this value. This option will recompute a more normal
202CHS value -- 0xFEFFFF for over-8GiB partitions, enabling these BIOSes to
203boot.
204
srs569473ba4792010-01-12 18:18:17 -0500205.TP
206.B \-d, \-\-delete=partnum
207Delete a partition. This action deletes the entry from the partition table
208but does not disturb the data within the sectors originally allocated to
209the partition on the disk. If a corresponding hybrid MBR partition exists,
210\fBgdisk\fR deletes it, as well, and expands any adjacent 0xEE (EFI GPT)
211MBR protective partition to fill the new free space.
212
213.TP
srs569455d92612010-03-07 22:16:07 -0500214.B \-D, \-\-display\-alignment
215Display current sector alignment value. Partitions will be created on multiples
216of the sector value reported by this option. You can change the alignment value
217with the \-a option.
218
219.TP
srs569473ba4792010-01-12 18:18:17 -0500220.B e, \-\-move\-second\-header
221Move backup GPT data structures to the end of the disk. Use this option if
222you've added disks to a RAID array, thus creating a virtual disk with space
223that follows the backup GPT data structures. This command moves the backup
224GPT data structures to the end of the disk, where they belong.
225
226.TP
srs56949ddc14b2010-08-22 22:44:42 -0400227.B \-E, \-\-end\-of\-largest
srs569473ba4792010-01-12 18:18:17 -0500228Displays the sector number of the end of the largest available block of
229sectors on the disk. A script may store this value and pass it back as
230part of \fI\-n\fR's option to create a partition. If no unallocated
231sectors are available, this function returns the value 0.
232
233.TP
234.B \-f, \-\-first\-in\-largest
235Displays the sector number of the start of the largest available block of
236sectors on the disk. A script may store this value and pass it back as
237part of \fI\-n\fR's option to create a partition. If no unallocated
238sectors are available, this function returns the value 0.
239
240.TP
241.B \-g, \-\-mbrtogpt
srs56943c0af382010-01-15 19:19:18 -0500242Convert an MBR or BSD disklabel disk to a GPT disk. As a safety measure, use of
243this option is required on MBR or BSD disklabel disks if you intend to save your
244changes, in order to prevent accidentally damaging such disks.
srs569473ba4792010-01-12 18:18:17 -0500245
srs56949ba54212010-05-18 23:24:02 -0400246.TP
247.B \-G, \-\-randomize\-guids
248Randomize the disk's GUID and all partitions' unique GUIDs (but not their
249partition type code GUIDs). This function may be used after cloning a disk
250in order to render all GUIDs once again unique.
251
srs569455d92612010-03-07 22:16:07 -0500252.TP
srs569408bb0da2010-02-19 17:19:55 -0500253.B \-h, \-\-hybrid
254Create a hybrid MBR. This option takes from one to three partition numbers,
255separated by colons, as arguments. The created hybrid MBR places an EFI GPT
256(type 0xEE) partition first in the table, followed by the partition(s) you
257specify. Their type codes are based on the GPT fdisk type codes divided by
2580x0100, which is usually correct for Windows partitions. If the
259active/bootable flag should be set, you must do so in another program, such
260as \fBfdisk\fR. The \fBgdisk\fR program offers additional hybrid MBR
261creation options.
262
srs569473ba4792010-01-12 18:18:17 -0500263.TP
264.B \-i, \-\-info=partnum
265Show detailed partition information. The summary information produced by
266the \fI\-p\fR command necessarily omits many details, such as the partition's
267unique GUID and the translation of \fBsgdisk\fR's
268internal partition type code to a plain type name. The \fI\-i\fR option
269displays this information for a single partition.
270
271.TP
272.B \-l, \-\-load\-backup=file
273Load partition data from a backup file. This option is the reverse of the
274\fI\-b\fR option. Note that restoring partition data from anything
275but the original disk is not recommended.
276
277.TP
278.B \-L, \-\-list\-types
279Display a summary of partition types. GPT uses a GUID to identify
280partition types for particular OSes and purposes. For ease of data entry,
281\fBsgdisk\fR compresses these into two\-byte (four\-digit hexadecimal)
282values that are related to their equivalent MBR codes. Specifically, the
283MBR code is multiplied by hexadecimal 0x0100. For instance, the code for
284Linux swap space in MBR is 0x82, and it's 0x8200 in \fBgdisk\fR.
285A one\-to\-one correspondence is impossible, though. Most notably, many DOS,
286Windows, and Linux data partition codes correspond to a single GPT code
287(entered as 0x0700 in \fBsgdisk\fR). Some OSes use a single MBR code but
288employ many more codes in GPT. For these, \fBsgdisk\fR
289adds code numbers sequentially, such as 0xa500 for a FreeBSD disklabel,
2900xa501 for FreeBSD boot, 0xa502 for FreeBSD swap, and so on. Note that
291these two\-byte codes are unique to \fBgdisk\fR and \fBsgdisk\fR. This
292option does not require you to specify a valid disk device filename.
293
srs569455d92612010-03-07 22:16:07 -0500294.TP
srs569408bb0da2010-02-19 17:19:55 -0500295.B \-m, \-\-gpttombr
296Convert disk from GPT to MBR form. This option takes from one to four
297partition numbers, separated by colons, as arguments. Their type codes are
298based on the GPT fdisk type codes divided by 0x0100. If the active/bootable
299flag should be set, you must do so in another program, such as \fBfdisk\fR.
300The \fBgdisk\fR program offers additional MBR conversion options. It is not
301possible to convert more than four partitions from GPT to MBR form or to
302convert partitions that start above the 2TiB mark or that are larger than
3032TiB.
304
srs569473ba4792010-01-12 18:18:17 -0500305.TP
306.B \-n, \-\-new=partnum:start:end
307Create a new partition. You enter a partition
308number, starting sector, and an ending sector. Both start and end sectors
309can be specified in absolute terms as sector numbers or as positions
310measured in kilobytes (K), megabytes (M), gigabytes (G), or terabytes (T);
311for instance, \fI\fB40M\fR\fR specifies a position 40MiB from the start of
312the disk. You can specify locations relative to the start or end of the
313specified default range by preceding the number by a '+' or '\-' symbol, as
314in \fI\fB+2G\fR\fR to specify a point 2GiB after the default start sector,
315or \fI\fB\-200M\fR\fR to specify a point 200MiB before the last available
316sector. Pressing the Enter key with no input specifies the default value,
317which is the start of the largest available block for the start sector and
318the end of the same block for the end sector.
319
srs56949ba54212010-05-18 23:24:02 -0400320.TP
srs569461768bc2010-07-04 01:54:00 -0400321.B \-N, \-\-largest\-new=num
srs56949ba54212010-05-18 23:24:02 -0400322Create a new partition that fills the largest available block of space on
323the disk. Note that if used on a completely blank disk, this is likely to
324result in a sector-moved warning, since the first available sector
325(normally 34) doesn't fall on a 2048-sector boundary (the default for
326alignment). You can use the \fI\-a\fR (\fI\-\-set\-alignment\fR) option to
327adjust the alignment, if desired.
328
srs569473ba4792010-01-12 18:18:17 -0500329.TP
330.B \-o, \-\-clear
331Clear out all partition data. This includes GPT header data,
332all partition definitions, and the protective MBR.
333
334.TP
335.B \-p, \-\-print
336Display basic partition summary data. This includes partition
337numbers, starting and ending sector numbers, partition sizes,
338\fBsgdisk\fR's partition types codes, and partition names. For
339additional information, use the \fI\-i\fR (\fI\-\-info\fR) option.
340
341.TP
342.B \-P, \-\-pretend
343Pretend to make specified changes. In\-memory GPT data structures are
344altered according to other parameters, but changes are not written
345to disk.
346
srs569455d92612010-03-07 22:16:07 -0500347.TP
srs569408bb0da2010-02-19 17:19:55 -0500348.B \-r, \-\-transpose
349Swap two partitions' entries in the partition table. One or both partitions
350may be empty, although swapping two empty partitions is pointless. For
351instance, if partitions 1\-4 are defined, transposing 1 and 5 results in a
352table with partitions numbered from 2\-5. Transposing partitions in this
353way has no effect on their disk space allocation; it only alters their
354order in the partition table.
355
srs56949ddc14b2010-08-22 22:44:42 -0400356.TP
357.B \-R, \-\-replicate=second_device_filename
358Replicate the main device's partition table on the specified second device.
359Note that the replicated partition table is an exact copy, including all
360GUIDs; if the device should have its own unique GUIDs, you should use the
361\-G option on the new disk.
362
srs569473ba4792010-01-12 18:18:17 -0500363.TP
364.B \-s, \-\-sort
365Sort partition entries. GPT partition numbers need not match the order of
366partitions on the disk. If you want them to match, you can use this option.
367Note that some partitioning utilities sort partitions whenever they make
368changes. Such changes will be reflected in your device filenames, so you
369may need to edit \fI/etc/fstab\fR if you use this option.
370
371.TP
srs5694327129e2010-09-22 01:07:31 -0400372.B \-t, \-\-typecode=partnum:{hexcode|GUID}
373Change a single partition's type code. You enter the type code using either
374a two\-byte hexadecimal number, as described earlier, or a fully-specified
375GUID value, such as EBD0A0A2-B9E5-4433-87C0-68B6B72699C7.
srs569473ba4792010-01-12 18:18:17 -0500376
377.TP
378.B \-T, \-\-transform\-bsd=partnum
379Transform BSD partitions into GPT partitions. This option works on BSD
380disklabels held within GPT (or converted MBR) partitions. Converted
381partitions' type codes are likely to need manual adjustment. \fBsgdisk\fR
382will attempt to convert BSD disklabels stored on the main disk when
383launched, but this conversion is likely to produce first and/or last
384partitions that are unusable. The many BSD variants means that the
385probability of \fBsgdisk\fR being unable to convert a BSD disklabel is
386high compared to the likelihood of problems with an MBR conversion.
387
srs56949ba54212010-05-18 23:24:02 -0400388.TP
389.B \-u, \-\-partition-guid=partnum:guid
srs56948f1b2d62010-05-23 13:07:19 -0400390Set the partition unique GUID for an individual partition. The GUID may be
391a complete GUID or 'R' to set a random GUID.
srs56949ba54212010-05-18 23:24:02 -0400392
393.TP
394.B \-U, \-\-disk-guid=guid
srs56948f1b2d62010-05-23 13:07:19 -0400395Set the GUID for the disk. The GUID may be a complete GUID or 'R' to set a
396random GUID.
srs56949ba54212010-05-18 23:24:02 -0400397
srs569473ba4792010-01-12 18:18:17 -0500398.TP
399.B \-\-usage
400Print a brief summary of available options.
401
402.TP
403.B \-v, \-\-verify
404Verify disk. This option checks for a variety of problems, such as
405incorrect CRCs and mismatched main and backup data. This option does not
406automatically correct most problems, though; for that, you must use
407options on the recovery & transformation menu. If no problems are found,
408this command displays a summary of unallocated disk space.
409
410.TP
411.B \-V, \-\-version
412Display program version information. This option may be used without
413specifying a device filename.
414
415.TP
416.B \-z, \-\-zap
srs569408bb0da2010-02-19 17:19:55 -0500417Zap (destroy) the GPT data structures and then exit. Use this option if you
418want to repartition a GPT disk using \fBfdisk\fR or some other GPT\-unaware
419program. This option destroys only the GPT data structures; it leaves the
420MBR intact. This makes it useful for wiping out GPT data structures after a
srs569455d92612010-03-07 22:16:07 -0500421disk has been repartitioned for MBR using a GPT\-unaware utility; however,
srs569408bb0da2010-02-19 17:19:55 -0500422there's a risk that it will damage boot loaders or even the start of the
423first or end of the last MBR partition. If you use it on a valid GPT disk,
424the MBR will be left with an inappropriate EFI GPT (0xEE) partition
425definition, which you can delete using another utility.
426
srs569455d92612010-03-07 22:16:07 -0500427.TP
srs569408bb0da2010-02-19 17:19:55 -0500428.B \-Z, \-\-zap\-all
429Zap (destroy) the GPT and MBR data structures and then exit. This option
430works much like \fI\-z\fR, but as it wipes the MBR as well as the GPT, it's
431more suitable if you want to repartition a disk after using this option,
432and completely unsuitable if you've already repartitioned the disk.
srs569473ba4792010-01-12 18:18:17 -0500433
434.TP
435.B \-?, \-\-help
436Print a summary of options.
437
438.SH "RETURN VALUES"
439\fBsgdisk\fR returns various values depending on its success or failure:
440
441.TP
442.B 0
443Normal program execution
444
445.TP
446.B 1
447Too few arguments
448
449.TP
srs56943c0af382010-01-15 19:19:18 -0500450.B 2
srs569473ba4792010-01-12 18:18:17 -0500451An error occurred while reading the partition table
452
453.TP
454.B 3
455Non\-GPT disk detected and no \fI\-g\fR option
456
457.TP
458.B 4
459An error prevented saving changes
460.SH "BUGS"
srs56948a4ddfc2010-03-21 19:05:49 -0400461As of March 2010 (version 0.6.6), \fBsgdisk\fR
srs569473ba4792010-01-12 18:18:17 -0500462should be considered beta software. Known bugs and limitations include:
463
464.TP
465.B *
466The program compiles correctly only on Linux, FreeBSD, and Mac OS X. Linux
467versions for x86\-64 (64\-bit), x86 (32\-bit), and PowerPC (32\-bit) have been
468tested, with the x86\-64 version having seen the most testing.
469
470.TP
471.B *
472The FreeBSD version of the program can't write changes to the partition
473table to a disk when existing partitions on that disk are mounted. (The
474same problem exists with many other FreeBSD utilities, such as
srs56947dbb9322010-01-20 16:56:30 -0500475\fBgpt\fR, \fBfdisk\fR, and \fBdd\fR.) This limitation can be overcome
476by typing \fBsysctl kern.geom.debugflags=16\fR at a shell prompt.
srs569473ba4792010-01-12 18:18:17 -0500477
478.TP
479.B *
480The fields used to display the start and end sector numbers for partitions
481in the \fI\-p\fR option are 14 characters wide. This translates to a limitation
482of about 45 PiB. On larger disks, the displayed columns will go out of
483alignment.
484
485.TP
486.B *
487Only ASCII characters are supported in the partition name field. If an
488existing partition uses non\-ASCII UTF\-16 characters, they're likely to be
489corrupted in the 'i' and 'p' menu options' displays; however, they should be
490preserved when loading and saving partitions.
491
492.TP
493.B *
494The program can load only up to 128 partitions (4 primary partitions and
495124 logical partitions) when converting from MBR format. This limit can
496be raised by changing the \fI#define MAX_MBR_PARTS\fR line in the
497\fImbr.h\fR source code file and recompiling; however, such a change
498will require using a larger\-than\-normal partition table. (The limit
499of 128 partitions was chosen because that number equals the 128 partitions
500supported by the most common partition table size.)
501
502.TP
503.B *
504Converting from MBR format sometimes fails because of insufficient space at
505the start or (more commonly) the end of the disk. Resizing the partition
506table (using the 's' option in the experts' menu) can sometimes overcome
507this problem; however, in extreme cases it may be necessary to resize a
508partition using GNU Parted or a similar tool prior to conversion with
509\fBgdisk\fR.
510
511.TP
512.B *
513MBR conversions work only if the disk has correct LBA partition
514descriptors. These descriptors should be present on any disk over 8 GiB in
515size or on smaller disks partitioned with any but very ancient software.
516
517.TP
518.B *
519BSD disklabel support can create first and/or last partitions that overlap
520with the GPT data structures. This can sometimes be compensated by
521adjusting the partition table size, but in extreme cases the affected
522partition(s) may need to be deleted.
523
524.TP
525.B *
526Because of the highly variable nature of BSD disklabel structures,
527conversions from this form may be unreliable \-\- partitions may be dropped,
528converted in a way that creates overlaps with other partitions, or
529converted with incorrect start or end values. Use this feature with
530caution!
531
532.TP
533.B *
534Booting after converting an MBR or BSD disklabel disk is likely to be
535disrupted. Sometimes re\-installing a boot loader will fix the problem, but
536other times you may need to switch boot loaders. Except on EFI\-based
537platforms, Windows through at least Windows 7 RC doesn't support booting
538from GPT disks. Creating a hybrid MBR (using the 'h' option on the recovery &
539transformation menu) or abandoning GPT in favor of MBR may be your only
540options in this case.
541
542.PP
543
544The support for big\-endian CPUs (PowerPC, for example) is new, as of version
5450.3.5. I advise using caution on that platform, particularly with the more
546obscure features of the program.
547
548.SH "AUTHORS"
549Primary author: Roderick W. Smith (rodsmith@rodsbooks.com)
550
551Contributors:
552
553* Yves Blusseau (1otnwmz02@sneakemail.com)
554
555* David Hubbard (david.c.hubbard@gmail.com)
556
srs569461768bc2010-07-04 01:54:00 -0400557* Justin Maggard (justin.maggard@netgear.com)
srs56948f1b2d62010-05-23 13:07:19 -0400558
srs5694659eaf12010-08-23 11:26:12 -0400559* Dwight Schauer (dschauer@ti.com)
560
561
srs569473ba4792010-01-12 18:18:17 -0500562.SH "SEE ALSO"
563\fBcfdisk (8)\fR,
564\fBfdisk (8)\fR,
565\fBgdisk (8)\fR,
566\fBmkfs (8)\fR,
567\fBparted (8)\fR,
568\fBsfdisk (8)\fR
569
570\fIhttp://en.wikipedia.org/wiki/GUID_Partition_Table\fR
571
572\fIhttp://developer.apple.com/technotes/tn2006/tn2166.html\fR
573
574\fIhttp://www.rodsbooks.com/gdisk/\fR
575
576.SH "AVAILABILITY"
577The \fBsgdisk\fR command is part of the \fIGPT fdisk\fR package and is
578available from Rod Smith.