Skip to content

Commit 38656c1

Browse files
committed
add another step to add new disk to fstab using echo
1 parent a0c63cb commit 38656c1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,18 @@ The output looks similar to the following example:
133133
134134
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:
135135

136-
```bash
136+
```output
137137
UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /datadrive xfs defaults,nofail 1 2
138138
```
139139

140140
When you're done editing the file, save and close the editor.
141141

142+
Alternatively, you can run the following command to add the disk to the `/etc/fstab` file:
143+
144+
```bash
145+
echo "UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /datadrive xfs defaults,nofail 1 2" >> /etc/fstab
146+
```
147+
142148
> [!NOTE]
143149
> 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.
144150
>

0 commit comments

Comments
 (0)