From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 448331FF183 for ; Wed, 16 Jul 2025 15:25:00 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 72C7A1258A; Wed, 16 Jul 2025 15:26:06 +0200 (CEST) From: Shannon Sterz To: pve-devel@lists.proxmox.com Date: Wed, 16 Jul 2025 15:25:57 +0200 Message-Id: <20250716132557.237727-1-s.sterz@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.021 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH installer] gui: don't assume 'single' btrfs mode if user selects exactely 1 disk X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" assuming 'single' mode if the user selects exactely one disk can lead to unexpected results. for example, if a user sets up a raid10 with one disk, the installer will happily install it as a 'single' install. doing the same with two disks fails with an error that for raid10 at least 4 disks are required. this is also inconsistent with the tui installer that will always complain about the amount of disks not being correct. Signed-off-by: Shannon Sterz --- Proxmox/Install.pm | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm index 1689097..3159dcc 100644 --- a/Proxmox/Install.pm +++ b/Proxmox/Install.pm @@ -363,20 +363,16 @@ sub get_btrfs_raid_setup { my $mode; - if ($diskcount == 1) { - $mode = 'single'; + if ($filesys eq 'btrfs (RAID0)') { + $mode = 'raid0'; + } elsif ($filesys eq 'btrfs (RAID1)') { + die "$filesys: need at least 2 devices\n" if $diskcount < 2; + $mode = 'raid1'; + } elsif ($filesys eq 'btrfs (RAID10)') { + die "$filesys: need at least 4 devices\n" if $diskcount < 4; + $mode = 'raid10'; } else { - if ($filesys eq 'btrfs (RAID0)') { - $mode = 'raid0'; - } elsif ($filesys eq 'btrfs (RAID1)') { - die "$filesys: need at least 2 devices\n" if $diskcount < 2; - $mode = 'raid1'; - } elsif ($filesys eq 'btrfs (RAID10)') { - die "$filesys: need at least 4 devices\n" if $diskcount < 4; - $mode = 'raid10'; - } else { - die "unknown btrfs mode '$filesys'\n"; - } + die "unknown btrfs mode '$filesys'\n"; } return ($devlist, $mode); -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel