Every Linux system administrator must know how to manage disks — from creating partitions to formatting and mounting file systems.In Oracle Linux, these tasks are commonly done using tools like lsblk, fdisk, parted, and mkfs.
In this blog, we’ll walk through how to:
-
Identify disks and partitions
-
Create, format, and mount partitions
-
Use /etc/fstab for persistent mounts
Step 1: Check Existing Disks and Partitions
To list all block devices:
lsblk

To see detailed information:
sudo fdisk -l
Step 2: Identify the Disk to Partition
Find the name of the new or unused disk (for example, /dev/sdb).
Check its size to confirm it’s the correct one:
sudo lsblk /dev/sdb

🧰 Step 3: Create a New Partition Using fdisk
Run:
sudo fdisk /dev/sdb
Then follow the prompts:

Step 4: Format the New Partition
Choose a file system type and format it.
sudo mkfs.xfs /dev/sdb1
To verify:
sudo blkid /dev/sdb1

Step 5: Create a Mount Point
Mount points are directories where you “attach” the new partition.
Example:
sudo mkdir /u01

🔗 Step 6: Mount the Partition
Mount it temporarily:
sudo mount /dev/sdb1 /u01

Verify:
df -h | grep /u01

Step 7: Make the Mount Permanent (via /etc/fstab)
Edit the /etc/fstab file:
sudo vi /etc/fstab
Add a line at the bottom:
/dev/sdb1 /u01 xfs defaults 0 0

Or better — use the UUID (to avoid device name changes):
sudo blkid /dev/sdb1
Example output:

Add this line to /etc/fstab:
UUID=2fca694b-a3b2-4fce-97bc-9688c73e4a94 /data xfs defaults 0 0
Save and test:
sudo mount -a
Step 8: Unmount and Remount a File System
To unmount:
sudo umount /u01
To remount:
sudo mount /u01Step 9: Resize a Partition (Optional)
If using XFS:
sudo xfs_growfs /u01
For EXT4:
sudo resize2fs /dev/sdb1
(Note: The partition must have been expanded first using fdisk or parted.)
Step 10: Check File System Health
Check and repair an EXT4 file system:
sudo e2fsck -f /dev/sdb1
Check an XFS file system:
sudo xfs_repair /dev/sdb1

Conclusion
You now know how to manage disks and file systems on Oracle Linux — from creating partitions to mounting them permanently.
This knowledge is essential for expanding storage, adding new drives, or organizing data efficiently.
In the next post, we’ll explore Logical Volume Management (LVM) — a more flexible way to manage storage dynamically.
