1SGDISK(8)                      GPT fdisk Manual                      SGDISK(8)
2
3
4

NAME

6       sgdisk  - Command-line GUID partition table (GPT) manipulator for Linux
7       and Unix
8

SYNOPSIS

10       sgdisk [ options ] device
11
12

DESCRIPTION

14       GPT fdisk is a text-mode menu-driven package for creation and manipula‐
15       tion  of  partition  tables. It consists of two programs: the text-mode
16       interactive gdisk and the command-line sgdisk. Either program will  au‐
17       tomatically convert an old-style Master Boot Record (MBR) partition ta‐
18       ble or BSD disklabel stored without an MBR  carrier  partition  to  the
19       newer  Globally  Unique Identifier (GUID) Partition Table (GPT) format,
20       or will load a GUID partition table. This man page documents  the  com‐
21       mand-line sgdisk program.
22
23       Some advanced data manipulation and recovery options require you to un‐
24       derstand the distinctions between the main and backup data, as well  as
25       between  the  GPT  headers and the partition tables. For information on
26       MBR vs. GPT, as well as GPT terminology and structure, see the extended
27       gdisk   documentation  at  http://www.rodsbooks.com/gdisk/  or  consult
28       Wikipedia.
29
30       The sgdisk program employs a user interface that's  based  entirely  on
31       the  command  line, making it suitable for use in scripts or by experts
32       who want to make one or two quick changes to a disk. (The  program  may
33       query  the  user when certain errors are encountered, though.) The pro‐
34       gram's name is based on sfdisk, but the user options of  the  two  pro‐
35       grams are entirely different from one another.
36
37       Ordinarily,  sgdisk  operates on disk device files, such as /dev/sda or
38       /dev/hda under Linux,  /dev/disk0  under  Mac  OS  X,  or  /dev/ad0  or
39       /dev/da0  under  FreeBSD.  The  program  can also operate on disk image
40       files, which can be either copies of whole disks (made with dd, for in‐
41       stance)  or  raw  disk images used by emulators such as QEMU or VMWare.
42       Note that only raw disk images are supported;  sgdisk  cannot  work  on
43       compressed or other advanced disk image formats.
44
45       The  MBR partitioning system uses a combination of cylinder/head/sector
46       (CHS) addressing and logical block  addressing  (LBA).  The  former  is
47       klunky  and limiting. GPT drops CHS addressing and uses 64-bit LBA mode
48       exclusively. Thus, GPT data structures, and therefore  sgdisk,  do  not
49       need to deal with CHS geometries and all the problems they create.
50
51       For best results, you should use an OS-specific partition table program
52       whenever possible. For example, you should make  Mac  OS  X  partitions
53       with  the  Mac  OS X Disk Utility program and Linux partitions with the
54       Linux gdisk, sgdisk, or GNU Parted programs.
55
56       Upon start, sgdisk attempts to identify the partition type  in  use  on
57       the  disk.  If  it  finds valid GPT data, sgdisk will use it. If sgdisk
58       finds a valid MBR or BSD disklabel but no GPT data, it will attempt  to
59       convert  the MBR or disklabel into GPT form. (BSD disklabels are likely
60       to have unusable first and/or final  partitions  because  they  overlap
61       with  the GPT data structures, though.) GPT fdisk can identify, but not
62       use data in, Apple Partition Map (APM) disks, which are used on  680x0-
63       and  PowerPC-based  Macintoshes. If you specify any option that results
64       in changes to an MBR or BSD disklabel, sgdisk ignores those changes un‐
65       less the -g (--mbrtogpt), -z (--zap), or -Z (--zap-all) option is used.
66       If you use the -g option, sgdisk replaces the MBR or disklabel  with  a
67       GPT.  This  action is potentially dangerous! Your system may become un‐
68       bootable, and partition type codes may become  corrupted  if  the  disk
69       uses  unrecognized type codes. Boot problems are particularly likely if
70       you're multi-booting with any GPT-unaware OS.
71
72       The MBR-to-GPT conversion will leave at least one gap in the  partition
73       numbering  if  the original MBR used logical partitions. These gaps are
74       harmless, but you can eliminate them by using the -s  (--sort)  option,
75       if  you  like.  (Doing  this  may require you to update your /etc/fstab
76       file.)
77
78       When creating a fresh partition table, certain considerations may be in
79       order:
80
81
82       *      For data (non-boot) disks, and for boot disks used on BIOS-based
83              computers with GRUB as the boot loader, partitions may  be  cre‐
84              ated in whatever order and in whatever sizes are desired.
85
86
87       *      Boot disks for EFI-based systems require an EFI System Partition
88              (gdisk internal code 0xEF00) formatted as FAT-32. I  recommended
89              making  this  partition  550  MiB. (Smaller ESPs are common, but
90              some EFIs have flaky FAT drivers that necessitate a larger  par‐
91              tition  for  reliable  operation.) Boot-related files are stored
92              here. (Note that GNU Parted identifies such partitions as having
93              the "boot flag" set.)
94
95
96       *      Some boot loaders for BIOS-based systems make use of a BIOS Boot
97              Partition (gdisk internal code 0xEF02), in which  the  secondary
98              boot  loader  is  stored,  possibly  without  the  benefit  of a
99              filesystem. (GRUB2 may optionally use such  a  partition.)  This
100              partition  can  typically be quite small (roughly 32 to 200 KiB,
101              although 1 MiB is more common in practice), but you should  con‐
102              sult your boot loader documentation for details.
103
104
105       *      If  Windows  is to boot from a GPT disk, a partition of type Mi‐
106              crosoft Reserved (sgdisk internal code 0x0C01)  is  recommended.
107              This  partition  should  be about 128 MiB in size. It ordinarily
108              follows the EFI System Partition and  immediately  precedes  the
109              Windows  data  partitions. (Note that GNU Parted creates all FAT
110              partitions as this type, which actually makes the partition  un‐
111              usable for normal file storage in both Windows and Mac OS X.)
112
113
114       *      Some  OSes' GPT utilities create some blank space (typically 128
115              MiB) after each partition. The intent is to enable  future  disk
116              utilities  to use this space. Such free space is not required of
117              GPT disks, but creating it may help in future disk maintenance.
118
119

