Quay lại Ubuntu

Linux Mount Point Creation & Storage Allocation Explained for Beginners

Sakshi Gautam· 23/5/2026

Mô tả

#devopsengineer 
#devopsmadeeasy 
#linux
#commands  


How to Create Mount Point and Allocate Storage in

• Checking available disks
• Creating partitions
• Formatting disks
• Mounting storage
• Making the mount permanent

Step 1 — Check Available Disks
First, we need to check which disks are available in the system.
For that, we use the lsblk command.
This command lists all block storage devices connected to the machine.
Command
lsblk

Step 2 — Create a New Partition
Now we’ll create a partition on the new disk using the fdisk utility.
Command
sudo fdisk /dev/sdb
Inside fdisk:
• Press n to create a new partition
• Select p for primary partition
• Press Enter for default partition number
• Press Enter again for default start sector
• Press Enter again for full disk usage
• Finally press w to write changes”



Step 3 — Verify the Partition
Command
lsblk
Now we can see a new partition called /dev/sdb1.
That means the partition creation was successful.

Step 4 — Create Filesystem
Before using the partition, we must create a filesystem on it.
Here we’ll use the EXT4 filesystem, which is commonly used in Linux.
Command
sudo mkfs.ext4 /dev/sdb1

Step 5 — Create Mount Point
A mount point is simply a directory where the storage device will be attached.
Command
sudo mkdir -p /mnt/data
Verify
ls -ld /mnt/data

Step 6 — Mount the Filesystem 
Command
sudo mount /dev/sdb1 /mnt/data
Verify
df -h /mnt/data
• The filesystem size
• Available space
• Mount location
This confirms the storage is mounted successfully.

Step 7 — Make Mount Permanent
Currently, the mount will disappear after reboot.
To make it permanent, we add an entry in the /etc/fstab file.
Command
sudo nano /etc/fstab
Add This Line
/dev/sdb1   /mnt/data   ext4   defaults   0   2
This tells Linux to automatically mount the filesystem during boot.

Step 8 — Verify Permanent Mount
Command
sudo mount -a
This command checks for errors in the fstab configuration.
Verify Again
df -h /mnt/data
If no errors appear and the filesystem is visible, the configuration is correct.

Step 9 — Test the Storage
Commands
sudo touch /mnt/data/testfile.txt
echo "Mount point and storage allocation successful!"  /mnt/data/testfile.txt
cat /mnt/data/testfile.txt
If the file is created and readable, the storage setup is working perfectly.