How to Mount the Extra Disk in Linux VM

1. Create the mount point (if it doesn’t exist)

sudo mkdir -p /data

2. Check if the disk is already partitioned

lsblk

Look for /dev/sdb or /dev/sdb1.
If it's unpartitioned, you can format the entire disk (/dev/sdb).
If it's already partitioned (e.g., /dev/sdb1), use that instead.


3. (Optional) Partition the disk (if needed)

If /dev/sdb is raw, partition it:

sudo fdisk /dev/sdb
  • Press n new partition

  • Press p primary

  • Accept defaults

  • Press w write and exit

Then run:

sudo partprobe /dev/sdb

4. Format the partition (ext4)

Replace sdb1 with your actual partition (or use sdb if not partitioned):

 
sudo mkfs.ext4 /dev/sdb1

5. Mount it to /data

sudo mount /dev/sdb1 /data

6. Make the mount permanent (optional)

To mount the disk at boot, add it to /etc/fstab.

echo "UUID=$(blkid -s UUID -o value /dev/sdb1) /data ext4 defaults 0 2" | sudo tee -a /etc/fstab

 

Before You Reboot:

Always test the fstab mount manually to make sure it's correct:

sudo mount -a

If no errors appear, your fstab entry is valid.

  • 31 Users Found This Useful
Was this answer helpful?

Related Articles

How to enable Two- factor Authentication for client area

What is Two-factor Authentication? Two-factor authentication adds an additional layer of...

How to Assign an IPv6 Address to Another NIC in Linux VPS - ServaRICA

In our VPS there are 2 scenarios to add an IPv6 address in VPS Those are  If VPS has 2...

Add SPF record for e-mail hosted at Servarica

Adding a txt SPF record for e-mail services hosted at ServaRICA   In order to make sure e-mail...

How to fix Network issue on Windows VMs

Windows recently Pushed the XenServer VM Tools update which caused problems with Xen PV drivers...

How to Add an IPv6 Address to your Xen/KVM Linux VPS

This guide explains how to configure a static IPv6 address on common Linux operating systems....