Skip to content

Commit 659a433

Browse files
committed
Basic changes.
1 parent dd46d48 commit 659a433

File tree

2 files changed

+45
-40
lines changed

2 files changed

+45
-40
lines changed

articles/virtual-machines/linux/attach-disk-portal.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use the portal to attach new or existing data disk to a Linux VM.
44
author: roygara
55
ms.service: storage
66
ms.topic: how-to
7-
ms.date: 08/13/2021
7+
ms.date: 01/06/2023
88
ms.author: rogarana
99
ms.subservice: disks
1010
ms.collection: linux
@@ -103,7 +103,7 @@ From the output of `lsblk` you can see that the 4GB disk at LUN 0 is `sdc`, the
103103

104104
> [!IMPORTANT]
105105
> If you are using an existing disk that contains data, skip to [mounting the disk](#mount-the-disk).
106-
> The following instuctions will delete data on the disk.
106+
> The following instructions will delete data on the disk.
107107
108108
If you are attaching a new disk, you need to partition the disk.
109109

@@ -153,12 +153,12 @@ The output looks similar to the following example:
153153
```
154154

155155
> [!NOTE]
156-
> Improperly editing the **/etc/fstab** file could result in an unbootable system. If unsure, refer to the distribution's documentation for information on how to properly edit this file. It is also recommended that a backup of the /etc/fstab file is created before editing.
156+
> Improperly editing the **/etc/fstab** file could result in an unbootable system. If unsure, refer to the distribution's documentation for information on how to properly edit this file. You should create a backup of the **/etc/fstab** file is created before editing.
157157
158-
Next, open the */etc/fstab* file in a text editor as follows:
158+
Next, open the **/etc/fstab** file in a text editor as follows:
159159

160160
```bash
161-
sudo nano /etc/fstab
161+
sudo vi /etc/fstab
162162
```
163163

164164
In this example, use the UUID value for the `/dev/sdc1` device that was created in the previous steps, and the mountpoint of `/datadrive`. Add the following line to the end of the `/etc/fstab` file:
@@ -167,7 +167,7 @@ In this example, use the UUID value for the `/dev/sdc1` device that was created
167167
UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /datadrive xfs defaults,nofail 1 2
168168
```
169169

170-
We used the nano editor, so when you are done editing the file, use `Ctrl+O` to write the file and `Ctrl+X` to exit the editor.
170+
We used the vi editor, so when you are done editing the file, press `Esc` to enter command mode and `wq` to save and close the editor.
171171

172172
> [!NOTE]
173173
> Later removing a data disk without editing fstab could cause the VM to fail to boot. Most distributions provide either the *nofail* and/or *nobootwait* fstab options. These options allow a system to boot even if the disk fails to mount at boot time. Consult your distribution's documentation for more information on these parameters.
@@ -200,7 +200,7 @@ You can see that `sdc` is now mounted at `/datadrive`.
200200

201201
### TRIM/UNMAP support for Linux in Azure
202202

203-
Some Linux kernels support TRIM/UNMAP operations to discard unused blocks on the disk. This feature is primarily useful in standard storage to inform Azure that deleted pages are no longer valid and can be discarded, and can save money if you create large files and then delete them.
203+
Some Linux kernels support TRIM/UNMAP operations to discard unused blocks on the disk. This feature is primarily useful to inform Azure that deleted pages are no longer valid and can be discarded. This feature can save money on disks that are billed based on the amount of consumed storage, such as unmanaged standard disks and disk snapshots.
204204

205205
There are two ways to enable TRIM support in your Linux VM. As usual, consult your distribution for the recommended approach:
206206

@@ -225,6 +225,12 @@ There are two ways to enable TRIM support in your Linux VM. As usual, consult yo
225225
sudo fstrim /datadrive
226226
```
227227

228+
**SLSE**
229+
230+
```bash
231+
sudo fstrim /datadrive
232+
```
233+
228234
## Next steps
229235

230236
For more information, and to help troubleshoot disk issues, see [Troubleshoot Linux VM device name changes](/troubleshoot/azure/virtual-machines/troubleshoot-device-names-problems).

articles/virtual-machines/linux/expand-disks.md

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: pagienge
55
ms.service: storage
66
ms.collection: linux
77
ms.topic: how-to
8-
ms.date: 12/09/2022
8+
ms.date: 01/06/2023
99
ms.author: pagienge
1010
ms.subservice: disks
1111
ms.custom: references_regions, ignite-fall-2021, devx-track-azurecli
@@ -202,7 +202,7 @@ tmpfs tmpfs 65M 0 65M 0% /run/user/1000
202202
user@ubuntu:~#
203203
```
204204
205-
# [SuSE](#tab/suse)
205+
# [SUSE](#tab/suse)
206206
207207
To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15, and SUSE SLES 15 for SAP:
208208
@@ -211,13 +211,13 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
211211
1. Access your VM as the **root** user by using the ```sudo``` command after logging in as another user:
212212
213213
```
214-
linux:~ # sudo -i
214+
sudo -i
215215
```
216216
217217
1. Use the following command to install the **growpart** package, which will be used to resize the partition, if it is not already present:
218218
219219
```
220-
linux:~ # zypper install growpart
220+
zypper install growpart
221221
```
222222
223223
1. Use the `lsblk` command to find the partition mounted on the root of the file system (**/**). In this case, we see that partition 4 of device **sda** is mounted on **/**:
@@ -237,7 +237,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
237237
1. Resize the required partition by using the `growpart` command and the partition number determined in the preceding step:
238238
239239
```
240-
linux:~ # growpart /dev/sda 4
240+
growpart /dev/sda 4
241241
CHANGED: partition=4 start=3151872 old: size=59762655 end=62914527 new: size=97511391 end=100663263
242242
```
243243
@@ -246,7 +246,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
246246
The following output shows that the **/dev/sda4** partition has been resized to 46.5 GB:
247247
248248
```
249-
linux:~ # lsblk
249+
lsblk
250250
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
251251
sda 8:0 0 48G 0 disk
252252
├─sda1 8:1 0 2M 0 part
@@ -260,7 +260,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
260260
1. Identify the type of file system on the OS disk by using the `lsblk` command with the `-f` flag:
261261
262262
```
263-
linux:~ # lsblk -f
263+
lsblk -f
264264
NAME FSTYPE LABEL UUID MOUNTPOINT
265265
sda
266266
├─sda1
@@ -282,7 +282,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
282282
Example output:
283283
284284
```
285-
linux:~ # xfs_growfs /
285+
xfs_growfs /
286286
meta-data=/dev/sda4 isize=512 agcount=4, agsize=1867583 blks
287287
= sectsz=512 attr=2, projid32bit=1
288288
= crc=1 finobt=0 spinodes=0 rmapbt=0
@@ -299,19 +299,19 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
299299
For **ext4**, use this command:
300300
301301
```
302-
linux:~ #resize2fs /dev/sda4
302+
resize2fs /dev/sda4
303303
```
304304
305305
1. Verify the increased file system size for **df -Th** by using this command:
306306
307307
```
308-
linux:~ #df -Thl
308+
df -Thl
309309
```
310310
311311
Example output:
312312
313313
```
314-
linux:~ # df -Thl
314+
df -Thl
315315
Filesystem Type Size Used Avail Use% Mounted on
316316
devtmpfs devtmpfs 445M 4.0K 445M 1% /dev
317317
tmpfs tmpfs 458M 0 458M 0% /dev/shm
@@ -334,13 +334,13 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
334334
1. Access your VM as the **root** user by using the ```sudo``` command after logging in as another user:
335335
336336
```bash
337-
[root@rhel-lvm ~]# sudo -i
337+
sudo -i
338338
```
339339

340340
1. Use the `lsblk` command to determine which logical volume (LV) is mounted on the root of the file system (**/**). In this case, we see that **rootvg-rootlv** is mounted on **/**. If a different filesystem is in need of resizing, substitute the LV and mount point throughout this section.
341341

342342
```shell
343-
[root@rhel-lvm ~]# lsblk -f
343+
lsblk -f
344344
NAME FSTYPE LABEL UUID MOUNTPOINT
345345
fd0
346346
sda
@@ -359,7 +359,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
359359
1. Check whether there is free space in the LVM volume group (VG) containing the root partition. If there is free space, skip to step 12.
360360

361361
```bash
362-
[root@rhel-lvm ~]# vgdisplay rootvg
362+
vgdisplay rootvg
363363
--- Volume group ---
364364
VG Name rootvg
365365
System ID
@@ -387,20 +387,20 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
387387
1. Install the **cloud-utils-growpart** package to provide the **growpart** command, which is required to increase the size of the OS disk and the gdisk handler for GPT disk layouts This package is preinstalled on most marketplace images
388388

389389
```bash
390-
[root@rhel-lvm ~]# yum install cloud-utils-growpart gdisk
390+
yum install cloud-utils-growpart gdisk
391391
```
392392

393393
1. Determine which disk and partition holds the LVM physical volume (PV) or volumes in the volume group named **rootvg** by using the **pvscan** command. Note the size and free space listed between the brackets (**[** and **]**).
394394

395395
```bash
396-
[root@rhel-lvm ~]# pvscan
396+
pvscan
397397
PV /dev/sda4 VG rootvg lvm2 [<63.02 GiB / <38.02 GiB free]
398398
```
399399

400400
1. Verify the size of the partition by using `lsblk`.
401401

402402
```bash
403-
[root@rhel-lvm ~]# lsblk /dev/sda4
403+
lsblk /dev/sda4
404404
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
405405
sda4 8:4 0 63G 0 part
406406
├─rootvg-tmplv 253:1 0 2G 0 lvm /tmp
@@ -414,14 +414,14 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
414414
1. Expand the partition containing this PV using *growpart*, the device name, and partition number. Doing so will expand the specified partition to use all the free contiguous space on the device.
415415

416416
```bash
417-
[root@rhel-lvm ~]# growpart /dev/sda 4
417+
growpart /dev/sda 4
418418
CHANGED: partition=4 start=2054144 old: size=132161536 end=134215680 new: size=199272414 end=201326558
419419
```
420420

421421
1. Verify that the partition has resized to the expected size by using the `lsblk` command again. Notice that in the example **sda4** has changed from 63G to 95G.
422422

423423
```bash
424-
[root@rhel-lvm ~]# lsblk /dev/sda4
424+
lsblk /dev/sda4
425425
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
426426
sda4 8:4 0 95G 0 part
427427
├─rootvg-tmplv 253:1 0 2G 0 lvm /tmp
@@ -435,28 +435,28 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
435435
1. Expand the PV to use the rest of the newly expanded partition
436436

437437
```bash
438-
[root@rhel-lvm ~]# pvresize /dev/sda4
438+
pvresize /dev/sda4
439439
Physical volume "/dev/sda4" changed
440440
1 physical volume(s) resized or updated / 0 physical volume(s) not resized
441441
```
442442

443443
1. Verify the new size of the PV is the expected size, comparing to original **[size / free]** values.
444444

445445
```bash
446-
[root@rhel-lvm ~]# pvscan
446+
pvscan
447447
PV /dev/sda4 VG rootvg lvm2 [<95.02 GiB / <70.02 GiB free]
448448
```
449449

450450
1. Expand the LV by the required amount, which does not need to be all the free space in the volume group. In the following example, **/dev/mapper/rootvg-rootlv** is resized from 2 GB to 12 GB (an increase of 10 GB) through the following command. This command will also resize the file system on the LV.
451451

452452
```bash
453-
[root@rhel-lvm ~]# lvresize -r -L +10G /dev/mapper/rootvg-rootlv
453+
lvresize -r -L +10G /dev/mapper/rootvg-rootlv
454454
```
455455

456456
Example output:
457457

458458
```bash
459-
[root@rhel-lvm ~]# lvresize -r -L +10G /dev/mapper/rootvg-rootlv
459+
lvresize -r -L +10G /dev/mapper/rootvg-rootlv
460460
Size of logical volume rootvg/rootlv changed from 2.00 GiB (512 extents) to 12.00 GiB (3072 extents).
461461
Logical volume rootvg/rootlv successfully resized.
462462
meta-data=/dev/mapper/rootvg-rootlv isize=512 agcount=4, agsize=131072 blks
@@ -476,10 +476,9 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
476476
Example output:
477477

478478
```shell
479-
[root@rhel-lvm ~]# df -Th /
479+
df -Th /
480480
Filesystem Type Size Used Avail Use% Mounted on
481481
/dev/mapper/rootvg-rootlv xfs 12G 71M 12G 1% /
482-
[root@rhel-lvm ~]#
483482
```
484483

485484
> [!NOTE]
@@ -492,21 +491,21 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
492491
1. Access your VM as the **root** user by using the ```sudo``` command after logging in as another user:
493492

494493
```bash
495-
[root@rhel-raw ~]# sudo -i
494+
sudo -i
496495
```
497496

498497
1. When the VM has restarted, perform the following steps:
499498

500499
1. Install the **cloud-utils-growpart** package to provide the **growpart** command, which is required to increase the size of the OS disk and the gdisk handler for GPT disk layouts. This package is preinstalled on most marketplace images
501500

502501
```bash
503-
[root@rhel-raw ~]# yum install cloud-utils-growpart gdisk
502+
yum install cloud-utils-growpart gdisk
504503
```
505504

506505
1. Use the **lsblk -f** command to verify the partition and filesystem type holding the root (**/**) partition
507506

508507
```bash
509-
[root@rhel-raw ~]# lsblk -f
508+
lsblk -f
510509
NAME FSTYPE LABEL UUID MOUNTPOINT
511510
sda
512511
├─sda1 xfs 2a7bb59d-6a71-4841-a3c6-cba23413a5d2 /boot
@@ -520,7 +519,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
520519
1. For verification, start by listing the partition table of the sda disk with **gdisk**. In this example, we see a 48.0 GiB disk with partition #2 sized 29.0 GiB. The disk was expanded from 30 GB to 48 GB in the Azure portal.
521520

522521
```bash
523-
[root@rhel-raw ~]# gdisk -l /dev/sda
522+
gdisk -l /dev/sda
524523
GPT fdisk (gdisk) version 0.8.10
525524

526525
Partition table scan:
@@ -548,14 +547,14 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
548547
1. Expand the partition for root, in this case sda2 by using the **growpart** command. Using this command expands the partition to use all of the contiguous space on the disk.
549548

550549
```bash
551-
[root@rhel-raw ~]# growpart /dev/sda 2
550+
growpart /dev/sda 2
552551
CHANGED: partition=2 start=2050048 old: size=60862464 end=62912512 new: size=98613214 end=100663262
553552
```
554553

555554
1. Now print the new partition table with **gdisk** again. Notice that partition 2 has is now sized 47.0 GiB
556555

557556
```bash
558-
[root@rhel-raw ~]# gdisk -l /dev/sda
557+
gdisk -l /dev/sda
559558
GPT fdisk (gdisk) version 0.8.10
560559

561560
Partition table scan:
@@ -583,7 +582,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
583582
1. Expand the filesystem on the partition with **xfs_growfs**, which is appropriate for a standard marketplace-generated RedHat system:
584583

585584
```bash
586-
[root@rhel-raw ~]# xfs_growfs /
585+
xfs_growfs /
587586
meta-data=/dev/sda2 isize=512 agcount=4, agsize=1901952 blks
588587
= sectsz=4096 attr=2, projid32bit=1
589588
= crc=1 finobt=0 spinodes=0
@@ -599,7 +598,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
599598
1. Verify the new size is reflected with the **df** command
600599

601600
```bash
602-
[root@rhel-raw ~]# df -hl
601+
df -hl
603602
Filesystem Size Used Avail Use% Mounted on
604603
devtmpfs 452M 0 452M 0% /dev
605604
tmpfs 464M 0 464M 0% /dev/shm

0 commit comments

Comments
 (0)