Print partition table in bytes:
parted /dev/sdb print
Print partition table in sectors:
parted /dev/sdb unit s print
Print partition table free space in bytes:
parted /dev/sdb print free
Print partition table free space in sectors:
parted /dev/sdb unit s print free
Unlike fdisk
, every parted
command executes in real time. This introduces much more room for human error that could cause data loss. I am not, nor is anyone else, responsible for any potential data loss when using parted
.
First, if needed, create a partition table label:
parted /dev/sdb mklabel gpt
Second, create the primary partition:
parted /dev/sdb mkpart primary 0 100%
After running the above command you will more than likely see the following warning message:
Warning: The resulting partition is not properly aligned for best performance.
To dig into why this occurs, and a possible solution, I suggest you read through how to align partitions for best performance using parted.
However, as suggested in the comments in that blog post, a quicker way to ensure parted
aligns the partition properly is to ensure the START and END parameters in the parted command use percentages instead of exact values.
parted /dev/sdb mkpart primary 0% 100%