How to Add and Configure a New Disk on a Linux Server (VMware Example)
This guide walks through the complete process of adding a new disk to a Linux server running on VMware, including disk addition, partitioning, formatting, mounting, and handling disks larger than 2 TB with detailed command examples.
When a Linux server runs out of disk space, a new disk can be added and prepared for use; the procedure consists of four common steps, with the first step differing between virtual and physical machines, demonstrated here on a VMware VM.
(1) Add Disk
Open the virtual machine settings, click Add → Hard Disk , and follow the wizard to attach the new disk.
(2) Disk Partitioning
After adding the disk, use fdisk -l to list devices; the new disk appears as /dev/sdb and must be partitioned before use.
Proceed with partitioning /dev/sdb as shown in the following screenshots.
After partitioning, the result looks like this:
(3) Formatting
Format the created partition to a filesystem using either of the equivalent commands below:
mkfs -t ext3 /dev/sdb
# or
mkfs.ext3 /dev/sdb1(4) Disk Mounting
After mounting, data can be written to the new disk.
(5) Partitioning Disks Larger Than 2 TB
First, install parted and start it on /dev/sdb :
yum install parted -y
parted /dev/sdbConvert the MBR disk to GPT:
(parted) mklabel gptCreate a single partition that uses the whole space (or specify size in TB):
(parted) mkpart primary 0 -1
# or
unit TB
mkpart primary 0 3 # creates a 3 TB primary partitionVerify the partition size:
(parted) printExit parted :
(parted) quitFinally, format the new partition and add it to /etc/fstab for automatic mounting:
mkfs.ext4 -F /dev/sdb1The same steps apply in production environments; most modern disks support hot‑plug, allowing you to add, partition, format, and mount them without downtime.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.