GPT(8) | System Manager's Manual | GPT(8) |
gpt | [general_options] command [command_options] device ... |
The -p count option allows the user to change the number of partitions the GPT can accommodate. This is used whenever a new GPT is created. By default, the gpt utility will create space for 128 partitions (or 32 sectors of 512 bytes).
The -r option causes the gpt utility to open the device for reading only. Currently this option is primarily useful for the show command, but the intent is to use it to implement dry-run behaviour.
The -v option controls the verbosity level. The level increases with every occurrence of this option. There is no formalized definition of the different levels yet.
The -b number option allows the user to specify the starting (beginning) sector number of the partition. The minimum sector number is 1, but has to fall inside an unused region of disk space that is covered by the GPT.
The -i index option allows the user to specify which (free) entry in the GPT table is to be used for the new partition. By default, the first free entry is selected.
The -s count option allows the user to specify the size of the partition in sectors. The minimum size is 1.
The -t type option allows the user to specify the partition type. The type is given as an UUID, but gpt accepts efi, swap, ufs, hfs, linux, raid, lfs, ccd, cgd, bios, ffs, and windows as aliases for the most commonly used partition types.
The -c option allows the user to specify the filename that gpt should read the bootcode from. The default is to read from /usr/mdec/gptmbr.bin.
The -i option selects the partition that should contain the primary bootstrap code, as installed via installboot(8).
The -p option tells gpt to create only the primary table and not the backup table. This option is only useful for debugging and should not be used otherwise.
The -r option instructs gpt to destroy the table in a way that it can be recovered.
The -a option specifies that all partitions should be labeled. It is mutually exclusive with all other selection options.
The -b number option selects the partition that starts at the given block number.
The -i index option selects the partition with the given partition number.
The -s count option selects all partitions that have the given size. This can cause multiple partitions to be removed.
The -t type option selects all partitions that have the given type. The type is given as an UUID or by the aliases that the add command accepts. This can cause multiple partitions to be removed.
The -f file or -l label options specify the new label to be assigned to the selected partitions. The -f file option is used to read the label from the specified file. Only the first line is read from the file and the trailing newline character is stripped. If the file name is the dash or minus sign (-), the label is read from the standard input. The -l label option is used to specify the label in the command line. The label is assumed to be encoded in UTF-8.
The -s option prevents migrating BSD disk labels into GPT partitions by creating the GPT equivalent of a slice.
nas# gpt show wd3 start size index contents 0 1 PMBR 1 3907029167 nas# gpt create wd3 nas# gpt show wd3 start size index contents 0 1 PMBR 1 1 Pri GPT header 2 32 Pri GPT table 34 3907029101 3907029135 32 Sec GPT table 3907029167 1 Sec GPT header nas# gpt add -s 10486224 -t swap -i 1 wd3 Partition added, use: dkctl rwd3d addwedge dk<N> 34 10486224 <type> to create a wedge for it nas# gpt label -i 1 -l swap_1 wd3 parition 1 on rwd3d labeled swap_1 nas# gpt show wd3 start size index contents 0 1 PMBR 1 1 Pri GPT header 2 32 Pri GPT table 34 10486224 1 GPT part - NetBSD swap 10486258 3896542877 3907029135 32 Sec GPT table 3907029167 1 Sec GPT header nas#
It is expected that the basic usage model does not change, but it is possible that future versions will not be compatible in the strictest sense of the word. For example, the -p count option may be changed to a command option rather than a generic option. There are only two commands that use it so there is a chance that the natural tendency for people is to use it as a command option. Also, options primarily intended for diagnostic or debug purposes may be removed in future versions.
Another possibility is that the current usage model is accompanied by other interfaces to make the tool usable as a back-end. This all depends on demand and thus feedback.
March 9, 2012 | NetBSD 6.1 |