Mounting a New Disk on Linux

Fiko BorizqyFiko Borizqy
2 min read

(in my case: a 140 GB disk*)*

When working on cloud servers - whether in Oracle Cloud, AWS, or your own bare-metal rigs - it’s common to attach additional block volumes for more storage. In this guide, we’ll walk through mounting a fresh 140 GB disk at a custom directory so it’s ready for your data and persists across reboots.

1. Identify the New Disk

First, list your block devices:

bash

lsblk

In my case the new disk appeared as /dev/sdb and is 140 GB in size:

Code

NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda       8:0    0 46.6G  0 disk 
├─sda1    8:1    0 45.6G  0 part /
├─sda15   8:15   0   99M  0 part /boot/efi
└─sda16 259:0    0  923M  0 part /boot
sdb       8:16   0  140G  0 disk

2. Partition the Disk

If it’s completely unformatted, create a partition table and one primary partition:

bash

sudo fdisk /dev/sdb

Inside fdisk:

  • Press np → accept defaults

  • Press w to save changes

3. Format the Partition

bash

sudo mkfs.ext4 /dev/sdb1

💡 Replace sdb1 with your actual partition name.

4. Create a Mount Point

Even though you can mount into /etc/data, best practice is to use /mnt/data or /data for clarity:

bash

sudo mkdir -p /mnt/data

5. Mount the Partition

bash

sudo mount /dev/sdb1 /mnt/data

6. Make the Mount Persistent

Find the UUID:

bash

sudo blkid /dev/sdb1

Edit /etc/fstab:

plaintext

UUID=abcd-1234-...   /mnt/data   ext4   defaults   0   2

Test it:

bash

sudo mount -a

📌 Final Thoughts

  • Mount points under /mnt or /data keep the system layout predictable and reduce risk of breaking config-related directories.

  • Always double-check fstab entries before rebooting - a wrong mount configuration can block the boot process.

  • In this real-world example, we mounted a 140 GB disk, but the same process applies to any size.

0
Subscribe to my newsletter

Read articles from Fiko Borizqy directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Fiko Borizqy
Fiko Borizqy

I wrote these tutorials for myself in future when I forget for the next steps.