Mounting a New Disk on Linux

I wrote these tutorials for myself in future when I forget for the next steps.
Search for a command to run...

I wrote these tutorials for myself in future when I forget for the next steps.
No comments yet. Be the first to comment.
When you provision an Ubuntu instance on Oracle Cloud, you'll notice something different from standard Ubuntu installations: the system uses iptables instead of ufw for firewall management. This disti

When developing web applications locally, HTTPS is often overlooked. Yet, modern browsers and APIs increasingly require secure connections—even in development. That’s where mkcert comes in: a simple t

Testing the checkout success page in Magento 2 can be frustrating. By default, once an order is placed, Magento clears the quote session, meaning you can’t simply refresh or revisit the success page without going through the entire checkout process a...

Magento Commerce (EE) offers powerful features, but for many teams, Open Source (CE) is leaner, lighter, and more sustainable. If you're migrating from EE to CE, the Opengento downgrade tool provides a clean, scriptable way to remove proprietary modu...

If you’ve ever checked your Apache error logs and seen something like this: Code [core:error] (13)Permission denied: access to /robots.txt denied (filesystem path '/home/username/sites') because search permissions are missing on a component of the pa...

(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.
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
If it’s completely unformatted, create a partition table and one primary partition:
bash
sudo fdisk /dev/sdb
Inside fdisk:
Press n → p → accept defaults
Press w to save changes
bash
sudo mkfs.ext4 /dev/sdb1
💡 Replace sdb1 with your actual partition name.
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
bash
sudo mount /dev/sdb1 /mnt/data
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
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.