Skip to content

Commit 8ed4b05

Browse files
authored
Merge pull request #223223 from roygara/linFirst
Initial draft changes
2 parents 9a3093d + 44c4f58 commit 8ed4b05

File tree

4 files changed

+99
-102
lines changed

4 files changed

+99
-102
lines changed

articles/virtual-machines/linux/add-disk.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: storage
66
ms.subservice: disks
77
ms.collection: linux
88
ms.topic: how-to
9-
ms.date: 12/08/2022
9+
ms.date: 01/09/2023
1010
ms.author: rogarana
1111
---
1212

@@ -55,7 +55,7 @@ ssh [email protected]
5555

5656
### Find the disk
5757

58-
Once connected to your VM, you need to find the disk. In this example, we are using `lsblk` to list the disks.
58+
Once you connect to your VM, find the disk. In this example, we're using `lsblk` to list the disks.
5959

6060
```bash
6161
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
@@ -73,19 +73,19 @@ sdb 1:0:1:0 14G
7373
sdc 3:0:0:0 50G
7474
```
7575

76-
Here, `sdc` is the disk that we want, because it is 50G. If you add multiple disks, and aren't sure which disk it is based on size alone, you can go to the VM page in the portal, select **Disks**, and check the LUN number for the disk under **Data disks**. Compare the LUN number from the portal to the last number of the **HTCL** portion of the output, which is the LUN.
76+
Here, `sdc` is the disk that we want, because it's 50G. If you add multiple disks, and aren't sure which disk it's based on size alone, you can go to the VM page in the portal, select **Disks**, and check the LUN number for the disk under **Data disks**. Compare the LUN number from the portal to the last number of the **HTCL** portion of the output, which is the LUN.
7777

7878

7979
### Format the disk
8080

81-
Format the disk with `parted`, if the disk size is 2 tebibytes (TiB) or larger then you must use GPT partitioning, if it is under 2TiB, then you can use either MBR or GPT partitioning.
81+
Format the disk with `parted`, if the disk size is two tebibytes (TiB) or larger then you must use GPT partitioning, if it is under 2TiB, then you can use either MBR or GPT partitioning.
8282

8383
> [!NOTE]
8484
> It is recommended that you use the latest version `parted` that is available for your distro.
8585
> If the disk size is 2 tebibytes (TiB) or larger, you must use GPT partitioning. If disk size is under 2 TiB, then you can use either MBR or GPT partitioning.
8686
8787

