]> git.proxmox.com Git - pve-installer.git/commit
fix #1211: allow install on 4kn disks
authorStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 27 Nov 2019 16:06:57 +0000 (17:06 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 27 Nov 2019 18:15:26 +0000 (19:15 +0100)
commit5ea943cf82901e77acb66661f636ba03ce771404
tree645808976198dba954512b91501827044ecaa669
parent5ff5a8d03c709a67eadff8a5f7eb75aca5bb682d
fix #1211: allow install on 4kn disks

Installation on disks with 4k logical blocksize (4kn) failed, because
the bios_boot (a.k.a. gdisk partitiontype EF02, place for grub in
legacy BIOS boot mode) partition is created using start and end
sectors (and sector 2047 is not at 1M, where the ESP starts)

This patch addresses the issue by not creating the bios_boot
partition on 4kn disks at all - legacy boot from 4kn disks is not
supported by most BIOS implementations and grub does not support it
[0].

Checks for 4kn disks, when booted in legacy mode are added, and
prevent from leaving the harddisk selection page, if an not bootable
selection was made.

The partition numbering was kept (esp is partition 2, data is
partition 3, for consistency with other installations)

If any of the bootable disks is 4kn then the installation of the grub
legacy installation is skipped altogether.

Additionally the invocation of mkfs.vfat needs to add the parameter
'-s1' to create a bootable ESP on 4kn disks.
For a 512M vfat partition on a 512n or 512e disk, mkfs.vfat
calculates a default value of 8 sectors per cluster. For a 512M
partition on a 4kn disk, we need to scale this by 512/4096=8 and
explicitly set '-s' to 1 accordingly, since the calculation in
mkfs.vfat is brokenly assuming 512b sectors[1].

Tested with a qemu-machine by passing
'logical_block_size=4096,physical_block_size=4096' to the disk's device lines
and installing in UEFI and legacy booted mode:
* ZFS RAIDZ1
* ZFS single-disk
* ZFS RAID10 (in legacy mode grub fails to install, if any 4kn disk is in the
  pool, even if it's not in the first vdev)
* EXT4

[0] http://savannah.gnu.org/bugs/?46700
[1]: https://github.com/dosfstools/dosfstools/issues/111

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxinstall