Summary: | <sys-apps/util-linux-2.17 - fdisk includes an extra sector when specifying a specific partition size | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Richard <shiningarcanine> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Richard
2010-05-19 23:19:18 UTC
I believe fdisk expert mode is what you want: http://lwn.net/Articles/377956/ Agreed that this is not exactly a user-friendly solution, but I've heard upstream partitioning tools are improving with respect to support for SSD alignment... so upcoming versions will hopefully be more convenient. (In reply to comment #1) > I believe fdisk expert mode is what you want: > http://lwn.net/Articles/377956/ > > Agreed that this is not exactly a user-friendly solution, but I've heard > upstream partitioning tools are improving with respect to support for SSD > alignment... so upcoming versions will hopefully be more convenient. > I manually calculate the sector numbers for the partitions and enter them in place of partition sizes as a workaround. Looks like it's fixed in 2.17. Quoting from util-linux-ng-2.17.2/docs/v2.17-ReleaseNotes: fdisk: - the fdisk command aligns newly created partitions to minimum_io_size boundary ("minimum_io_size" is physical sector size or stripe chunk size on RAIDs). but I will leave it to others to either deny or confirm this. You could try yourself, of course. (In reply to comment #3) > Looks like it's fixed in 2.17. Quoting from > util-linux-ng-2.17.2/docs/v2.17-ReleaseNotes: > > fdisk: > - the fdisk command aligns newly created partitions to minimum_io_size > boundary ("minimum_io_size" is physical sector size or stripe chunk > size on RAIDs). > > but I will leave it to others to either deny or confirm this. You could try > yourself, of course. > I looked around in fdisk and noticed something about a "dos compatibility" mode. Toggling it off makes fdisk a Windows 7-style partitioning utility. Unfortunately, that means that the first partition must start no earlier than sector 2048. There is no technical reason to start the first partition at sector 2048 instead of sector 1024, and ideally it should be sector 1024, but under the Windows 7-style partitioning mode, this is impossible. Using the default dos compatibility mode allows you do it, but it still has the nonsensical behavior I reported in the first place, which at this point, appears to be a legacy implementation from MS-DOS, even though doing it that way would have been the wrong way to do things back then. I suppose that something being nonsensical would never stop Microsoft from implementing math errors in its programs. Anyway, the original issue where partitions were being extended a sector is no longer present when the dos compatibility mode is toggled off. The fact that this behavior was changed by matching the behavior of Windows 7 is an issue in itself because strictly speaking, Windows 7 does not partition the disks properly by starting the first partition at sector 2048 instead of sector 1024. That is not as egregious an issue as having the partitions misaligned, but it is not strictly correct because it wastes space. The amount of wasted space (512KB) is not significant enough to warrant keeping this bug open, so I will mark it fixed, although I might file a bug with upstream about this in the near future. (In reply to comment #4) > That is not as egregious an issue as having the partitions misaligned, but it > is not strictly correct because it wastes space. The amount of wasted space > (512KB) is not significant enough to warrant keeping this bug open, so I will > mark it fixed, although I might file a bug with upstream about this in the near > future. Richard if you do file that, please ask upstream to make the alignment configurable. Windows7 is using 1MiB alignment as that's the largest erase block size known on SSDs. However most SSDs are on 128/256/512KiB. As far as I know, no SSDs are using 1MB erase blocks at this time. Do you know of any particular models that contradict this? |