fdisk partition alignment stuff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!

I have three different behaviour questions regarding alignment (I've confirmed 
the behaviour with git master and a test file):

First, if I create a new partition on an empty device, fdisk appropriately 
uses 1MB offset from beginning by default:
"First sector (2048-10239999, default 2048):"

However, shouldn't it still allow using a lower starting sector, even if not 
selected by default? Like this:
"First sector (63-10239999, default 2048):"

Or is the intent to protect against users messing up the alignment, and users 
should use dos compatibility mode to avoid the limitation? I guess I would be 
ok with that :)

Ok, I then create the primary partition starting in sector 2048 and and select 
partition size '+5500K' for a 5,5MB partition:
      Device Boot      Start         End      Blocks   Id  System
/dev/loop0p1            2048       13047        5500   83  Linux

Looks ok. Now, when I ask fdisk to create another partition, fdisk offers to 
start it immediately after the end of the previous partition:
"First sector (13048-10239999, default 13048):"
Is it intended that fdisk doesn't align the default value to 14336?
I've gotten bitten by this several times and I've created unaligned partitions 
on 4k sector devices.
I.e. what I would've expected:
"First sector (13048-10239999, default 14336)":

Thirdly, I create an extended partition with one logical partition as follows:
      Device Boot      Start         End      Blocks   Id  System
/dev/loop0p1            2048       13047        5500   83  Linux
/dev/loop0p2           13048       14335         644   83  Linux
/dev/loop0p3           14336    10239999     5112832    5  Extended
/dev/loop0p5           16384       65534       24575+  83  Linux

Now, I wish to add another logical partition:

"First sector (67583-10239999, default 67583):"

fdisk suggests 67583 as the starting point, which is exactly 1MB after the end 
of the previous logical partition, but in no way aligned. Why is there such an 
offset, and why does it happen only with logical partitions?
I would've expected:
"First sector (65535-10239999, default 65536):"

Thanks in advance for any explanations,
-- 
Anssi Hannula
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux