How to Use Parted for Partition Disk

How to Use Parted for Partition Disk

Sometimes we face issues in fdisk for more than 2TB volume format. In the end, it will ask for gpt error.
Parted is commonly used by sysadmin for volume more than 2 TB but you can use less volume too. Please find the below method how to use parted command :

Step 1- Check disk from lsblk which disk you want to format

#lsblk
explinux-lsblk-output
Here you can see sdb is new disk and not mounted on any mount point or directory. In case of multipath volume, you need to take extra care because sometimes mount point does not show. So compare before and after command output.

Step 2- Run below the command if you want only one partition from that disk 

# parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) unit GB
(parted) mkpart
Partition name?  []? 1
File system type?  [ext2]? ext4
Start? 0%
End? 100%
(parted) set 1 lvm on
(parted) quit

Information: You may need to update /etc/fstab.

how-to-use-parted-command
Now at this point, you have formated disk using parted. Now you have learned how to use the parted command on Linux systems or servers s For more updates subscribe to our blog.

Leave a Comment

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

Scroll to Top