top of page

Oracle Linux Basic Administration Series - Part 8 - How to Manage Disk Partitions and File Systems in Oracle Linux

  • Jason Beattie
  • 19 hours ago
  • 2 min read

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
ree

To see detailed information:

sudo fdisk -l

ree


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
ree

🧰 Step 3: Create a New Partition Using fdisk

Run:

sudo fdisk /dev/sdb

Then follow the prompts:


ree


Step 4: Format the New Partition


Choose a file system type and format it.

sudo mkfs.xfs /dev/sdb1

ree

To verify:

sudo blkid /dev/sdb1
ree


Step 5: Create a Mount Point


Mount points are directories where you “attach” the new partition.

Example:

sudo mkdir /u01
ree

🔗 Step 6: Mount the Partition

Mount it temporarily:

sudo mount /dev/sdb1 /u01
ree

Verify:

df -h | grep /u01
ree


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
ree

Or better — use the UUID (to avoid device name changes):

sudo blkid /dev/sdb1

Example output:

ree

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 /u01


Step 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
ree

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.

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Post: Blog2 Post
  • LinkedIn

©2023 Proudly created with Wix.com

bottom of page