OPTIONS

121       Some options take no arguments, others take one argument  (typically  a
122       partition number), and others take compound arguments with colon delim‐
123       itation. For instance, -n (--new) takes a partition number, a  starting
124       sector   number,   and  an  ending  sector  number,  as  in  sgdisk  -n
125       2:2000:50000 /dev/sdc, which  creates  a  new  partition,  numbered  2,
126       starting at sector 2000 an ending at sector 50,000, on /dev/sdc.
127
128       Unrelated options may be combined; however, some such combinations will
129       be nonsense (such as deleting a partition and then  changing  its  GUID
130       type  code).   sgdisk  interprets options in the order in which they're
131       entered, so effects can vary depending on order. For  instance,  sgdisk
132       -s  -d 2 sorts the partition table entries and then deletes partition 2
133       from the newly-sorted list; but sgdisk -d 2  -s  deletes  the  original
134       partition 2 and then sorts the modified partition table.
135
136       Error checking and opportunities to correct mistakes in sgdisk are min‐
137       imal. Although the program endeavors to keep the  GPT  data  structures
138       legal,  it  does  not prompt for verification before performing its ac‐
139       tions. Unless you require a command-line-driven program, you should use
140       the interactive gdisk instead of sgdisk, since gdisk allows you to quit
141       without saving your changes, should you make a mistake.
142
143       Although sgdisk is based on the  same  partition-manipulation  code  as
144       gdisk,  sgdisk  implements fewer features than its interactive sibling.
145       Options available in sgdisk are:
146
147
148       -a, --set-alignment=value
149              Set the sector alignment multiple. GPT fdisk aligns the start of
150              partitions  to  sectors  that are multiples of this value, which
151              defaults to 1 MiB (2048  on  disks  with  512-byte  sectors)  on
152              freshly  formatted  disks.  This alignment value is necessary to
153              obtain optimum performance with Western Digital Advanced  Format
154              and  similar  drives  with  larger  physical than logical sector
155              sizes, with some types of RAID arrays,  and  with  SSD  devices.
156              When the -I option is used, this same alignment value is used to
157              determine partition end points; but partitions end at  one  less
158              than  a  multiple  of this value, to keep the partition length a
159              multiple of this value.
160
161
162       -A,        --attributes=list|[partnum:show|or|nand|xor|=|set|clear|tog‐
163       gle|get[:bitnum|hexbitmask]]
164              View  or  set  partition  attributes.  Use  list  to see defined
165              (known) attribute values. Omit the partition  number  (and  even
166              the  device filename) when using this option. The others require
167              a partition number. The show and get options  show  the  current
168              attribute  settings (all attributes or for a particular bit, re‐
169              spectively). The or, nand, xor, =, set, clear,  and  toggle  op‐
170              tions  enable  you  to  change the attribute bit value. The set,
171              clear, toggle, and get options work on a bit number; the  others
172              work  on  a  hexadecimal  bit  mask. For example, type sgdisk -A
173              4:set:2 /dev/sdc  to  set  the  bit  2  attribute  (legacy  BIOS
174              bootable) on partition 4 on /dev/sdc.
175
176
177       -b, --backup=file
178              Save  partition data to a backup file. You can back up your cur‐
179              rent in-memory partition table to a disk file using this option.
180              The resulting file is a binary file consisting of the protective
181              MBR, the main GPT header, the backup GPT header, and one copy of
182              the  partition  table, in that order. Note that the backup is of
183              the current in-memory data structures, so if you launch the pro‐
184              gram,  make  changes,  and then use this option, the backup will
185              reflect your changes. If the GPT data  structures  are  damaged,
186              the  backup  may  not  accurately reflect the damaged state; in‐
187              stead, they will reflect GPT fdisk's  first-pass  interpretation
188              of the GPT.
189
190
191       -B, --byte-swap-name=partnum
192              Swap  the  byte  order  for the name of the specified partition.
193              Some partitioning tools, including GPT fdisk 1.0.7 and  earlier,
194              can  write the partition name in the wrong byte order on big-en‐
195              dian computers, such as the IBM  s390  mainframes  and  PowerPC-
196              based Macs. This feature corrects this problem.
197
198
199       -c, --change-name=partnum:name
200              Change  the  GPT  name of a partition. This name is encoded as a
201              UTF-16 string, but proper entry and display of  anything  beyond
202              basic  ASCII  values  requires suitable locale and font support.
203              For the most part, Linux ignores the partition name, but it  may
204              be  important  in  some OSes. If you want to set a name that in‐
205              cludes a space, enclose it in quotation marks, as in  sgdisk  -c
206              1:"Sample  Name" /dev/sdb. Note that the GPT name of a partition
207              is distinct from the filesystem name, which is  encoded  in  the
208              filesystem's data structures.
209
210
211       -C, --recompute-chs
212              Recompute  CHS  values  in protective or hybrid MBR. This option
213              can sometimes help if a disk utility, OS, or BIOS  doesn't  like
214              the  CHS  values used by the partitions in the protective or hy‐
215              brid MBR. In particular, the GPT specification  requires  a  CHS
216              value  of  0xFFFFFF  for over-8GiB partitions, but this value is
217              technically illegal by the usual standards. Some BIOSes hang  if
218              they  encounter  this  value.  This option will recompute a more
219              normal CHS value -- 0xFEFFFF for over-8GiB partitions,  enabling
220              these BIOSes to boot.
221
222
223       -d, --delete=partnum
224              Delete  a partition. This action deletes the entry from the par‐
225              tition table but does not disturb the data  within  the  sectors
226              originally  allocated  to the partition on the disk. If a corre‐
227              sponding hybrid MBR partition exists, gdisk deletes it, as well,
228              and expands any adjacent 0xEE (EFI GPT) MBR protective partition
229              to fill the new free space.
230
231
232       -D, --display-alignment
233              Display current sector alignment value. Partitions will be  cre‐
234              ated  on  multiples of the sector value reported by this option.
235              You can change the alignment value with the -a option.
236
237
238       -e, --move-second-header
239              Move backup GPT data structures to the end of the disk. Use this
240              option  if  you've  added disks to a RAID array, thus creating a
241              virtual disk with space that follows the backup GPT data  struc‐
242              tures.  This command moves the backup GPT data structures to the
243              end of the disk, where they belong.
244
245
246       -E, --end-of-largest
247              Displays the sector number of the end of the  largest  available
248              block  of sectors on the disk. A script may store this value and
249              pass it back as part of -n's option to create a partition. If no
250              unallocated  sectors  are  available,  this function returns the
251              value 0.
252
253
254       -f, --first-in-largest
255              Displays the sector number of the start of the largest available
256              block  of sectors on the disk. A script may store this value and
257              pass it back as part of -n's option to create a partition. If no
258              unallocated  sectors  are  available,  this function returns the
259              value 0. Note that this parameter is blind to  partition  align‐
260              ment;  when  you  actually  create  a partition, its start point
261              might be changed from this value.
262
263
264       -F, --first-aligned-in-largest
265              Similar to -f (--first-in-largest), except  returns  the  sector
266              number  with  the current alignment correction applied. Use this
267              function if you need to compute the actual partition start point
268              rather  than a theoretical start point or the actual start point
269              if you set the alignment value to 1.
270
271
272       -g, --mbrtogpt
273              Convert an MBR or BSD disklabel disk to a GPT disk. As a  safety
274              measure,  use of this option is required on MBR or BSD disklabel
275              disks if you intend to save your changes, in  order  to  prevent
276              accidentally damaging such disks.
277
278
279       -G, --randomize-guids
280              Randomize  the disk's GUID and all partitions' unique GUIDs (but
281              not their partition type code GUIDs). This function may be  used
282              after  cloning  a  disk  in order to render all GUIDs once again
283              unique.
284
285
286       -h, --hybrid
287              Create a hybrid MBR. This option takes from one to three  parti‐
288              tion numbers, separated by colons, as arguments. You may option‐
289              ally specify a final partition "EE" to indicate that the EFI GPT
290              (type  0xEE)  should  be  placed last in the table, otherwise it
291              will be placed first, followed by the partition(s) you  specify.
292              Their  type  codes are based on the GPT fdisk type codes divided
293              by 0x0100, which is usually correct for Windows  partitions.  If
294              the  active/bootable  flag  should be set, you must do so in an‐
295              other program, such as fdisk. The  gdisk  program  offers  addi‐
296              tional hybrid MBR creation options.
297
298
299       -i, --info=partnum
300              Show  detailed  partition  information.  The summary information
301              produced by the -p command necessarily omits many details,  such
302              as  the  partition's unique GUID and the translation of sgdisk's
303              internal partition type code to a plain type name. The -i option
304              displays this information for a single partition.
305
306
307       -I, --align-end
308              When  possible,  align  the end points of partitions to one less
309              than a multiple of the alignment value. When both start and  end
310              points are aligned, partitions should be multiples of the align‐
311              ment value in size, which is necessary for  some  partition  en‐
312              cryption tools to function correctly. This option applies to all
313              partitions created after this option on the command  line.  Note
314              that this alignment is not always possible; for instance, if the
315              free space at the end of a  disk  is  less  than  the  alignment
316              value,  with  the  current final partition being aligned, and if
317              sgdisk is asked to create a partition in  that  space,  then  it
318              will not be end-aligned.
319
320
321       -j, --adjust-main-table=sector
322              Adjust  the  location of the main partition table. This value is
323              normally 2, but it may need to be increased in some cases,  such
324              as  when  a system-on-chip (SoC) is hard-coded to read boot code
325              from sector 2. I recommend against adjusting this  value  unless
326              doing so is absolutely necessary.
327
328
329       -l, --load-backup=file
330              Load  partition  data from a backup file. This option is the re‐
331              verse of the -b option. Note that restoring partition data  from
332              anything  but  the original disk is not recommended. This option
333              will work even if the disk's original partition  table  is  bad;
334              however, most other options on the same command line will be ig‐
335              nored.
336
337
338       -L, --list-types
339              Display a summary of partition types. GPT uses a GUID  to  iden‐
340              tify  partition types for particular OSes and purposes. For ease
341              of data entry, sgdisk compresses these into two-byte (four-digit
342              hexadecimal)  values  that  are  related to their equivalent MBR
343              codes. Specifically, the MBR code is multiplied  by  hexadecimal
344              0x0100.  For  instance,  the code for Linux swap space in MBR is
345              0x82, and it's 0x8200 in gdisk. A one-to-one  correspondence  is
346              impossible, though. Most notably, the codes for all varieties of
347              FAT and NTFS partition correspond to a single GPT code  (entered
348              as 0x0700 in sgdisk). Some OSes use a single MBR code but employ
349              many more codes in GPT. For these, sgdisk adds code numbers  se‐
350              quentially,  such  as 0xa500 for a FreeBSD disklabel, 0xa501 for
351              FreeBSD boot, 0xa502 for FreeBSD swap,  and  so  on.  Note  that
352              these two-byte codes are unique to gdisk and sgdisk. This option
353              does not require you to specify a valid disk device filename.
354
355
356       -m, --gpttombr
357              Convert disk from GPT to MBR form. This option takes from one to
358              four partition numbers, separated by colons, as arguments. Their
359              type codes are based on the GPT  fdisk  type  codes  divided  by
360              0x0100.  If  the active/bootable flag should be set, you must do
361              so in another program, such as fdisk.  The gdisk program  offers
362              additional MBR conversion options. It is not possible to convert
363              more than four partitions from GPT to MBR  form  or  to  convert
364              partitions  that  start  above  the 2TiB mark or that are larger
365              than 2TiB.
366
367
368       -n, --new=partnum:start:end
369              Create a new partition. You enter a partition  number,  starting
370              sector,  and an ending sector. Both start and end sectors can be
371              specified in absolute terms as sector numbers  or  as  positions
372              measured   in  kibibytes  (K),  mebibytes  (M),  gibibytes  (G),
373              tebibytes (T), or pebibytes (P); for instance, 40M  specifies  a
374              position 40MiB from the start of the disk. You can specify loca‐
375              tions relative to the start or  end  of  the  specified  default
376              range  by preceding the number by a '+' or '-' symbol, as in +2G
377              to specify a point 2GiB after the default start sector, or -200M
378              to  specify  a  point 200MiB before the last available sector. A
379              start or end value of 0 specifies the default  value,  which  is
380              the  start  of  the largest available block for the start sector
381              and the end of the same block for  the  end  sector.  A  partnum
382              value  of 0 causes the program to use the first available parti‐
383              tion number.  Subsequent  uses  of  the  -A  (--attributes),  -c
384              (--change-name),  -t (--typecode), and -u (--partition-guid) op‐
385              tions may also use 0 to refer to the same partition.
386
387
388       -N, --largest-new=num
389              Create a new partition that fills the largest available block of
390              space  on  the disk. You can use the -a (--set-alignment) option
391              to adjust the alignment, if desired. A num value of 0 causes the
392              program to use the first available partition number.
393
394
395       -o, --clear
396              Clear out all partition data. This includes GPT header data, all
397              partition definitions, and the protective MBR.  Note  that  this
398              operation  will,  like  most other operations, fail on a damaged
399              disk. If you want to prepare a disk you know to be  damaged  for
400              GPT  use, you should first wipe it with -Z and then partition it
401              normally. This option will work even if the disk's original par‐
402              tition  table  is  bad;  however, most other options on the same
403              command line will be ignored.
404
405
406       -O, --print-mbr
407              Display basic MBR partition summary data. This  includes  parti‐
408              tion  numbers,  starting  and  ending  sector numbers, partition
409              sizes, MBR partition types codes, and partition names. This  op‐
410              tion  is  useful mainly for diagnosing partition table problems,
411              particularly on disks with hybrid MBRs.
412
413
414       -p, --print
415              Display basic GPT partition summary data. This  includes  parti‐
416              tion  numbers,  starting  and  ending  sector numbers, partition
417              sizes, sgdisk's partition types codes, and partition names.  For
418              additional information, use the -i (--info) option.
419
420
421       -P, --pretend
422              Pretend to make specified changes. In-memory GPT data structures
423              are altered according to other parameters, but changes  are  not
424              written to disk.
425
426
427       -r, --transpose
428              Swap two partitions' entries in the partition table. One or both
429              partitions may be empty, although swapping two empty  partitions
430              is  pointless.  For  instance,  if  partitions  1-4 are defined,
431              transposing 1 and 5 results in a table with partitions  numbered
432              from  2-5.  Transposing  partitions in this way has no effect on
433              their disk space allocation; it only alters their order  in  the
434              partition table.
435
436
437       -R, --replicate=second_device_filename
438              Replicate  the  main  device's  partition table on the specified
439              second device.  Note that the replicated partition table  is  an
440              exact  copy,  including all GUIDs; if the device should have its
441              own unique GUIDs, you should use the -G option on the new disk.
442
443
444       -s, --sort
445              Sort partition entries. GPT partition numbers need not match the
446              order  of partitions on the disk. If you want them to match, you
447              can use this option.  Note that some partitioning utilities sort
448              partitions  whenever they make changes. Such changes will be re‐
449              flected in your device  filenames,  so  you  may  need  to  edit
450              /etc/fstab if you use this option.
451
452
453       -t, --typecode=partnum:{hexcode|GUID}
454              Change  a  single partition's type code. You enter the type code
455              using either a two-byte hexadecimal number,  as  described  ear‐
456              lier,    or    a    fully-specified    GUID   value,   such   as
457              EBD0A0A2-B9E5-4433-87C0-68B6B72699C7.
458
459
460       -T, --transform-bsd=partnum
461              Transform BSD partitions into GPT partitions. This option  works
462              on BSD disklabels held within GPT (or converted MBR) partitions.
463              Converted partitions' type codes are likely to need  manual  ad‐
464              justment.  sgdisk  will attempt to convert BSD disklabels stored
465              on the main disk when launched, but this conversion is likely to
466              produce first and/or last partitions that are unusable. The many
467              BSD variants means that the probability of sgdisk  being  unable
468              to convert a BSD disklabel is high compared to the likelihood of
469              problems with an MBR conversion.
470
471
472       -u, --partition-guid=partnum:guid
473              Set the partition unique GUID for an individual  partition.  The
474              GUID may be a complete GUID or 'R' to set a random GUID.
475
476
477       -U, --disk-guid=guid
478              Set  the  GUID  for the disk. The GUID may be a complete GUID or
479              'R' to set a random GUID.
480
481
482       --usage
483              Print a brief summary of available options.
484
485
486       -v, --verify
487              Verify disk. This option checks for a variety of problems,  such
488              as  incorrect CRCs and mismatched main and backup data. This op‐
489              tion does not automatically correct most problems,  though;  for
490              that,  you  must  use  options  on the recovery & transformation
491              menu. If no problems are found, this command displays a  summary
492              of  unallocated  disk  space.  This option will work even if the
493              disk's original partition table is bad; however, most other  op‐
494              tions on the same command line will be ignored.
495
496
497       -V, --version
498              Display  program  version  information.  This option may be used
499              without specifying a device filename.
500
501
502       -z, --zap
503              Zap (destroy) the GPT data structures and then  exit.  Use  this
504              option if you want to repartition a GPT disk using fdisk or some
505              other GPT-unaware program. This option  destroys  only  the  GPT
506              data  structures; it leaves the MBR intact. This makes it useful
507              for wiping out GPT data structures after a disk has been  repar‐
508              titioned for MBR using a GPT-unaware utility; however, there's a
509              risk that it will damage boot loaders or even the start  of  the
510              first or end of the last MBR partition. If you use it on a valid
511              GPT disk, the MBR will be left with  an  inappropriate  EFI  GPT
512              (0xEE)  partition definition, which you can delete using another
513              utility.
514
515
516       -Z, --zap-all
517              Zap (destroy) the GPT and MBR data  structures  and  then  exit.
518              This  option works much like -z, but as it wipes the MBR as well
519              as the GPT, it's more suitable if you want to repartition a disk
520              after using this option, and completely unsuitable if you've al‐
521              ready repartitioned the disk.
522
523
524       -?, --help
525              Print a summary of options.
526
527

