Re: [Gptfdisk-general] gdisk skip sectors when suggesting the 1st sector of a partition
Brought to you by:
srs5694
From: Rod S. <rod...@ro...> - 2020-08-08 00:20:46
|
On 8/7/20 4:51 PM, u3...@ne... wrote: > All the existing partitions have their first sector immediately following > the last sector of their prior partition. > Why gdisk suggest to start the 8th partition at sector #59424768? The last sector > of the 7th partition is at sector #59422999. > gdisk is 1.0.5. > A non destrcutive read only badblocks -sv doesn't find any badblock. By default, GPT fdisk begins partitions on 2048-sector (1 MiB) boundaries, if the disk uses 512-byte logical sectors (as most do). If the final sector of partition #7 is 59422999, then the next free sector would be 59423000, which is not divisible by 2048, so GPT fdisk won't start a partition there. Instead, it will round up to the next free divisible-by-2048 value, which is 59424768, just as you report. This is done because it optimizes performance on many disk devices. Most modern hard disks use what's called Advanced Format, which uses 4096-byte physical sectors that are broken up into eight 512-byte logical sectors. These require alignment on 8-sector boundaries for optimal performance. Many RAID arrays have requirements to align on 256 KiB, 512 KiB, or similar power-of-two boundaries. SSDs vary a lot in their requirements, but some of them have a power-of-2 optimal alignment, too. A 1 MiB alignment meets all of these technologies' needs for optimal alignment. (There are some oddball SSDs and other configurations that might work better with other types of alignment.) For this reason, most modern partitioning tools align partitions' starts to 1 MiB boundaries. (Partition end points are not important, AFAIK.) If you understand your disk's alignment needs and want to adjust the setting in GPT fdisk, you can do so from the experts' menu with the "l" (lowercase L) option. You can see the current alignment with the "d" option on the experts' menu. For instance, you could set this to 8 if you're using an Advanced Format disk without RAID; or to 1 if you're using a non-Advanced-Format hard disk without RAID. Changing this value will enable you to reclaim a little otherwise lost disk space; but the amount is puny on modern hard disks. Even modern USB flash drives have capacities measured in the tens of GB, so saving under 1 MiB at the start of the disk, or between partitions if they aren't sized to precise multiples of 1 MiB, represents less that 0.1% of the disk's capacity. On a hard disk with a capacity measured in the TB range, the savings would be two or three orders of magnitude less, on a percentage basis. I don't know how you created your existing partitions. You can check for proper alignment (that is, alignment matching GPT fdisk's current setting) via the "v" option in gdisk. It's possible that partition #7 is not properly aligned; or it could simply have a size that's not an exact multiple of 2048 sectors. Changing the alignment would require a tool like GParted, which understands filesystems as well as partitions, and it might or might not be worth the bother depending on the disk type and partition contents. -- Rod Smith rod...@ro... http://www.rodsbooks.com |