Enric Balletbo i Serra | 8abecf5 | 2023-01-10 17:19:32 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
| 3 | part command |
| 4 | =============== |
| 5 | |
| 6 | Synopis |
| 7 | ------- |
| 8 | |
| 9 | :: |
| 10 | |
| 11 | part uuid <interface> <dev>:<part> [varname] |
| 12 | part list <interface> <dev> [flags] [varname] |
| 13 | part start <interface> <dev> <part> <varname> |
| 14 | part size <interface> <dev> <part> <varname> |
| 15 | part number <interface> <dev> <part> <varname> |
Enric Balletbo i Serra | 0359a09 | 2023-01-10 17:19:34 +0100 | [diff] [blame] | 16 | part type <interface> <dev>:<part> [varname] |
Enric Balletbo i Serra | 8abecf5 | 2023-01-10 17:19:32 +0100 | [diff] [blame] | 17 | part types |
| 18 | |
| 19 | Description |
| 20 | ----------- |
| 21 | |
| 22 | The `part` command is used to manage disk partition related commands. |
| 23 | |
| 24 | The 'part uuid' command prints or sets an environment variable to partition UUID |
| 25 | |
| 26 | interface |
| 27 | interface for accessing the block device (mmc, sata, scsi, usb, ....) |
| 28 | dev |
| 29 | device number |
| 30 | part |
| 31 | partition number |
| 32 | varname |
| 33 | an optional environment variable to store the current partition UUID value into. |
| 34 | |
| 35 | The 'part list' command prints or sets an environment variable to the list of partitions |
| 36 | |
| 37 | interface |
| 38 | interface for accessing the block device (mmc, sata, scsi, usb, ....) |
| 39 | dev |
| 40 | device number |
| 41 | part |
| 42 | partition number |
| 43 | flags |
| 44 | -bootable |
| 45 | lists only bootable partitions |
| 46 | varname |
| 47 | an optional environment variable to store the list of partitions value into. |
| 48 | |
| 49 | The 'part start' commnad sets an environment variable to the start of the partition (in blocks), |
| 50 | part can be either partition number or partition name. |
| 51 | |
| 52 | interface |
| 53 | interface for accessing the block device (mmc, sata, scsi, usb, ....) |
| 54 | dev |
| 55 | device number |
| 56 | part |
| 57 | partition number |
| 58 | varname |
| 59 | a variable to store the current start of the partition value into. |
| 60 | |
| 61 | The 'part size' command sets an environment variable to the size of the partition (in blocks), |
| 62 | part can be either partition number or partition name. |
| 63 | |
| 64 | interface |
| 65 | interface for accessing the block device (mmc, sata, scsi, usb, ....) |
| 66 | dev |
| 67 | device number |
| 68 | part |
| 69 | partition number |
| 70 | varname |
| 71 | a variable to store the current size of the partition value into. |
| 72 | |
| 73 | The 'part number' command sets an environment variable to the partition number using the partition name, |
| 74 | part must be specified as partition name. |
| 75 | |
| 76 | interface |
| 77 | interface for accessing the block device (mmc, sata, scsi, usb, ....) |
| 78 | dev |
| 79 | device number |
| 80 | part |
| 81 | partition number |
| 82 | varname |
| 83 | a variable to store the current partition number value into |
| 84 | |
Enric Balletbo i Serra | 0359a09 | 2023-01-10 17:19:34 +0100 | [diff] [blame] | 85 | The 'part type' command prints or sets an environment variable to the partition type UUID. |
| 86 | |
| 87 | interface |
| 88 | interface for accessing the block device (mmc, sata, scsi, usb, ....) |
| 89 | dev |
| 90 | device number |
| 91 | part |
| 92 | partition number |
| 93 | varname |
| 94 | a variable to store the current partition type UUID value into |
| 95 | |
Enric Balletbo i Serra | 8abecf5 | 2023-01-10 17:19:32 +0100 | [diff] [blame] | 96 | The 'part types' command list supported partition table types. |
| 97 | |
| 98 | Examples |
| 99 | -------- |
| 100 | |
| 101 | :: |
| 102 | |
| 103 | => host bind 0 ./test_gpt_disk_image.bin |
| 104 | => part uuid host 0:1 |
| 105 | 24156b69-3378-497f-bb3e-b982223de528 |
| 106 | => part uuid host 0:1 varname |
| 107 | => env print varname |
| 108 | varname=24156b69-3378-497f-bb3e-b982223de528 |
| 109 | => |
| 110 | => part list host 0 |
| 111 | |
| 112 | Partition Map for HOST device 0 -- Partition Type: EFI |
| 113 | |
| 114 | Part Start LBA End LBA Name |
| 115 | Attributes |
| 116 | Type GUID |
| 117 | Partition GUID |
| 118 | 1 0x00000800 0x00000fff "second" |
| 119 | attrs: 0x0000000000000000 |
| 120 | type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 |
| 121 | (data) |
| 122 | guid: 24156b69-3378-497f-bb3e-b982223de528 |
| 123 | 2 0x00001000 0x00001bff "first" |
| 124 | attrs: 0x0000000000000000 |
| 125 | type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 |
| 126 | (data) |
| 127 | guid: 5272ee44-29ab-4d46-af6c-4b45ac67d3b7 |
| 128 | => |
| 129 | => part start host 0 2 varname |
| 130 | => env print varname |
| 131 | varname=1000 |
| 132 | => |
| 133 | => part size host 0 2 varname |
| 134 | => env print varname |
| 135 | varname=c00 |
| 136 | => |
| 137 | => part number host 0 2 varname |
| 138 | => env print varname |
| 139 | varname=0x2 |
| 140 | => |
Enric Balletbo i Serra | 0359a09 | 2023-01-10 17:19:34 +0100 | [diff] [blame] | 141 | => part type host 0:1 |
| 142 | ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 |
| 143 | => part type host 0:1 varname |
| 144 | => env print varname |
| 145 | varname=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 |
| 146 | => |
Enric Balletbo i Serra | 8abecf5 | 2023-01-10 17:19:32 +0100 | [diff] [blame] | 147 | => part types |
| 148 | Supported partition tables: EFI, AMIGA, DOS, ISO, MAC |
| 149 | |
| 150 | Return value |
| 151 | ------------ |
| 152 | |
| 153 | The return value $? is set to 0 (true) if the command succededd. If an |
| 154 | error occurs, the return value $? is set to 1 (false). |