88-
The following example uses `parted` on `/dev/sdc`, which is where the first data disk will typically be on most VMs. Replace `sdc` with the correct option for your disk. We are also formatting it using the [XFS](https://xfs.wiki.kernel.org/) filesystem.
88+
The following example uses `parted` on `/dev/sdc`, which is where the first data disk will typically be on most VMs. Replace `sdc` with the correct option for your disk. We're also formatting it using the [XFS](https://xfs.wiki.kernel.org/) filesystem.
8989

9090
```bash
9191
sudo parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100%
@@ -112,7 +112,7 @@ sudo mount /dev/sdc1 /datadrive
112112

113113
### Persist the mount
114114

115-
To ensure that the drive is remounted automatically after a reboot, it must be added to the */etc/fstab* file. It is also highly recommended that the UUID (Universally Unique Identifier) is used in */etc/fstab* to refer to the drive rather than just the device name (such as, */dev/sdc1*). If the OS detects a disk error during boot, using the UUID avoids the incorrect disk being mounted to a given location. Remaining data disks would then be assigned those same device IDs. To find the UUID of the new drive, use the `blkid` utility:
115+
To ensure that the drive is remounted automatically after a reboot, it must be added to the */etc/fstab* file. It's also highly recommended that the UUID (Universally Unique Identifier) is used in */etc/fstab* to refer to the drive rather than just the device name (such as, */dev/sdc1*). If the OS detects a disk error during boot, using the UUID avoids the incorrect disk being mounted to a given location. Remaining data disks would then be assigned those same device IDs. To find the UUID of the new drive, use the `blkid` utility:
116116

117117
```bash
118118
sudo blkid
@@ -131,19 +131,13 @@ The output looks similar to the following example:
131131
> [!NOTE]
132132
> 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.
133133
134-
Next, open the */etc/fstab* file in a text editor as follows:
135-
136-
```bash
137-
sudo nano /etc/fstab
138-
```
139-
140-
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:
134+
Next, open the **/etc/fstab** file in a text editor. Add a line to the end of the file, using the UUID value for the `/dev/sdc1` device that was created in the previous steps, and the mountpoint of `/datadrive`. Using the example from this article, the new line would look like the following:
141135

142136
```bash
143137
UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /datadrive xfs defaults,nofail 1 2
144138
```
145139

146-
In this example, we are using 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.
140+
When you're done editing the file, save and close the editor.
147141

148142
> [!NOTE]
149143
> 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.
@@ -166,19 +160,26 @@ There are two ways to enable TRIM support in your Linux VM. As usual, consult yo
166160

167161
- In some cases, the `discard` option may have performance implications. Alternatively, you can run the `fstrim` command manually from the command line, or add it to your crontab to run regularly:
168162

169-
**Ubuntu**
163+
# [Ubuntu](#tab/ubuntu)
170164

171-
```bash
172-
sudo apt-get install util-linux
173-
sudo fstrim /datadrive
174-
```
165+
```bash
166+
sudo apt-get install util-linux
167+
sudo fstrim /datadrive
168+
```
175169

176-
**RHEL/CentOS**
170+
# [RHEL](#tab/rhel)
177171

178-
```bash
179-
sudo yum install util-linux
180-
sudo fstrim /datadrive
181-
```
172+
```bash
173+
sudo yum install util-linux
174+
sudo fstrim /datadrive
175+
```
176+
177+
# [SUSE](#tab/suse)
178+
179+
```bash
180+
sudo fstrim /datadrive
181+
```
182+
---
182183

183184
## Troubleshooting
184185

@@ -187,4 +188,4 @@ There are two ways to enable TRIM support in your Linux VM. As usual, consult yo
187188
## Next steps
188189

189190
* To ensure your Linux VM is configured correctly, review the [Optimize your Linux machine performance](/previous-versions/azure/virtual-machines/linux/optimization) recommendations.
190-
* Expand your storage capacity by adding additional disks and [configure RAID](/previous-versions/azure/virtual-machines/linux/configure-raid) for additional performance.
191+
* Expand your storage capacity by adding more disks and [configure RAID](/previous-versions/azure/virtual-machines/linux/configure-raid) for extra performance.

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

Lines changed: 36 additions & 35 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/09/2023
88
ms.author: rogarana
99
ms.subservice: disks
1010
ms.collection: linux
@@ -38,14 +38,14 @@ Before you attach disks to your VM, review these tips:
3838
:::image type="content" source="./media/attach-disk-portal/create-new-md.png" alt-text="Review disk settings.":::
3939

4040

41-
1. When you are done, select **Save** at the top of the page to create the managed disk and update the VM configuration.
41+
1. When you're done, select **Save** at the top of the page to create the managed disk and update the VM configuration.
4242

4343

4444
## Attach an existing disk
4545
1. On the **Disks** pane, under **Data disks**, select **Attach existing disks**.
46-
1. Click the drop-down menu for **Disk name** and select a disk from the list of available managed disks.
46+
1. Select the drop-down menu for **Disk name** and select a disk from the list of available managed disks.
4747

48-
1. Click **Save** to attach the existing managed disk and update the VM configuration:
48+
1. Select **Save** to attach the existing managed disk and update the VM configuration:
4949

5050

5151
## Connect to the Linux VM to mount the new disk
@@ -57,7 +57,7 @@ ssh [email protected]
5757

5858
## Find the disk
5959

60-
Once connected to your VM, you need to find the disk. In this example, we are using `lsblk` to list the disks.
60+
Once connected to your VM, you need to find the disk. In this example, we're using `lsblk` to list the disks.
6161

6262
```bash
6363
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
@@ -75,15 +75,15 @@ sdb 1:0:1:0 14G
7575
sdc 3:0:0:0 4G
7676
```
7777

78-
In this example, the disk that I added is `sdc`. It is a LUN 0 and is 4GB.
78+
In this example, the disk that was added was `sdc`. It's a LUN 0 and is 4GB.
7979

80-
For a more complex example, here is what multiple data disks look like in the portal:
80+
For a more complex example, here's what multiple data disks look like in the portal:
8181

8282
:::image type="content" source="./media/attach-disk-portal/find-disk.png" alt-text="Screenshot of multiple disks shown in the portal.":::
8383

8484
In the image, you can see that there are 3 data disks: 4 GB on LUN 0, 16GB at LUN 1, and 32G at LUN 2.
8585

86-
Here is what that might look like using `lsblk`:
86+
Here's what that might look like using `lsblk`:
8787

8888
```bash
8989
sda 0:0:0:0 30G
@@ -103,16 +103,16 @@ 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
108-
If you are attaching a new disk, you need to partition the disk.
108+
If you're attaching a new disk, you need to partition the disk.
109109

110110
The `parted` utility can be used to partition and to format a data disk.
111-
- It is recommended that you use the latest version `parted` that is available for your distro.
111+
- Use the latest version `parted` that is available for your distro.
112112
- If the disk size is 2 tebibytes (TiB) or larger, you must use GPT partitioning. If disk size is under 2 TiB, then you can use either MBR or GPT partitioning.
113113

114114

115-
The following example uses `parted` on `/dev/sdc`, which is where the first data disk will typically be on most VMs. Replace `sdc` with the correct option for your disk. We are also formatting it using the [XFS](https://xfs.wiki.kernel.org/) filesystem.
115+
The following example uses `parted` on `/dev/sdc`, which is where the first data disk will typically be on most VMs. Replace `sdc` with the correct option for your disk. We're also formatting it using the [XFS](https://xfs.wiki.kernel.org/) filesystem.
116116

117117
```bash
118118
sudo parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100%
@@ -136,7 +136,7 @@ Use `mount` to then mount the filesystem. The following example mounts the */dev
136136
sudo mount /dev/sdc1 /datadrive
137137
```
138138

139-
To ensure that the drive is remounted automatically after a reboot, it must be added to the */etc/fstab* file. It is also highly recommended that the UUID (Universally Unique Identifier) is used in */etc/fstab* to refer to the drive rather than just the device name (such as, */dev/sdc1*). If the OS detects a disk error during boot, using the UUID avoids the incorrect disk being mounted to a given location. Remaining data disks would then be assigned those same device IDs. To find the UUID of the new drive, use the `blkid` utility:
139+
To ensure that the drive is remounted automatically after a reboot, it must be added to the */etc/fstab* file. It's also highly recommended that the UUID (Universally Unique Identifier) is used in */etc/fstab* to refer to the drive rather than just the device name (such as, */dev/sdc1*). If the OS detects a disk error during boot, using the UUID avoids the incorrect disk being mounted to a given location. Remaining data disks would then be assigned those same device IDs. To find the UUID of the new drive, use the `blkid` utility:
140140

141141
```bash
142142
sudo blkid
@@ -153,21 +153,15 @@ 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:
159-
160-
```bash
161-
sudo nano /etc/fstab
162-
```
163-
164-
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:
158+
Next, open the **/etc/fstab** file in a text editor. Add a line to the end of the file, using the UUID value for the `/dev/sdc1` device that was created in the previous steps, and the mountpoint of `/datadrive`. Using the example from this article, the new line would look like the following:
165159

166160
```bash
167161
UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /datadrive xfs defaults,nofail 1 2
168162
```
169163

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.
164+
When you're done editing the file, save and close the editor.
171165

172166
> [!NOTE]
173167
> 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 +194,7 @@ You can see that `sdc` is now mounted at `/datadrive`.
200194

201195
### TRIM/UNMAP support for Linux in Azure
202196

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.
197+
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.
204198

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

@@ -211,19 +205,26 @@ There are two ways to enable TRIM support in your Linux VM. As usual, consult yo
211205
```
212206
* In some cases, the `discard` option may have performance implications. Alternatively, you can run the `fstrim` command manually from the command line, or add it to your crontab to run regularly:
213207

214-
**Ubuntu**
215-
216-
```bash
217-
sudo apt-get install util-linux
218-
sudo fstrim /datadrive
219-
```
220-
221-
**RHEL/CentOS**
208+
# [Ubuntu](#tab/ubuntu)
222209

223-
```bash
224-
sudo yum install util-linux
225-
sudo fstrim /datadrive
226-
```
210+
```bash
211+
sudo apt-get install util-linux
212+
sudo fstrim /datadrive
213+
```
214+
215+
# [RHEL](#tab/rhel)
216+
217+
```bash
218+
sudo yum install util-linux
219+
sudo fstrim /datadrive
220+
```
221+
222+
# [SUSE](#tab/suse)
223+
224+
```bash
225+
sudo fstrim /datadrive
226+
```
227+
---
227228

228229
## Next steps
229230

articles/virtual-machines/linux/detach-disk.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: roygara
55
ms.service: storage
66
ms.collection: linux
77
ms.topic: how-to
8-
ms.date: 06/08/2022
8+
ms.date: 01/09/2023
99
ms.author: rogarana
1010
ms.subservice: disks
1111
ms.custom: devx-track-azurecli
@@ -69,19 +69,15 @@ Edit the */etc/fstab* file to remove references to the disk.
6969
> [!NOTE]
7070
> 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.
7171
72-
Open the */etc/fstab* file in a text editor as follows:
73-
74-
```bash
75-
sudo vi /etc/fstab
76-
```
77-
78-
In this example, the following line needs to be deleted from the */etc/fstab* file:
72+
Open the **/etc/fstab** file in a text editor and remove the line containing the UUID of your disk. Using the example values in this article, the line would look like the following:
7973

8074
```bash
8175
UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /datadrive ext4 defaults,nofail 1 2
8276
```
8377

84-
Use `umount` to unmount the disk. The following example unmounts the */dev/sdc1* partition from the */datadrive* mount point:
78+
Save and close the file when you're done.
79+
80+
Next, use `umount` to unmount the disk. The following example unmounts the */dev/sdc1* partition from the */datadrive* mount point:
8581

8682
```bash
8783
sudo umount /dev/sdc1 /datadrive

0 commit comments

Comments
 (0)