public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer 1/2] raid setup: btrfs: do not allow legacy BIOS boot on 4Kn disks
Date: Thu, 10 Aug 2023 12:31:56 +0200	[thread overview]
Message-ID: <20230810103158.436341-2-c.heiss@proxmox.com> (raw)
In-Reply-To: <20230810103158.436341-1-c.heiss@proxmox.com>

This is already checked for LVM and ZFS setups, but not for Btrfs. Add
it there too, as it doesn't work anyway.

Tested by creating a block device with 4K sectorsize using
the following QEMU args:
  -device virtio-blk,drive=testdrive4k,logical_block_size=4096,physical_block_size=4096
  -drive file=/path/to/4k-testdisk.img,if=none,id=testdrive4k

The 4k-testdisk.img was created with:
  qemu-img create -f qcow2 /path/to/4k-testdisk.img 16G

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 Proxmox/Install.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
index 1c4811d..1117fc4 100644
--- a/Proxmox/Install.pm
+++ b/Proxmox/Install.pm
@@ -299,6 +299,10 @@ sub get_btrfs_raid_setup {
     my $diskcount = scalar(@$devlist);
     die "$filesys needs at least one device\n" if $diskcount < 1;
 
+    foreach my $hd (@$devlist) {
+	legacy_bios_4k_check(@$hd[4]);
+    }
+
     my $mode;
 
     if ($diskcount == 1) {
-- 
2.41.0





  reply	other threads:[~2023-08-10 10:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 10:31 [pve-devel] [PATCH installer 0/2] add stricter checks w.r.t. " Christoph Heiss
2023-08-10 10:31 ` Christoph Heiss [this message]
2023-08-10 10:31 ` [pve-devel] [PATCH installer 2/2] tui: disallow legacy BIOS boot from 4Kn disks for all filesystems Christoph Heiss
2023-08-23  8:37 ` [pve-devel] applied-series: [PATCH installer 0/2] add stricter checks w.r.t. BIOS boot on 4Kn disks Wolfgang Bumiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230810103158.436341-2-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal