Making GPT Partition Table and Creating Partitions with parted on Linux

My best favorite disk partition table manipulation tools are cfdisk/fdisk on Linux. However, for large disks, cfdisk/fdisk will just give up with a message suggesting GPT partition table format and using GNU parted like

WARNING: The size of this disk is 6.0 TB (6001042391040 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID 
partition table format (GPT).

If you continue using fdisk/cfdisk, you will only create msdos partition table and use only less than 2TB space.

However, the parted‘s interface is not that easy to use at the first try. After some struggling with parted, I finally make a partition on the new 6TB RAID 0 storage array. Here is the process.

pc ~ # parted /dev/sdc
GNU Parted 2.3
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel GPT
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes
(parted) mkpart primary 2048s 100%
(parted) q
Information: You may need to update /etc/fstab.

Why “2048s” is used here? Please check this blog post.

The new partition /dev/sdc1 is created:

pc ~ # ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4  /dev/sda5  /dev/sdb  /dev/sdb1  /dev/sdc  /dev/sdc1

Check the information again:

pc ~ # parted /dev/sdc print
Model: ORICO H/ W RAID0 (scsi)
Disk /dev/sdc: 6001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  6001GB  6001GB               primary

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

One comment:

Leave a Reply

Your email address will not be published. Required fields are marked *