You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/linux/expand-disks.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,9 +39,9 @@ Filesystem Type Size Used Avail Use% Mounted on
39
39
/dev/sde1 ext4 32G 49M 30G 1% /opt/db/log
40
40
```
41
41
42
-
Here we can see, for example, the `/opt/db/data` filesystem is nearly full, and is located on the `/dev/sdd1` partition. The output of `df` shows the device path whether the disk is mounted by the device path or the (preferred) UUID in the fstab. Also take note of the Type column, indicating the format of the filesystem. This is important later.
42
+
Here we can see, for example, the `/opt/db/data` filesystem is nearly full, and is located on the `/dev/sdd1` partition. The output of `df` shows the device path whether the disk is mounted using the device path or the (preferred) UUID in the fstab. Also take note of the Type column, indicating the format of the filesystem. The format is important later.
43
43
44
-
Now locate the LUN that correlates to `/dev/sdd` by examining the contents of `/dev/disk/azure/scsi1`. The output of the following `ls` command shows that the device known as `/dev/sdd` within the Linux OS is located at LUN1 when looking in the Azure portal.
44
+
Now locate the LUN that correlates to `/dev/sdd` by examining the contents of `/dev/disk/azure/scsi1`. The output of the following `ls` command shows that the device known as `/dev/sdd` within the Linux OS is located at LUN1 when looking in the Azure portal.
45
45
46
46
```bash
47
47
sudo ls -alF /dev/disk/azure/scsi1/
@@ -117,11 +117,11 @@ In the following samples, replace example parameter names such as *myResourceGro
117
117
118
118
## Expand a disk partition and filesystem
119
119
> [!NOTE]
120
-
> While there are many tools that may be used for performing the partition resizing, the tools detailed in the remainder of this document are the same tools used by certain automated processes such as cloud-init. As described here, the `growpart` tool with the `gdisk` package provides universal compatibility with GUID Partition Table (GPT) disks, as older versions of some tools such as `fdisk` did not support GPT.
120
+
> While there are many tools that may be used for performing the partition resizing, the tools detailed in the remainder of this document are the same tools used by certain automated processes such as cloud-init. As described here, the `growpart` tool with the `gdisk` package provides universal compatibility with GUID Partition Table (GPT) disks, as older versions of some tools such as `fdisk` did not support GPT.
121
121
122
122
### Detecting a changed disk size
123
123
124
-
If a data disk was expanded without downtime using the procedure mentioned previously, the disk size won't be changed until the device is rescanned, which normally only happens during the boot process. This rescan can be called on-demand with the following procedure. In this example, we have found using the methods in this document that the data disk is currently `/dev/sda` and was resized from 256 GiB to 512 GiB.
124
+
If a data disk was expanded without downtime using the procedure mentioned previously, the reported disk size doesn't change until the device is rescanned, which normally only happens during the boot process. This rescan can be called on-demand with the following procedure. In this example, we find using the methods in this document that the data disk is currently `/dev/sda` and was resized from 256 GiB to 512 GiB.
125
125
126
126
1. Identify the currently recognized size on the first line of output from `fdisk -l /dev/sda`
127
127
@@ -142,7 +142,7 @@ If a data disk was expanded without downtime using the procedure mentioned previ
142
142
/dev/sda1 2048 536870878 536868831 256G 83 Linux
143
143
```
144
144
145
-
1. Insert a `1` character into the rescan file for this device. Note the reference to sda in the example. The disk identifier would change if a different disk device was resized.
145
+
1. Insert a `1` character into the rescan file for this device. Note the reference to sda in the example. The disk identifier would change if a different disk device was resized.
146
146
147
147
```bash
148
148
echo 1 | sudo tee /sys/class/block/sda/device/rescan
@@ -167,9 +167,9 @@ If a data disk was expanded without downtime using the procedure mentioned previ
167
167
/dev/sda1 2048 536870878 536868831 256G 83 Linux
168
168
```
169
169
170
-
The remainder of this article uses the OS disk for the examples of the procedure for increasing the size of a volume at the OS level. If the expanded disk is a data disk, use the [previous guidance for identifying the data disk device](#identifyDisk), and follow these instructions as a guideline, substituting the data disk device (for example `/dev/sda`), partition numbers, volume names, mount points, and filesystem formats, as necessary.
170
+
The remainder of this article uses the OS disk for the examples of the procedure for increasing the size of a volume at the OS level. If the expanded disk is a data disk, use the [previous guidance for identifying the data disk device](#identifyDisk), and follow these instructions as a guideline, substituting the data disk device (for example `/dev/sda`), partition numbers, volume names, mount points, and filesystem formats, as necessary.
171
171
172
-
All Linux OS guidance should be viewed as generic and may apply on any distribution, but generally matches the conventions of the named marketplace publisher. Reference the Red Hat documents for the package requirements on any distribution based on Red Hat or claiming Red Hat compatibility.
172
+
All Linux OS guidance should be viewed as generic and may apply on any distribution, but generally matches the conventions of the named marketplace publisher. Reference the Red Hat documents for the package requirements on any distribution based on Red Hat or claiming Red Hat compatibility.
173
173
174
174
### Increase the size of the OS disk
175
175
@@ -180,7 +180,7 @@ The following instructions apply to endorsed Linux distributions.
180
180
181
181
# [Ubuntu](#tab/ubuntu)
182
182
183
-
On Ubuntu 16.x and newer, the root partition of the OS disk and filesystems are automatically expanded to utilize all free contiguous space on the root disk by cloud-init, provided there's a small bit of free space for the resize operation. For this circumstance the sequence is simply
183
+
On Ubuntu 16.x and newer, the root partition of the OS disk and filesystems are automatically expanded to utilize all free contiguous space on the root disk by cloud-init, provided there's a small bit of free space for the resize operation. In this case, the sequence is simply
184
184
185
185
1. Increase the size of the OS disk as detailed previously
186
186
1. Restart the VM, and then access the VM using the **root** user account.
@@ -210,15 +210,15 @@ user@ubuntu:~#
210
210
211
211
To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15, and SUSE SLES 15 for SAP:
212
212
213
-
1. Follow the procedure above to expand the disk in the Azure infrastructure.
213
+
1. Follow the procedure previously described to expand the disk in the Azure infrastructure.
214
214
215
215
1. Access your VM as the **root** user by using the ```sudo``` command after logging in as another user:
216
216
217
217
```bash
218
218
sudo -i
219
219
```
220
220
221
-
1. Use the following command to install the **growpart** package, which will be used to resize the partition, if it isn't already present:
221
+
1. Use the following command to install the **growpart** package, which is used to resize the partition, if it isn't already present:
222
222
223
223
```bash
224
224
zypper install growpart
@@ -343,7 +343,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
343
343
344
344
# [Red Hat with LVM](#tab/rhellvm)
345
345
346
-
1. Follow the procedure above to expand the disk in the Azure infrastructure.
346
+
1. Follow the procedure previously described to expand the disk in the Azure infrastructure.
347
347
348
348
1. Access your VM as the **root** user by using the ```sudo``` command after logging in as another user:
349
349
@@ -373,7 +373,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
1. Check whether there's free space in the LVM volume group (VG) containing the root partition. If there's free space, skip to step 12.
376
+
1. Check whether there's free space in the LVM volume group (VG) containing the root partition. If there's free space, skip to step 12.
377
377
378
378
```bash
379
379
vgdisplay rootvg
@@ -404,7 +404,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
404
404
405
405
In this example, the line **Free PE / Size** shows that there's 38.02 GB free in the volume group, as the disk has already been resized.
406
406
407
-
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
407
+
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
408
408
409
409
```bash
410
410
dnf install cloud-utils-growpart gdisk
@@ -449,7 +449,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
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.
452
+
1. Verify that the partition has resized to the expected size by using the `lsblk` command again. Notice that in the example **sda4** changed from 63G to 95G.
453
453
454
454
```bash
455
455
lsblk /dev/sda4
@@ -487,7 +487,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
1. Expand the LV by the required amount, which doesn't 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.
490
+
1. Expand the LV by the required amount, which doesn't 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 also resizes the file system on the LV.
491
491
492
492
```bash
493
493
lvresize -r -L +10G /dev/mapper/rootvg-rootlv
@@ -528,15 +528,15 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
528
528
529
529
# [Red Hat without LVM](#tab/rhelraw)
530
530
531
-
1. Follow the procedure above to expand the disk in the Azure infrastructure.
531
+
1. Follow the procedure previously described to expand the disk in the Azure infrastructure.
532
532
533
533
1. Access your VM as the **root** user by using the ```sudo``` command after logging in as another user:
534
534
535
535
```bash
536
536
sudo -i
537
537
```
538
538
539
-
1. When the VM has restarted, perform the following steps:
539
+
1. When the VM restarts completely, perform the following steps:
540
540
541
541
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
542
542
@@ -563,7 +563,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
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.
566
+
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.
567
567
568
568
```bash
569
569
gdisk -l /dev/sda
@@ -594,7 +594,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
594
594
15 10240 1024000 495.0 MiB EF00 EFI System Partition
595
595
```
596
596
597
-
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.
597
+
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.
598
598
599
599
```bash
600
600
growpart /dev/sda 2
@@ -604,7 +604,7 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
0 commit comments