Operations 6 min read

Using gdisk to Partition a Large Disk on CentOS and Configure Automatic Mount

This guide explains how to install gdisk on CentOS, create a GPT partition on a new 10 TB data disk, format it, mount it, and set up automatic mounting at boot using the disk's UUID, with step‑by‑step commands and screenshots.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Using gdisk to Partition a Large Disk on CentOS and Configure Automatic Mount

For disks larger than 2 TB you need a GPT partition tool; install gdisk on CentOS 7 with yum install gdisk or on CentOS 6 with yum install gdisk --enablerepo=epel .

Common gdisk commands include -l /dev/sdX to view partitions, ?|m for help, n to create a partition, d to delete, c to change the name, i for detailed info, p to print the table, t to change type, a to toggle bootable, l to list types, o to create a new table, v to verify, q to quit without saving, and w to write changes.

First, list the disks with fdisk -l to identify the new data disk (e.g., /dev/sdc ), then start gdisk on it: gdisk /dev/sdc .

Follow the interactive prompts: press n , choose p for a primary partition, select partition number 1 , accept the default first sector (2048), accept the default last sector, and finally w to write the table.

Synchronize the kernel with partprobe , then format the new partition with mkfs -t ext4 /dev/sdc1 .

Create a mount point, e.g., mkdir /www , and mount the partition: mount /dev/sdc1 /www . Verify the mount with df -TH .

To mount automatically at boot, obtain the partition UUID using blkid /dev/sdc1 , edit /etc/fstab , and add a line such as UUID=your-uuid /www ext4 defaults 0 0 . Save the file, reboot, and confirm the automatic mount with df -TH .

linuxUUIDGPTCentOSmountdisk partitiongdisk
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.