RETURN VALUES

529       sgdisk returns various values depending on its success or failure:
530
531
532       0      Normal program execution
533
534
535       1      Too few arguments
536
537
538       2      An error occurred while reading the partition table
539
540
541       3      Non-GPT disk detected and no -g option, but operation requires a
542              write action
543
544
545       4      An error prevented saving changes
546
547
548       5      An error occurred while reading standard input (should never oc‐
549              cur with sgdisk, but may with gdisk)
550
551
552       8      Disk replication operation (-R) failed
553
554

BUGS

556       Known bugs and limitations include:
557
558
559       *      The program compiles correctly only on Linux, FreeBSD,  and  Mac
560              OS X. Linux versions for x86-64 (64-bit), x86 (32-bit), and Pow‐
561              erPC (32-bit) have been tested, with the x86-64  version  having
562              seen the most testing.
563
564
565       *      The  FreeBSD  version  of the program can't write changes to the
566              partition table to a disk when existing partitions on that  disk
567              are  mounted.  (The  same problem exists with many other FreeBSD
568              utilities, such as gpt, fdisk, and dd.) This limitation  can  be
569              overcome  by  typing  sysctl  kern.geom.debugflags=16 at a shell
570              prompt.
571
572
573       *      The fields used to display the start and end sector numbers  for
574              partitions  in the -p option are 14 characters wide. This trans‐
575              lates to a limitation of about 45 PiB. On larger disks, the dis‐
576              played columns will go out of alignment.
577
578
579       *      The program can load only up to 128 partitions (4 primary parti‐
580              tions and 124 logical partitions) when converting from MBR  for‐
581              mat.   This   limit  can  be  raised  by  changing  the  #define
582              MAX_MBR_PARTS line in the basicmbr.h source code file and recom‐
583              piling;   however,   such   a   change   will  require  using  a
584              larger-than-normal partition table. (The limit of 128 partitions
585              was  chosen  because  that number equals the 128 partitions sup‐
586              ported by the most common partition table size.)
587
588
589       *      Converting from MBR format sometimes fails because  of  insuffi‐
590              cient space at the start or (more commonly) the end of the disk.
591              Resizing the partition table (using the 's' option  in  the  ex‐
592              perts'  menu)  can  sometimes overcome this problem; however, in
593              extreme cases it may be necessary to resize  a  partition  using
594              GNU Parted or a similar tool prior to conversion with gdisk.
595
596
597       *      MBR  conversions work only if the disk has correct LBA partition
598              descriptors. These descriptors should be  present  on  any  disk
599              over  8 GiB in size or on smaller disks partitioned with any but
600              very ancient software.
601
602
603       *      BSD disklabel support can create first  and/or  last  partitions
604              that overlap with the GPT data structures. This can sometimes be
605              compensated by adjusting the partition table size,  but  in  ex‐
606              treme cases the affected partition(s) may need to be deleted.
607
608
609       *      Because  of  the  highly variable nature of BSD disklabel struc‐
610              tures, conversions from this form may be  unreliable  --  parti‐
611              tions  may  be dropped, converted in a way that creates overlaps
612              with other partitions, or converted with incorrect start or  end
613              values. Use this feature with caution!
614
615
616       *      Booting  after converting an MBR or BSD disklabel disk is likely
617              to be disrupted. Sometimes re-installing a boot loader will  fix
618              the  problem,  but other times you may need to switch boot load‐
619              ers. Except on EFI-based platforms,  Windows  through  at  least
620              Windows  7 RC doesn't support booting from GPT disks. Creating a
621              hybrid MBR (using the 'h' option on the recovery  &  transforma‐
622              tion  menu)  or  abandoning GPT in favor of MBR may be your only
623              options in this case.
624
625

AUTHORS

627       Primary author: Roderick W. Smith (rodsmith@rodsbooks.com)
628
629       Contributors:
630
631       * Yves Blusseau (1otnwmz02@sneakemail.com)
632
633       * David Hubbard (david.c.hubbard@gmail.com)
634
635       * Justin Maggard (justin.maggard@netgear.com)
636
637       * Dwight Schauer (das@teegra.net)
638
639       * Florian Zumbiehl (florz@florz.de)
640
641
642

SEE ALSO

644       cfdisk(8),   cgdisk(8),   fdisk(8),   gdisk(8),   mkfs(8),   parted(8),
645       sfdisk(8), fixparts(8).
646
647       http://en.wikipedia.org/wiki/GUID_Partition_Table
648
649       http://developer.apple.com/technotes/tn2006/tn2166.html
650
651       http://www.rodsbooks.com/gdisk/
652
653

AVAILABILITY

655       The  sgdisk  command  is part of the GPT fdisk package and is available
656       from Rod Smith.
657
658
659
660Roderick W. Smith                    1.0.9                           SGDISK(8)
Impressum