Lines Matching +full:- +full:- +full:disk
1 .\" Copyright 2011-2024 Roderick W. Smith (rodsmith@rodsbooks.com)
5 sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and Unix
12 GPT fdisk is a text\-mode menu\-driven package for creation and manipulation of
13 partition tables. It consists of two programs: the text\-mode interactive
14 \fBgdisk\fR and the command\-line \fBsgdisk\fR. Either program will
15 automatically convert an old\-style Master Boot Record (MBR) partition table
18 partition table. This man page documents the command\-line \fBsgdisk\fR
30 want to make one or two quick changes to a disk. (The program may query the
35 Ordinarily, \fBsgdisk\fR operates on disk device files, such as
38 can also operate on disk image files, which can be either copies of whole
39 disks (made with \fBdd\fR, for instance) or raw disk images used by
40 emulators such as QEMU or VMWare. Note that only \fIraw\fR disk images
42 disk image formats.
46 and limiting. GPT drops CHS addressing and uses 64\-bit LBA mode
51 For best results, you should use an OS\-specific partition table
53 partitions with the Mac OS X Disk Utility program and Linux partitions
57 the disk. If it finds valid GPT data, \fBsgdisk\fR will use it. If
62 data in, Apple Partition Map (APM) disks, which are used on 680x0\- and
63 PowerPC\-based Macintoshes. If you specify any option that results in
65 unless 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
69 partition type codes may become corrupted if the disk uses unrecognized
70 type codes. Boot problems are particularly likely if you're multi\-booting
71 with any GPT\-unaware OS.
73 The MBR\-to\-GPT conversion will leave at least one gap in the partition
75 harmless, but you can eliminate them by using the \fI\-s\fR (\fI\-\-sort\fR)
84 For data (non\-boot) disks, and for boot disks used on BIOS\-based computers
90 Boot disks for EFI\-based systems require an \fIEFI System Partition\fR
91 (\fBgdisk\fR internal code 0xEF00) formatted as FAT\-32. I recommended
94 operation.) Boot\-related files are stored here. (Note that GNU Parted
99 Some boot loaders for BIOS\-based systems make use of a \fIBIOS Boot
108 If Windows is to boot from a GPT disk, a partition of type \fIMicrosoft
119 each partition. The intent is to enable future disk utilities to use this
121 help in future disk maintenance.
126 instance, \fI\-n\fR (\fI\-\-new\fR) takes a partition number, a starting
127 sector number, and an ending sector number, as in \fBsgdisk \-n 2:2000:50000
134 effects can vary depending on order. For instance, \fBsgdisk \-s \-d 2\fR
136 newly\-sorted list; but \fBsgdisk \-d 2 \-s\fR deletes the original partition
142 require a command\-line\-driven program, you should use the interactive
146 Although \fBsgdisk\fR is based on the same partition\-manipulation code as
151 .B \-a, \-\-set\-alignment=value
154 on disks with 512-byte sectors) on freshly formatted disks. This alignment
158 \fI\-I\fR option is used, this same alignment value is used to determine
163 .B \-A, \-\-attributes=list|[partnum:show|or|nand|xor|=|set|clear|toggle|get[:bitnum|hexbitmask]]
173 \fBsgdisk \-A 4:set:2 /dev/sdc\fR to set the bit 2 attribute (legacy BIOS
177 .B \-b, \-\-backup=file
179 in\-memory partition table to a disk file using this option. The resulting
182 order. Note that the backup is of the current in\-memory data structures, so
186 will reflect GPT fdisk's first\-pass interpretation of the GPT.
189 .B \-B, \-\-byte\-swap\-name=partnum
192 partition name in the wrong byte order on big-endian computers, such as the
193 IBM s390 mainframes and PowerPC-based Macs. This feature corrects this
197 .B \-c, \-\-change\-name=partnum:name
198 Change the GPT name of a partition. This name is encoded as a UTF\-16
203 \fIsgdisk \-c 1:"Sample Name" /dev/sdb\fR. Note that the GPT name of a
208 .B \-C, \-\-recompute-chs
210 help if a disk utility, OS, or BIOS doesn't like the CHS values used by the
212 specification requires a CHS value of 0xFFFFFF for over-8GiB partitions,
215 CHS value -- 0xFEFFFF for over-8GiB partitions, enabling these BIOSes to
219 .B \-d, \-\-delete=partnum
222 the partition on the disk. If a corresponding hybrid MBR partition exists,
227 .B \-D, \-\-display\-alignment
230 with the \-a option.
233 .B \-e, \-\-move\-second\-header
234 Move backup GPT data structures to the end of the disk. Use this option if
235 you've added disks to a RAID array, thus creating a virtual disk with space
237 GPT data structures to the end of the disk, where they belong.
240 .B \-E, \-\-end\-of\-largest
242 sectors on the disk. A script may store this value and pass it back as
243 part of \fI\-n\fR's option to create a partition. If no unallocated
247 .B \-f, \-\-first\-in\-largest
249 sectors on the disk. A script may store this value and pass it back as
250 part of \fI\-n\fR's option to create a partition. If no unallocated
256 .B \-F, \-\-first\-aligned\-in\-largest
257 Similar to \fI\-f\fR (\fI\-\-first\-in\-largest\fR), except returns the
264 .B \-g, \-\-mbrtogpt
265 Convert an MBR or BSD disklabel disk to a GPT disk. As a safety measure, use of
270 .B \-G, \-\-randomize\-guids
271 Randomize the disk's GUID and all partitions' unique GUIDs (but not their
272 partition type code GUIDs). This function may be used after cloning a disk
276 .B \-h, \-\-hybrid
287 .B \-i, \-\-info=partnum
289 the \fI\-p\fR command necessarily omits many details, such as the partition's
291 internal partition type code to a plain type name. The \fI\-i\fR option
295 .B \-I, \-\-align\-end
302 if the free space at the end of a disk is less than the alignment value,
304 to create a partition in that space, then it will \fBnot\fR be end\-aligned.
307 .B \-j, \-\-move\-main\-table=sector
310 system\-on\-chip (SoC) is hard\-coded to read boot code from sector 2. I
315 .B \-k, \-\-move\-backup\-table=sector
318 The default value is thus the size of the disk, minus one, minus the total
322 the very end of the disk.
325 .B \-l, \-\-load\-backup=file
327 \fI\-b\fR option. Note that restoring partition data from anything
328 but the original disk is not recommended. This option will work even if the
329 disk's original partition table is bad; however, most other options on the
333 .B \-L, \-\-list\-types
336 \fBsgdisk\fR compresses these into two\-byte (four\-digit hexadecimal)
340 one\-to\-one correspondence is impossible, though. Most notably, the codes
345 boot, 0xa502 for FreeBSD swap, and so on. Note that these two\-byte codes
347 you to specify a valid disk device filename.
350 .B \-m, \-\-gpttombr
351 Convert disk from GPT to MBR form. This option takes from one to four
361 .B \-n, \-\-new=partnum:start:end
367 disk. You can specify locations relative to the start or end of the
368 specified default range by preceding the number by a '+' or '\-' symbol, as
370 or \fI\fB\-200M\fR\fR to specify a point 200MiB before the last available
375 \fI\-A\fR (\fI\-\-attributes\fR), \fI\-c\fR (\fI\-\-change\-name\fR), \fI\-t\fR
376 (\fI\-\-typecode\fR), and \fI\-u\fR (\fI\-\-partition\-guid\fR) options may also use
380 .B \-N, \-\-largest\-new=num
382 the disk. You can use the \fI\-a\fR (\fI\-\-set\-alignment\fR) option to
384 the first available partition number. Subsequent uses of the \fI\-A\fR
385 (\fI\-\-attributes\fR), \fI\-c\fR (\fI\-\-change\-name\fR), \fI\-t\fR
386 (\fI\-\-typecode\fR), and \fI\-u\fR (\fI\-\-partition\-guid\fR) options may
390 .B \-o, \-\-clear
393 most other operations, fail on a damaged disk. If you want to prepare a
394 disk you know to be damaged for GPT use, you should first wipe it with \-Z
396 disk's original partition table is bad; however, most other options on the
400 .B \-O, \-\-print\-mbr
408 .B \-p, \-\-print
412 the \fI\-i\fR (\fI\-\-info\fR) option.
415 .B \-P, \-\-pretend
416 Pretend to make specified changes. In\-memory GPT data structures are
418 to disk.
421 .B \-r, \-\-transpose
424 instance, if partitions 1\-4 are defined, transposing 1 and 5 results in a
425 table with partitions numbered from 2\-5. Transposing partitions in this
426 way has no effect on their disk space allocation; it only alters their
430 .B \-R, \-\-replicate=second_device_filename
434 \-G option on the new disk.
437 .B \-s, \-\-sort
439 partitions on the disk. If you want them to match, you can use this option.
445 .B \-t, \-\-typecode=partnum:{hexcode|GUID}
447 a two\-byte hexadecimal number, as described earlier, or a fully-specified
448 GUID value, such as EBD0A0A2-B9E5-4433-87C0-68B6B72699C7.
451 .B \-T, \-\-transform\-bsd=partnum
455 will attempt to convert BSD disklabels stored on the main disk when
462 .B \-u, \-\-partition-guid=partnum:guid
467 .B \-U, \-\-disk-guid=guid
468 Set the GUID for the disk. The GUID may be a complete GUID or 'R' to set a
472 .B \-\-usage
476 .B \-v, \-\-verify
477 Verify disk. This option checks for a variety of problems, such as
481 command displays a summary of unallocated disk space. This option will work
482 even if the disk's original partition table is bad; however, most other
486 .B \-V, \-\-version
491 .B \-z, \-\-zap
493 want to repartition a GPT disk using \fBfdisk\fR or some other GPT\-unaware
496 disk has been repartitioned for MBR using a GPT\-unaware utility; however,
498 first or end of the last MBR partition. If you use it on a valid GPT disk,
503 .B \-Z, \-\-zap\-all
505 works much like \fI\-z\fR, but as it wipes the MBR as well as the GPT, it's
506 more suitable if you want to repartition a disk after using this option,
507 and completely unsuitable if you've already repartitioned the disk.
510 .B \-?, \-\-help
530 Non\-GPT disk detected and no \fI\-g\fR option, but operation requires a
544 Disk replication operation (\-R) failed
552 versions for x86\-64 (64\-bit), x86 (32\-bit), and PowerPC (32\-bit) have been
553 tested, with the x86\-64 version having seen the most testing.
558 table to a disk when existing partitions on that disk are mounted. (The
566 in the \fI\-p\fR option are 14 characters wide. This translates to a limitation
576 will require using a larger\-than\-normal partition table. (The limit
583 the start or (more commonly) the end of the disk. Resizing the partition
591 MBR conversions work only if the disk has correct LBA partition
592 descriptors. These descriptors should be present on any disk over 8 GiB in
605 conversions from this form may be unreliable \-\- partitions may be dropped,
612 Booting after converting an MBR or BSD disklabel disk is likely to be
613 disrupted. Sometimes re\-installing a boot loader will fix the problem, but
614 other times you may need to switch boot loaders. Except on EFI\-based