blob: 8d2a2803912db0dcb18e9253611435310fc36de4 [file] [log] [blame]
Enric Balletbo i Serra8abecf52023-01-10 17:19:32 +01001.. SPDX-License-Identifier: GPL-2.0+:
2
3part command
4===============
5
6Synopis
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 Serra0359a092023-01-10 17:19:34 +010016 part type <interface> <dev>:<part> [varname]
Enric Balletbo i Serra8abecf52023-01-10 17:19:32 +010017 part types
18
19Description
20-----------
21
22The `part` command is used to manage disk partition related commands.
23
24The '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
35The '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
49The 'part start' commnad sets an environment variable to the start of the partition (in blocks),
50part 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
61The 'part size' command sets an environment variable to the size of the partition (in blocks),
62part 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
73The 'part number' command sets an environment variable to the partition number using the partition name,
74part 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 Serra0359a092023-01-10 17:19:34 +010085The '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 Serra8abecf52023-01-10 17:19:32 +010096The 'part types' command list supported partition table types.
97
98Examples
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 Serra0359a092023-01-10 17:19:34 +0100141 => 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 Serra8abecf52023-01-10 17:19:32 +0100147 => part types
148 Supported partition tables: EFI, AMIGA, DOS, ISO, MAC
149
150Return value
151------------
152
153The return value $? is set to 0 (true) if the command succededd. If an
154error occurs, the return value $? is set to 1 (false).