Skip to content

Commit 07c667d

Browse files
[Doc-A-THon] Updating code block and sudo
1 parent 7d52257 commit 07c667d

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

articles/backup/backup-azure-restore-files-from-vm.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,12 @@ Once the script is run, the LVM partitions are mounted in the physical volume(s)
235235
To list the volume group names:
236236

237237
```bash
238-
pvs -o +vguuid
238+
sudo pvs -o +vguuid
239239
```
240240

241241
This command will list all physical volumes (including the ones present before running the script), their corresponding volume group names, and the volume group's unique user IDs (UUIDs). A sample output of the command is shown below.
242242

243-
```bash
243+
```output
244244
PV VG Fmt Attr PSize PFree VG UUID
245245
246246
/dev/sda4 rootvg lvm2 a-- 138.71g 113.71g EtBn0y-RlXA-pK8g-de2S-mq9K-9syx-B29OL6
@@ -260,7 +260,7 @@ The first column (PV) shows the physical volume, the subsequent columns show the
260260

261261
There are scenarios where volume group names can have 2 UUIDs after running the script. It means that the volume group names in the machine where the script is executed and in the backed-up VM are the same. Then we need to rename the backed-up VMs volume groups. Take a look at the example below.
262262

263-
```bash
263+
```output
264264
PV VG Fmt Attr PSize PFree VG UUID
265265
266266
/dev/sda4 rootvg lvm2 a-- 138.71g 113.71g EtBn0y-RlXA-pK8g-de2S-mq9K-9syx-B29OL6
@@ -281,8 +281,8 @@ The script output would have shown /dev/sdg, /dev/sdh, /dev/sdm2 as attached. So
281281
Now we need to rename VG names for script-based volumes, for example: /dev/sdg, /dev/sdh, /dev/sdm2. To rename the volume group, use the following command
282282

283283
```bash
284-
vgimportclone -n rootvg_new /dev/sdm2
285-
vgimportclone -n APPVg_2 /dev/sdg /dev/sdh
284+
sudo vgimportclone -n rootvg_new /dev/sdm2
285+
sudo vgimportclone -n APPVg_2 /dev/sdg /dev/sdh
286286
```
287287

288288
Now we have all VG names with unique IDs.
@@ -292,23 +292,21 @@ Now we have all VG names with unique IDs.
292292
Make sure that the Volume groups corresponding to script's volumes are active. The following command is used to display active volume groups. Check whether the script's related volume groups are present in this list.
293293

294294
```bash
295-
vgdisplay -a
295+
sudo vgdisplay -a
296296
```
297297

298298
Otherwise, activate the volume group by using the following command.
299299

300300
```bash
301-
#!/bin/bash
302-
vgchange –a y <volume-group-name>
301+
sudo vgchange –a y <volume-group-name>
303302
```
304303

305304
##### Listing logical volumes within Volume groups
306305

307306
Once we get the unique, active list of VGs related to the script, then the logical volumes present in those volume groups can be listed using the following command.
308307

309308
```bash
310-
#!/bin/bash
311-
lvdisplay <volume-group-name>
309+
sudo lvdisplay <volume-group-name>
312310
```
313311

314312
This command displays the path of each logical volume as 'LV Path'.
@@ -318,8 +316,7 @@ This command displays the path of each logical volume as 'LV Path'.
318316
To mount the logical volumes to the path of your choice:
319317

320318
```bash
321-
#!/bin/bash
322-
mount <LV path from the lvdisplay cmd results> </mountpath>
319+
sudo mount <LV path from the lvdisplay cmd results> </mountpath>
323320
```
324321

325322
> [!WARNING]
@@ -330,17 +327,15 @@ mount <LV path from the lvdisplay cmd results> </mountpath>
330327
The following command displays details about all raid disks:
331328

332329
```bash
333-
#!/bin/bash
334-
mdadm –detail –scan
330+
sudo mdadm –detail –scan
335331
```
336332

337333
The relevant RAID disk is displayed as `/dev/mdm/<RAID array name in the protected VM>`
338334

339335
Use the mount command if the RAID disk has physical volumes:
340336

341337
```bash
342-
#!/bin/bash
343-
mount [RAID Disk Path] [/mountpath]
338+
sudo mount [RAID Disk Path] [/mountpath]
344339
```
345340

346341
If the RAID disk has another LVM configured in it, then use the preceding procedure for LVM partitions but use the volume name in place of the RAID Disk name.

0 commit comments

Comments
 (0)