I first asked this question on SuperUser.com but got no responses. I have found how to align the partition of my SSD using fdisk (SSD article on Gentoo Wiki) but haven't been able to find any resources about aligning the partitions of a HDD. Is this practice necessary, or should I just let something like GPartEd align them as default? If it's something I should do to the HDD as well, where can I find a resource for the size to use for the sector and head portion of the command?
If you are using the old fdisk program these days, always use the
My opinion, simply make all your partitions start/end on 1MB boundaries. So the starting sector should be evenly divisible be 2048. By simply aligning everything to the nearest 1MB, you are aligned drives with 512, and 4096 physical sectors, you are also properly aligned for typical RAID(5,6) chunk sizes of 32k, 64k, 512, 1mb.
For future Googlers, I've found this article on the Arch Linux wiki that answers this question: "Advanced Format". As it turns out, there are a couple tools you can use to determine the sector size on your disk (smartmontools and hdparm). See the article for more information.
I can put an example where align to cylinders is needed, but i don know why on the hell i really need that align?
What i want: Boot an UEFI system with Grub2 and SystemRescueCD.iso loop.
Boot medium: USB strick, i have two usb sticks, 2GiB (align to MiB works) and 8GiB (align to MiB fail on physical machine but works on VirtualBOX, at physical PC boot time it does not see/list it as a bootable EFI; align to cylinders makes on such physical PC to see it and can boot from it).
My observations are:
For testing all the cases i do exactly the same steps (all in console mode):
What i get is:
Why on the hell that occurs? i have no idea.
P.D.: I had tested a lot of usb sticks (more than ten), usb hdds (more than 5), etc... align to 1MiB on most of them allways works well, but i found than on the 8GiB LG USB stick it does not allways work well, it requieres to work to be aligned to cylinders. Media has no deffects, just in case someone could think about that as the cause.
P.P.D.: I had also seen that such physical pc has something really weird (random behavior on boot when using ctrl+alt+del), if i reboot it by pressing ctrl+alt+del at screen menu where i select where to boot from, that makes such 8GiB usb stick to not be listed sometimes while others it is listed (when it was created with align to cylinders), but if is is align to MiB it neves get listed.
In modern hard drives, partition alignment is really almost mythical. We began using virtual geometry for these devices in BIOS years ago to overcome obstacles in DOS addressing schemes that were reliant on hardware conforming to standards. FDISK/CFDISK/GPartEd, etc, will all "cylinder align" your partitions by default, meaning they will start and stop partitions at the first unallocated cylinder position. I know that PARTED will allow you to specify the size of a partition in sectors, but I can't think of any practical reason with modern hardware to do this. Unless you have a specific requirement in mind, stick with cylinder alignment, it's clean and predictable.
Do you have a specific reason you wanted to do this?
In regards to aligning SSD partitions, I will have to read the article you've linked... but since SSDs don't really have heads, or cylinders, or tracks, I can't imagine a reason why you'd want to align partitions on them.