I’ll show how to partition your SSD Vertex disk keeping the desired alignment to SSD erase block size. The following links were useful to point me that align partitions increase the SSD performance and how to complete the first part of the Journey to set up my Ubuntu+MacBook Pro+Vertex SSD.
You would ask me why don’t follow Ted’s post to make my partition table. Basically because I don’t want to use LVM. There is another important difference between our scenes: he has a Intel SSD with 128KB erase block size and I have a OCZ Vetex SSD with 512KB erase block size and of course it makes difference in the calculations.
$ sudo parted
(parted) unit b
The ‘unit’ command is very important because it makes the ‘print’ command show the start/end partition boundaries in bytes (and not in MB, GB or whatever).
This is my current partition table:
Model: ATA OCZ-VERTEX (scsi)
Disk /dev/sda: 128035676160B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 20480B 209735679B 209715200B fat32 EFI System Partition boot
2 209735680B 37656481791B 37446746112B hfs+ Untitled
3 37656985600B 48393879551B 10736893952B ext4 primary boot
4 48393879552B 128035323903B 79641444352B ext4 primary
Now, the very first question: How can I see that the partitions are aligned?
Good one. You just need to ensure that the boundaries can be divided by “erase block size” (EBS). In my case, the Vertex EBS is 512KB (= 512 * 1024B). Getting the 3rd partition as instance: 37656985600 / (512 * 1024) = 71825 (and no rest), so the begining of this partition is aligned.
How did I get this value?
- Get the end boundary of the second partition (37656481791)
- 37656481791 / (512 *1024) = 71824.04
- Get the non-decimal part +1 (71825)
- 71825 *512 * 1024 = 37656985600
So you have the aligned start address of your 3rd partition.
Note that to have a aligned end address, you need to choose a partition size that can be divided by 512KB as well, I’ve chosen 10736893952 (~10GB).
The end address in this case is 37656985600 + 10736893952 – 1 = 48393879551
Below you have the parted command to create the partition:
(parted) mkpart primary 37656985600 48393879551
In the same way I calculated the 4th partition boundaries (/home)
(parted) mkpart primary 48393879552 128035323903
Note that I lost some KB between the 2nd and 3rd partition and at the end of the disk. It’s normal as the second partition is not aligned (maybe MacOS is not prepared to SSD yet?).
I also marked the 3rd partition as bootable:
(parted) toogle 3 boot
And it’s done. The next post will show how to install Ubuntu Jaunty using a customised mkfs.ext4 command.