Skip to content

Instantly share code, notes, and snippets.

@ootput
Created December 3, 2014 11:44
Show Gist options
  • Select an option

  • Save ootput/2533388c5f864facc128 to your computer and use it in GitHub Desktop.

Select an option

Save ootput/2533388c5f864facc128 to your computer and use it in GitHub Desktop.
parted for alignment
When asked about start and end we are going to use percentages like so.
(parted) mkpart
Partition name? []? 1
File system type? [ext2]? ext4
Start? 0%
End? 100%
You could also do this from the command line like
sudo parted /dev/sda mkpart primary ext4 0% 100%
Doing this will leave some free space at the start and end of the disk, but it will make sure the partition is properly aligned for best performance.
(parted) print free
Model: ATA SAMSUNG SSD 830 (scsi)
Disk /dev/sda: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
17.4kB 1049kB 1031kB Free Space
1 1049kB 128GB 128GB primary
128GB 128GB 335kB Free Space
One last check for alignment.
(parted) align-check opt 1
1 aligned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment