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

Re: How to get installer to align partitions on 4096 byte boundaries?



On May 8, 2014, at 8:01 AM, Henrique de Moraes Holschuh <hmh@debian.org> wrote:

> On Mon, 05 May 2014, Rick Thomas wrote:
>> Bottom line: It doesn't align to 1MiB boundaries. It doesn't even align to 4KiB boundaries.
>> 
>> I think we can do better than that!
> 
> AFAIK, we do for i686 and amd64, unless it somehow got broken since wheezy.
> 
> lvm, md-raid/mdadm, mke2fs and mkfs.xfs were tested to align automatically
> by default in Wheezy.  cfisk, fdisk and gdisk were also tested to align
> properly by default in Wheezy.
> 
> parted is complicated.  It depends on what you tell it to do, and it is easy
> to get it wrong.  The version in wheezy will align properly by default, but
> I believe you must tell it to start a partition at "0%", not "0".  It will
> cheerfully warn you it is doing something stupid, though, so it is just a
> matter of looking at the debugging console of the installer.
> 
> I am not sure how throughoutly the automatic partitioning of the i686/amd64
> wheezy installer was tested, but it did align everything correctly for the
> common usecases.

That fits with my experiments as well,,, On a i386 machine doing the same thing as I described in my previous email gives partitions with precise MiB boundaries.  Obviously some thought went into it, because the Primary partition with the boot stuff in it starts at 2048 sectors (1 MiB) but the Extended partition with the LVM stuff in it starts two sectors before the MiB boundary -- allowing the LVM partition to start on an exact MiB boundary.  Kinda cool, I'm impressed with the forethought that represents!

Here's an example on an i386 VM I had handy:

> rbthomas@jessie:~$ sudo fdisk -lu /dev/sda
> 
> Disk /dev/sda: 34.4 GB, 34359738368 bytes
> 255 heads, 63 sectors/track, 4177 cylinders, total 67108864 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk identifier: 0x00088daf
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sda1   *        2048      499711      248832   83  Linux
> /dev/sda2          501758    67106815    33302529    5  Extended
> /dev/sda5          501760    67106815    33302528   8e  Linux LVM

This gets it exactly right...

However, it seems that nobody looked at the PowerPC.  If they use parted for that, then Henrique's point about it being complicated is probably spot-on.  I'd like to file a bug report, so at least the problem is on the permanent record.

Henrique, can you tell me which package I should file it against?

Thanks!

Rick


Reply to: