Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
Could you define what you mean by align, align to/for what? –  mdpc Aug 16 '13 at 16:07
    
From here: "...Linux' fdisk, however, still uses a virtual C-H-S system where you can define any number of heads and sectors yourself (the cylinders are calculated automatically from the drive's capacity), with partitions always starting and ending at intervals of heads x cylinders. Thus, you need to choose a number of heads and sectors of which the SSD's erase block size is a multiple." This specifically refers to SSDs. I am asking about HDDs. –  Jonathan Landrum Aug 16 '13 at 16:20
add comment

3 Answers

up vote 2 down vote accepted

If you are using the old fdisk program these days, always use the -uc which will display sectors instead of cylinders, and disable compatibility with MS-DOS.

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.

share|improve this answer
add comment

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.

share|improve this answer
    
Please do not post an answer that's essentially a link. Include the relevant information in your post (e.g. the smart and hdparm command lines and what they do). Leave the link for reference, but it must not be necessary to follow it to get an answer to the question. For more answer writing tips, see How to Answer. –  Gilles Aug 17 '13 at 20:26
add comment

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.

share|improve this answer
    
Modern drives have no alignment on cylinders (cylinders as reported to software are pure fiction), but they do have alignment on sectors. –  Gilles Aug 17 '13 at 20:25
    
I believe I qualified the comment adequately regarding that in the first two sentences. Further, the utilities that I referenced which include the one originally asked about, default to CHS addressing. "Cylinder align" was used in quotes, and the explanation of why it's okay to use it was still valid. I don't feel a down-vote was warranted in this case. –  James Brandon Aug 26 '13 at 17:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.