Skip to content

Instantly share code, notes, and snippets.



Created Nov 6, 2014
What would you like to do?
Format 2 TB+ disks using parted (GPT)
# To create a partition start GNU parted as follows:
parted /dev/sdb
# Create a new GPT disklabel i.e. partition table:
mklabel gpt
# Next, set the default unit to TB, enter:
unit TB
# To create a 3TB partition size for example, enter:
mkpart primary 0.00TB 3.00TB
# To print the current partitions, enter:
# Sample outputs:
# Model: ATA ST33000651AS (scsi)
# Disk /dev/sdb: 3.00TB
# Sector size (logical/physical): 512B/512B
# Partition Table: gpt
# Number Start End Size File system Name Flags
# 1 0.00TB 3.00TB 3.00TB ext4 primary
# Quit and save the changes, enter:
# Use the mkfs.ext4 command to format the file system, enter:
mkfs.ext4 /dev/sdb1
# Don't forget to update /etc/fstab or mount the disk
# Source:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment