Sometimes your computer just needs more space. Maybe you’re running out of room for files, photos, videos, or backups. That’s when adding a new disk (or hard drive) to your Linux system comes in handy.
I’ve done this a few times, especially when working on servers or setting up test machines at home. At first, I thought it would be complicated. But once I did it step by step, it made total sense. And now, I’ll walk you through how I do it — in plain English.
In this post, I’ll show you how to add a new disk to a Linux system and make it usable. This is called mounting, which means making the disk ready so Linux can read and write files on it.
Let’s break things down, keep it simple, and throw in a pun or two. After all, why did the hard drive apply for a job? It wanted more space to grow.
What Is a “Disk” in Linux?
In Linux, the word “disk” usually means a hard drive or solid-state drive (SSD). It’s a piece of hardware that stores your files. Think of it like a giant digital cabinet where you keep all your stuff.
When you plug in a new disk, Linux doesn’t automatically use it like Windows might. You need to tell Linux:
- That the disk is there
- How to format it
- Where to mount it (attach it to the system)
This might sound like a lot, but trust me, it’s just a few commands and steps.
What You’ll Need
Before we start, here’s what you’ll need:
- A Linux system (like Ubuntu, Debian, CentOS, Fedora, etc.)
- A new disk (either physically added or a virtual disk if you’re using a virtual machine)
- Access to the terminal with
sudo
or root permissions
Let’s say I just added a new SSD to my computer. Here’s how I set it up.
Step 1: Find the New Disk
First, I need to see if Linux can detect the new disk.
Open a terminal and type:
lsblk
This stands for “list block devices.” It shows all the disks and partitions on your system.
You might see something like this:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 96G 0 part /
├─sda2 8:2 0 4G 0 part [SWAP]
sdb 8:16 0 200G 0 disk
Here, sdb
is the new disk I just added. It doesn’t have any partitions yet, which means it’s like a blank sheet of paper.
Step 2: Create a Partition
Now I’ll create a partition, which is like dividing the disk into usable sections. Usually, we just make one big partition.
I use a tool called fdisk
. It’s a simple program that helps make partitions.
Type this:
sudo fdisk /dev/sdb
(Replace /dev/sdb
with the name of your disk.)
You’ll enter an interactive mode. Here are the keys I use:
n
– to create a new partitionp
– to make it a primary partition- Press Enter to accept the default partition number and size
w
– to write changes and exit
Once done, you’ve made a partition. It’s usually called /dev/sdb1
.
Pun time: I told my new disk to get in line — it got partitioned.
Step 3: Format the Partition
Now that we have a partition, we need to format it. Formatting prepares the partition with a file system, which is how Linux organizes files on it.
I usually go with ext4
, which is reliable and works well for most tasks.
Here’s the command:
sudo mkfs.ext4 /dev/sdb1
This wipes the partition clean and sets up the ext4 file system.
After this, the disk is like a freshly paved road — ready for traffic (your files).
Step 4: Create a Mount Point
Next, I need to create a folder (or directory) where the disk will be “attached” to the system. This folder is called a mount point.
You can create a mount point anywhere, but I like to put mine under /mnt
or /media
.
Let’s say:
sudo mkdir /mnt/mydisk
This will be the spot where you can access the new disk.
Step 5: Mount the Disk
Now, mount the partition to the mount point:
sudo mount /dev/sdb1 /mnt/mydisk
Boom — now the disk is usable. You can test it by creating a file:
sudo touch /mnt/mydisk/testfile.txt
If that works, the disk is ready to use.
Step 6: Make It Mount Automatically
Right now, the disk only mounts until the next reboot. To make it automatic, we edit a file called /etc/fstab
.
First, get the UUID (a unique ID for your disk):
sudo blkid /dev/sdb1
You’ll see something like this:
/dev/sdb1: UUID="1234-ABCD" TYPE="ext4"
Now, open the fstab file:
sudo nano /etc/fstab
And add this line at the bottom:
UUID=1234-ABCD /mnt/mydisk ext4 defaults 0 2
(Replace the UUID with yours.)
Save and exit. Now the disk will mount every time you boot your computer.
Why Do This?
You might wonder, “Why not just plug and play like Windows?” Fair question. Linux gives you full control — but that means more responsibility.
Adding and mounting disks manually lets you:
- Choose where files are stored
- Use different file systems for different tasks
- Avoid problems when managing servers or backups
Here’s when I find this useful:
- Setting up storage for large video files
- Creating a backup drive on my home server
- Running a Minecraft server and needing a separate drive just for game data
Some Quick Tips
Here are a few things I learned the hard way:
- Always back up your data first
- Double-check the disk name (
/dev/sdb
,/dev/sdc
, etc.) — don’t format the wrong one - Don’t remove the disk if it’s mounted unless you unmount it first
What’s the Difference Between a Disk, Partition, and File System?
Let’s compare:
Term | What It Means |
---|---|
Disk | The whole drive (like an SSD or hard drive) |
Partition | A section of the disk that you can format and use |
File System | The method Linux uses to store and read files (like ext4, xfs, etc.) |
Think of it like this:
The disk is a book.
A partition is a chapter.
The file system is the writing style inside the chapter.
Wrap-Up
Adding a new disk to Linux might sound like a big job, but once you try it, it feels pretty natural. It’s like building a new shelf in your room — just follow the steps, and you’ll have more space in no time.
Here’s a quick checklist:
- Check the new disk with
lsblk
- Partition it with
fdisk
- Format it with
mkfs.ext4
- Create a mount point
- Mount it
- Add it to
/etc/fstab
Have you tried adding a new disk to your Linux system yet? If not, now’s a good time to learn. And if your computer says, “I need more room,” you’ll know just what to do.