Annotation of src/sbin/gpt/gpt.8, Revision 1.64
1.64 ! martin 1: .\" $NetBSD: gpt.8,v 1.63 2018/05/01 21:16:02 kre Exp $
1.2 wiz 2: .\"
1.1 christos 3: .\" Copyright (c) 2002 Marcel Moolenaar
4: .\" All rights reserved.
5: .\"
6: .\" Redistribution and use in source and binary forms, with or without
7: .\" modification, are permitted provided that the following conditions
8: .\" are met:
9: .\"
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
15: .\"
16: .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17: .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18: .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19: .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20: .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21: .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22: .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23: .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24: .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25: .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26: .\"
27: .\" $FreeBSD: src/sbin/gpt/gpt.8,v 1.17 2006/06/22 22:22:32 marcel Exp $
28: .\"
1.64 ! martin 29: .Dd March 24, 2019
1.4 joerg 30: .Dt GPT 8
1.1 christos 31: .Os
32: .Sh NAME
33: .Nm gpt
1.2 wiz 34: .Nd GUID partition table maintenance utility
1.1 christos 35: .Sh SYNOPSIS
36: .Nm
1.39 christos 37: .Op Fl nrqv
1.38 christos 38: .Op Fl m Ar mediasize
39: .Op Fl s Ar sectorsize
1.52 christos 40: .Op Fl T Ar timestamp
1.1 christos 41: .Ar command
42: .Op Ar command_options
1.40 christos 43: .Ar device
1.58 mlelstv 44: .Nm
45: .Ar set
46: .Fl l
47: .Nm
48: .Ar unset
49: .Fl l
50: .Nm
51: .Ar type
52: .Fl l
1.1 christos 53: .Sh DESCRIPTION
54: The
55: .Nm
56: utility provides the necessary functionality to manipulate GUID partition
1.14 jnemeth 57: tables
58: .Pq GPTs ,
59: but see
1.1 christos 60: .Sx BUGS
61: below for how and where functionality is missing.
62: The basic usage model of the
63: .Nm
64: tool follows that of the
65: .Xr cvs 1
66: tool.
67: The general options are described in the following paragraph.
68: The remaining paragraphs describe the individual commands with their options.
69: Here we conclude by mentioning that a
70: .Ar device
71: is either a special file
72: corresponding to a disk-like device or a regular file.
73: The command is applied to each
74: .Ar device
75: listed on the command line.
76: .Ss General Options
77: The general options allow the user to change default settings or otherwise
78: change the behaviour that is applicable to all commands.
79: Not all commands use all default settings, so some general options may not
80: have an effect on all commands.
1.38 christos 81: .Bl -tag -width XXXX
82: .It Fl m Ar mediasize
83: Override the default media size for the device (obtained
1.33 christos 84: from the kernel if possible) or defaulting to the file size for
85: plain files.
1.38 christos 86: .It Fl n
1.49 sevan 87: Do not update the wedge information that
1.38 christos 88: .Nm
89: changed.
90: You need to use the
91: .Xr dkctl 8
92: command manually update the device's wedge configuration if you do that.
93: .It Fl r
94: Open the device for reading only.
1.1 christos 95: .Nm
96: Currently this option is primarily useful for the
97: .Ic show
1.38 christos 98: command, but the intent is to use it to implement dry-run behaviour.
99: .It Fl q
1.49 sevan 100: Do not print error messages.
1.38 christos 101: This is not implemented completely yet.
102: .It Fl s Ar sectorsize
103: Override the default sector size for the device (obtained
1.33 christos 104: from the kernel if possible) or
105: .Dv 512
106: for plain files.
1.52 christos 107: .It Fl T Ar timestamp
108: Specify a timestamp to be used for uuid generation so that uuids
109: are not random and can be consistent for reproducible builds.
110: The timestamp can be a pathname, where the timestamps are derived from
111: that file, a parseable date for parsedate(3) (this option is not
112: yet available in the tools build), or an integer value interpreted
113: as the number of seconds from the Epoch.
1.38 christos 114: .It Fl v
115: Controls the verbosity level.
1.1 christos 116: The level increases with every occurrence of this option.
117: There is no formalized definition of the different levels yet.
1.38 christos 118: .El
1.1 christos 119: .Ss Commands
120: .Bl -tag -width indent
121: .\" ==== add ====
1.19 jnemeth 122: .It Nm Ic add Oo Fl a Ar alignment Oc Oo Fl b Ar blocknr Oc \
1.23 jnemeth 123: Oo Fl i Ar index Oc Oo Fl l Ar label Oc Oo Fl s Ar size Oc \
1.40 christos 124: Oo Fl t Ar type Oc
1.1 christos 125: The
126: .Ic add
127: command allows the user to add a new partition to an existing table.
128: By default, it will create a UFS partition covering the first available block
129: of an unused disk space.
130: The command-specific options can be used to control this behaviour.
131: .Pp
132: The
1.15 jnemeth 133: .Fl a Ar alignment
134: option allows the user to specify an alignment for the start and size.
1.56 mlelstv 135: The alignment is given in bytes and may have a suffix to indicate its
136: magnitude.
1.15 jnemeth 137: .Nm
138: will attempt to align the partition.
139: .Pp
140: The
1.19 jnemeth 141: .Fl b Ar blocknr
1.1 christos 142: option allows the user to specify the starting (beginning) sector number of
143: the partition.
144: The minimum sector number is 1, but has to fall inside an unused region of
145: disk space that is covered by the GPT.
146: .Pp
147: The
148: .Fl i Ar index
149: option allows the user to specify which (free) entry in the GPT table is to
150: be used for the new partition.
151: By default, the first free entry is selected.
152: .Pp
153: The
1.15 jnemeth 154: .Fl l Ar label
155: option allows the user to specify a label for the partition.
156: .Pp
157: The
1.23 jnemeth 158: .Fl s Ar size
159: option allows the user to specify the size of the partition.
160: If there is no suffix, or the suffix is
161: .Sq s
162: or
163: .Sq S
164: then size is in sectors, otherwise size is in bytes which must be
165: a multiple of the device's sector size.
1.57 sborrill 166: Accepted suffix units are
167: .Sq b
168: to denote bytes,
169: .Sq k
170: to denote kilobytes,
171: .Sq m
172: to denote megabytes and
173: .Sq g
174: to denote gigabytes.
1.23 jnemeth 175: The minimum size is 1 sector.
1.1 christos 176: .Pp
177: The
178: .Fl t Ar type
179: option allows the user to specify the partition type.
180: The type is given as an UUID, but
181: .Nm
182: accepts
1.35 mlelstv 183: .Bl -tag -width "windows-reserved" -compact -offset indent
184: .It Cm apple
185: Apple HFS
186: .It Cm apple-ufs
187: Apple UFS
188: .It Cm bios
189: BIOS Boot
190: .It Cm efi
191: EFI System
192: .It Cm fbsd-legacy
1.55 wiz 193: .Fx
194: legacy
1.35 mlelstv 195: .It Cm fbsd-swap
1.55 wiz 196: .Fx
197: swap
1.35 mlelstv 198: .It Cm fbsd-ufs
1.55 wiz 199: .Fx
200: UFS/UFS2
1.35 mlelstv 201: .It Cm fbsd-vinum
1.55 wiz 202: .Fx
203: vinum
1.35 mlelstv 204: .It Cm fbsd-zfs
1.55 wiz 205: .Fx
206: ZFS
1.35 mlelstv 207: .It Cm linux-data
208: Linux data
209: .It Cm linux-raid
210: Linux RAID
211: .It Cm linux-swap
212: Linux swap
213: .It Cm linux-lvm
214: Linux LVM
215: .It Cm windows
216: Windows basic data
217: .It Cm windows-reserved
218: Windows reserved
219: .It Cm ccd
1.55 wiz 220: .Nx
221: ccd component
1.35 mlelstv 222: .It Cm cgd
1.55 wiz 223: .Nx
224: Cryptographic Disk
1.35 mlelstv 225: .It Cm ffs
1.55 wiz 226: .Nx
227: FFSv1/FFSv2
1.35 mlelstv 228: .It Cm lfs
1.55 wiz 229: .Nx
230: LFS
1.35 mlelstv 231: .It Cm raid
1.55 wiz 232: .Nx
233: RAIDFrame component
1.35 mlelstv 234: .It Cm swap
1.55 wiz 235: .Nx
236: swap
1.35 mlelstv 237: .El
1.1 christos 238: as aliases for the most commonly used partition types.
1.27 jnemeth 239: .\" ==== backup ====
1.41 christos 240: .It Nm Ic backup Oo Fl o Ar outfile Oc
1.27 jnemeth 241: The
242: .Ic backup
243: command dumps the MBR or (PMBR) and GPT partition tables to standard
1.41 christos 244: output or to a file specified by the
245: .Ar outfile
246: argument in a format to be used by the
1.27 jnemeth 247: .Ic restore
248: command.
249: The format is a plist.
250: It should not be modified.
1.7 jym 251: .\" ==== biosboot ====
1.48 christos 252: .It Nm Ic biosboot Oo Fl A Oc Oo Fl c Ar bootcode Oc Oo Fl i Ar index Oc \
1.40 christos 253: Oo Fl L Ar label Oc
1.7 jym 254: The
255: .Ic biosboot
256: command allows the user to configure the partition that contains the
257: primary bootstrap program, used during
258: .Xr boot 8 .
259: .Pp
260: The
1.48 christos 261: .Fl A
1.46 christos 262: options sets the PMBR partition active.
263: .Pp
264: The
1.7 jym 265: .Fl c
266: option allows the user to specify the filename that
267: .Nm
268: should read the bootcode from.
269: The default is to read from
1.10 drochner 270: .Pa /usr/mdec/gptmbr.bin .
1.7 jym 271: .Pp
272: The
273: .Fl i
274: option selects the partition that should contain the primary
275: bootstrap code, as installed via
276: .Xr installboot 8 .
1.32 jnemeth 277: The
278: .Fl L
279: option selects the partition by label.
1.54 kre 280: If there are multiple partitions with the same label, the
281: first one found will be used.
1.1 christos 282: .\" ==== create ====
1.48 christos 283: .It Nm Ic create Oo Fl AfP Oc Oo Fl p Ar partitions Oc
1.1 christos 284: The
285: .Ic create
286: command allows the user to create a new (empty) GPT.
287: By default, one cannot create a GPT when the device contains a MBR,
288: however this can be overridden with the
289: .Fl f
290: option.
291: If the
292: .Fl f
293: option is specified, an existing MBR is destroyed and any partitions
294: described by the MBR are lost.
295: .Pp
296: The
1.48 christos 297: .Fl A
1.46 christos 298: options sets the PMBR partition active.
299: .Pp
300: The
1.39 christos 301: .Fl P
1.1 christos 302: option tells
303: .Nm
304: to create only the primary table and not the backup table.
305: This option is only useful for debugging and should not be used otherwise.
1.39 christos 306: .Pp
307: The
308: .Fl p
309: option changes the default number of partitions the GPT can
310: accommodate.
311: This is used whenever a new GPT is created.
312: By default, the
313: .Nm
314: utility will create space for 128 partitions (or 32 sectors of 512 bytes).
1.1 christos 315: .\" ==== destroy ====
1.40 christos 316: .It Nm Ic destroy Oo Fl r Oc
1.1 christos 317: The
318: .Ic destroy
319: command allows the user to destroy an existing, possibly not empty GPT.
320: .Pp
321: The
322: .Fl r
323: option instructs
324: .Nm
325: to destroy the table in a way that it can be recovered.
1.37 jnemeth 326: .\" ==== header ====
1.40 christos 327: .It Nm Ic header
1.37 jnemeth 328: The
329: .Ic header
330: command displays size information about the media and information from the
331: GPT header if it exists.
1.1 christos 332: .\" ==== label ====
1.40 christos 333: .It Nm Ic label Oo Fl a Oc Ao Fl f Ar file | Fl l Ar label Ac
1.19 jnemeth 334: .It Nm Ic label Oo Fl b Ar blocknr Oc Oo Fl i Ar index Oc \
1.32 jnemeth 335: Oo Fl L Ar label Oc Oo Fl s Ar sectors Oc Oo Fl t Ar type Oc \
1.40 christos 336: Ao Fl f Ar file | Fl l Ar label Ac
1.1 christos 337: The
338: .Ic label
339: command allows the user to label any partitions that match the selection.
340: At least one of the following selection options must be specified.
341: .Pp
342: The
343: .Fl a
344: option specifies that all partitions should be labeled.
345: It is mutually exclusive with all other selection options.
346: .Pp
347: The
1.19 jnemeth 348: .Fl b Ar blocknr
1.1 christos 349: option selects the partition that starts at the given block number.
350: .Pp
351: The
352: .Fl i Ar index
353: option selects the partition with the given partition number.
354: .Pp
355: The
1.32 jnemeth 356: .Fl L Ar label
357: option selects all partitions that have the given label.
358: This can cause multiple partitions to be relabeled.
359: .Pp
360: The
1.19 jnemeth 361: .Fl s Ar sectors
1.1 christos 362: option selects all partitions that have the given size.
1.14 jnemeth 363: This can cause multiple partitions to be labeled.
1.1 christos 364: .Pp
365: The
366: .Fl t Ar type
367: option selects all partitions that have the given type.
368: The type is given as an UUID or by the aliases that the
369: .Ic add
370: command accepts.
1.14 jnemeth 371: This can cause multiple partitions to be labeled.
1.1 christos 372: .Pp
373: The
374: .Fl f Ar file
375: or
376: .Fl l Ar label
377: options specify the new label to be assigned to the selected partitions.
378: The
379: .Fl f Ar file
380: option is used to read the label from the specified file.
381: Only the first line is read from the file and the trailing newline
382: character is stripped.
383: If the file name is the dash or minus sign
384: .Pq Fl ,
385: the label is read from
386: the standard input.
387: The
388: .Fl l Ar label
389: option is used to specify the label in the command line.
390: The label is assumed to be encoded in UTF-8.
391: .\" ==== migrate ====
1.48 christos 392: .It Nm Ic migrate Oo Fl Afs Oc Oo Fl p Ar partitions Oc
1.1 christos 393: The
394: .Ic migrate
395: command allows the user to migrate an MBR-based disk partitioning into a
396: GPT-based partitioning.
397: By default, the MBR is not migrated when it contains partitions of an unknown
398: type.
399: This can be overridden with the
400: .Fl f
401: option.
402: Specifying the
403: .Fl f
404: option will cause unknown partitions to be ignored and any data in it
405: to be lost.
406: .Pp
407: The
1.48 christos 408: .Fl A
1.46 christos 409: options sets the PMBR partition active.
410: .Pp
411: The
1.1 christos 412: .Fl s
413: option prevents migrating
414: .Bx
415: disk labels into GPT partitions by creating
416: the GPT equivalent of a slice.
1.14 jnemeth 417: Note that the
418: .Fl s
1.49 sevan 419: option is not applicable to
1.14 jnemeth 420: .Nx
421: partitions.
422: .Pp
423: The
1.39 christos 424: .Fl p
425: option changes the default number of partitions the GPT can
426: accommodate.
427: This is used whenever a new GPT is created.
428: By default, the
429: .Nm
430: utility will create space for 128 partitions (or 32 sectors of 512 bytes).
431: .Pp
432: The
1.14 jnemeth 433: .Ic migrate
434: command requires space at the beginning and the end of the device outside
435: any partitions to store the GPTs.
436: Space is required for the GPT header
437: .Pq which takes one sector
438: and the GPT partition table.
439: See the
440: .Fl p
441: option
442: for the size of the GPT partition table.
443: By default, just about all devices have a minimum of 62 sectors free at the
1.49 sevan 444: beginning of the device, but do not have any free space at the end.
1.14 jnemeth 445: For the default GPT partition table size on a 512 byte sector size device,
446: 33 sectors at the end of the device would need to be freed.
1.8 wiz 447: .\" ==== recover ====
1.40 christos 448: .It Nm Ic recover
1.8 wiz 449: The
450: .Ic recover
451: command tries to restore the GPT partition label from the backup
452: near the end of the disk.
453: It is very useful in case the primary label was deleted.
1.1 christos 454: .\" ==== remove ====
1.40 christos 455: .It Nm Ic remove Oo Fl a Oc
1.19 jnemeth 456: .It Nm Ic remove Oo Fl b Ar blocknr Oc Oo Fl i Ar index Oc \
1.40 christos 457: Oo Fl L Ar label Oc Oo Fl s Ar sectors Oc Oo Fl t Ar type Oc
1.1 christos 458: The
459: .Ic remove
460: command allows the user to remove any and all partitions that match the
461: selection.
462: It uses the same selection options as the
463: .Ic label
464: command.
465: See above for a description of these options.
466: Partitions are removed by clearing the partition type.
467: No other information is changed.
1.17 jnemeth 468: .\" ==== resize ====
1.64 ! martin 469: .It Nm Ic resize [ Fl i Ar index | Fl b Ar startsec ] Oo Fl a Ar alignment Oc \
1.40 christos 470: Oo Fl s Ar size Oc
1.17 jnemeth 471: The
472: .Ic resize
473: command allows the user to resize a partition.
1.18 wiz 474: The partition may be shrunk and if there is sufficient free space
1.17 jnemeth 475: immediately after it then it may be expanded.
476: The
477: .Fl s
478: option allows the new size to be specified, otherwise the partition will
479: be increased to the maximum available size.
1.23 jnemeth 480: If there is no suffix, or the suffix is
481: .Sq s
482: or
483: .Sq S
484: then size is in sectors, otherwise size is in bytes which must be
485: a multiple of the device's sector size.
1.57 sborrill 486: Accepted suffix units are
487: .Sq b
488: to denote bytes,
489: .Sq k
490: to denote kilobytes,
491: .Sq m
492: to denote megabytes and
493: .Sq g
494: to denote gigabytes.
1.23 jnemeth 495: The minimum size is 1 sector.
1.17 jnemeth 496: If the
497: .Fl a
498: option is specified then the size will be adjusted to be a multiple of
499: alignment if possible.
1.30 jnemeth 500: .\" ==== resizedisk ====
1.40 christos 501: .It Nm Ic resizedisk Oo Fl s Ar size Oc
1.30 jnemeth 502: The
503: .Ic resizedisk
504: command allows the user to resize a disk.
505: With GPTs, a backup copy is stored at the end of the disk.
506: If the underlying medium changes size
507: .Pq or is going to change size ,
508: then the backup copy needs to be moved to the new end of the disk,
509: and the last sector available for data storage needs to be adjusted.
510: This command does that.
511: If the backup copy no longer exists due to the medium shrinking, then
512: a new backup copy will be created using the primary copy.
513: .Pp
514: The
515: .Fl s
516: option allows the new size to be specified, otherwise the backup copy
517: will automatically be placed at the current end of the disk.
518: If there is no suffix, or the suffix is
519: .Sq s
520: or
521: .Sq S
522: then size is in sectors, otherwise size is in bytes which must be
523: a multiple of the device's sector size.
1.57 sborrill 524: Accepted suffix units are
525: .Sq b
526: to denote bytes,
527: .Sq k
528: to denote kilobytes,
529: .Sq m
530: to denote megabytes and
531: .Sq g
532: to denote gigabytes.
1.30 jnemeth 533: Using the
534: .Fl s
535: option allows you to move the backup copy prior to resizing the medium.
536: This is primarily useful when shrinking the medium.
1.29 jnemeth 537: .\" ==== restore ====
1.41 christos 538: .It Nm Ic restore Oo Fl F Oc Oo Fl i Ar infile Oc
1.29 jnemeth 539: The
540: .Ic restore
541: command restores a partition table that was previously saved using the
542: .Ic backup
543: command.
1.41 christos 544: The partition table is read from standard input or a file specified in
545: the
546: .Ar infile
547: argument and is expected to be in the format of a plist.
1.29 jnemeth 548: It assumes an empty disk.
549: The
550: .Fl F
551: option can be used to blank the disk.
552: The new disk does not have to be the same size as the old disk as long as all
553: the partitions fit, as
554: .Ic restore
555: will automatically adjust.
556: However, the new disk must use the same sector size as the old disk.
1.25 jnemeth 557: .\" ==== set ====
1.40 christos 558: .It Nm Ic set Fl a Ar attribute Fl i Ar index
1.42 christos 559: .It Nm Ic set Fl l
1.25 jnemeth 560: The
561: .Ic set
562: command sets various partition attributes.
563: The
1.42 christos 564: .Fl l
565: flag lists all available attributes.
566: The
1.25 jnemeth 567: .Fl a
1.42 christos 568: option specifies which attributes to set and may be specified more than once,
569: or the attributes can be comma-separated.
1.25 jnemeth 570: The
571: .Fl i
572: option specifies which entry to update.
573: The possible attributes are
574: .Do biosboot Dc ,
575: .Do bootme Dc ,
1.42 christos 576: .Do bootonce Dc ,
577: .Do bootfailed Dc ,
578: .Do noblockio Dc , and
579: .Do required Dc .
1.25 jnemeth 580: The biosboot flag is used to indicate which partition should be booted
581: by legacy BIOS boot code.
582: See the
583: .Ic biosboot
584: command for more information.
1.54 kre 585: The bootme flag is used to indicate which partition should be booted
1.53 msaitoh 586: by UEFI boot code.
1.42 christos 587: The other attributes are for compatibility with
1.25 jnemeth 588: .Fx
1.54 kre 589: and are not currently used by
590: .Nx .
1.25 jnemeth 591: They may be used by
592: .Nx
1.54 kre 593: in the future.
1.1 christos 594: .\" ==== show ====
1.45 wiz 595: .It Nm Ic show Oo Fl aglu Oc Oo Fl i Ar index Oc
1.1 christos 596: The
597: .Ic show
598: command displays the current partitioning on the listed devices and gives
599: an overall view of the disk contents.
600: With the
1.21 jnemeth 601: .Fl g
602: option the GPT partition GUID will be displayed instead of the GPT partition
603: type.
604: With the
1.1 christos 605: .Fl l
606: option the GPT partition label will be displayed instead of the GPT partition
607: type.
608: With the
609: .Fl u
610: option the GPT partition type is displayed as an UUID instead of in a
611: user friendly form.
1.21 jnemeth 612: With the
613: .Fl i
614: option, all the details of a particular GPT partition will be displayed.
1.24 jnemeth 615: The format of this display is subject to change.
1.44 martin 616: With the
617: .Fl a
618: option, all information for all GPT partitions (just like with
619: .Fl i Ar index )
620: will be printed.
1.21 jnemeth 621: None of the options have any effect on non-GPT partitions.
622: The order of precedence for the options are:
1.44 martin 623: .Fl a ,
1.21 jnemeth 624: .Fl i ,
625: .Fl l ,
626: .Fl g ,
627: .Fl u .
1.31 jnemeth 628: .\" ==== type ====
1.40 christos 629: .It Nm Ic type Oo Fl a Oc Fl T Ar newtype
1.31 jnemeth 630: .It Nm Ic type Oo Fl b Ar blocknr Oc Oo Fl i Ar index Oc \
1.32 jnemeth 631: Oo Fl L Ar label Oc Oo Fl s Ar sectors Oc Oo Fl t Ar type Oc \
1.40 christos 632: Fl T Ar newtype
1.42 christos 633: .It Nm Ic type Fl l
1.31 jnemeth 634: The
635: .Ic type
636: command allows the user to change the type of any and all partitions
637: that match the selection.
638: It uses the same selection options as the
639: .Ic label
640: command.
641: See above for a description of these options.
1.42 christos 642: The
643: .Fl l
644: flag lists available types.
1.25 jnemeth 645: .\" ==== unset ====
1.40 christos 646: .It Nm Ic unset Fl a Ar attribute Fl i Ar index
1.43 wiz 647: .It Nm Ic unset Fl l
1.25 jnemeth 648: The
649: .Ic unset
650: command unsets various partition attributes.
651: The
1.42 christos 652: .Fl l
653: flag lists all available attributes.
654: The
1.25 jnemeth 655: .Fl a
1.26 wiz 656: option specifies which attributes to unset and may be specified more than once.
1.25 jnemeth 657: The
658: .Fl i
659: option specifies which entry to update.
660: The possible attributes are
661: .Do biosboot Dc ,
662: .Do bootme Dc ,
1.42 christos 663: .Do bootonce Dc ,
664: .Do bootfailed Dc ,
665: .Do noblockio Dc , and
666: .Do required Dc .
1.25 jnemeth 667: The biosboot flag is used to indicate which partition should be booted
668: by legacy BIOS boot code.
669: See the
670: .Ic biosboot
671: command for more information.
1.42 christos 672: The other attributes are for compatibility with
1.25 jnemeth 673: .Fx
674: and are not currently used by any
675: .Nx
676: code.
677: They may be used by
678: .Nx
679: code in the future.
1.1 christos 680: .El
1.61 wiz 681: .Sh EXIT STATUS
682: The
683: .Nm
684: command exits with a failure status (1) when the header command
685: is used and no GPT header is found.
1.63 kre 686: This can be used to check for the existence of a GPT in shell scripts.
1.9 wiz 687: .Sh EXAMPLES
688: .Bd -literal
689: nas# gpt show wd3
690: start size index contents
691: 0 1 PMBR
692: 1 3907029167
693: nas# gpt create wd3
694: nas# gpt show wd3
695: start size index contents
696: 0 1 PMBR
697: 1 1 Pri GPT header
698: 2 32 Pri GPT table
699: 34 3907029101
700: 3907029135 32 Sec GPT table
701: 3907029167 1 Sec GPT header
702: nas# gpt add -s 10486224 -t swap -i 1 wd3
703: nas# gpt label -i 1 -l swap_1 wd3
1.51 abhinav 704: partition 1 on rwd3d labeled swap_1
1.9 wiz 705: nas# gpt show wd3
706: start size index contents
707: 0 1 PMBR
708: 1 1 Pri GPT header
709: 2 32 Pri GPT table
710: 34 10486224 1 GPT part - NetBSD swap
711: 10486258 3896542877
712: 3907029135 32 Sec GPT table
713: 3907029167 1 Sec GPT header
1.14 jnemeth 714: nas# gpt show -l wd3
715: start size index contents
716: 0 1 PMBR
717: 1 1 Pri GPT header
718: 2 32 Pri GPT table
719: 34 10486224 1 GPT part - "swap_1"
720: 10486258 3896542877
721: 3907029135 32 Sec GPT table
722: 3907029167 1 Sec GPT header
1.9 wiz 723: nas#
724: .Ed
1.59 mrg 725: .Pp
726: Booting from GPT on an BIOS system.
727: This creates a bootable partition that can be manually installed to.
728: Note that
729: .Xr sysinst 8
730: does not yet properly support this setup.
731: .Bd -literal
732: xotica# gpt create wd1
733: xotica# gpt add -b 1024 -l bootroot -t ffs -s 1g wd1
734: /dev/rwd1: Partition 1 added: 49f48d5a-b10e-11dc-b99b-0019d1879648 1024 2097152
735: xotica ~# dmesg | tail -2
736: wd1: GPT GUID: 660e0630-0a3f-47c0-bc52-c88bcec79392
737: dk0 at wd1: "bootroot", 2097152 blocks at 1024, type: ffs
738: xotica# gpt biosboot -L bootroot wd1
739: xotica# newfs dk0
740: xotica# installboot /dev/rdk0 /usr/mdec/bootxx_ffsv1
741: xotica# mount /dev/dk0 /mnt
742: xotica# cp /usr/mdec/boot /mnt
743: .Ed
1.1 christos 744: .Sh SEE ALSO
1.7 jym 745: .Xr boot 8 ,
1.38 christos 746: .Xr dkctl 8 ,
1.1 christos 747: .Xr fdisk 8 ,
1.7 jym 748: .Xr installboot 8 ,
1.1 christos 749: .Xr mount 8 ,
750: .Xr newfs 8 ,
1.59 mrg 751: .Xr swapctl 8
1.1 christos 752: .Sh HISTORY
753: The
754: .Nm
755: utility appeared in
756: .Fx 5.0
757: for ia64.
1.49 sevan 758: .Nm
759: utility first appeared in
760: .Nx 5.0 .
1.1 christos 761: .Sh BUGS
762: The development of the
763: .Nm
764: utility is still work in progress.
765: Many necessary features are missing or partially implemented.
766: In practice this means that the manual page, supposed to describe these
767: features, is farther removed from being complete or useful.
768: As such, missing functionality is not even documented as missing.
769: However, it is believed that the currently present functionality is reliable
770: and stable enough that this tool can be used without bullet-proof footware if
771: one thinks one does not make mistakes.
772: .Pp
773: It is expected that the basic usage model does not change, but it is
774: possible that future versions will not be compatible in the strictest sense
775: of the word.
776: Also, options primarily intended for diagnostic or debug purposes may be
777: removed in future versions.
778: .Pp
779: Another possibility is that the current usage model is accompanied by
780: other interfaces to make the tool usable as a back-end.
781: This all depends on demand and thus feedback.
CVSweb <webmaster@jp.NetBSD.org>