From: Fabian Ebner Date: Fri, 16 Apr 2021 10:34:50 +0000 (+0200) Subject: diskmanage: improve setting usage for whole disk with include-partitions X-Git-Url: https://git.proxmox.com/?p=pve-storage.git;a=commitdiff_plain;h=415dc3985dfbd6ed6b2da73a41a3c96260eba9fd diskmanage: improve setting usage for whole disk with include-partitions in case a disk with partitions also has an fstype set, which happens for our ZFS boot disks. Do not change the behavior without include-partitons, as we prefer(red) to be more specific than simply 'partitions' then. Reported in the enterprise support channel. Signed-off-by: Fabian Ebner --- diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm index 64bb813..853d333 100644 --- a/PVE/Diskmanage.pm +++ b/PVE/Diskmanage.pm @@ -713,6 +713,9 @@ sub get_disks { next if $partitions->{$part}->{used} eq 'partition'; $used //= $partitions->{$part}->{used}; } + } else { + # fstype might be set even if there are partitions, but showing that is confusing + $used = 'partitions' if scalar(keys %{$partitions}); } $used //= 'partitions' if scalar(keys %{$partitions}); # multipath, software raid, etc.