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