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

Bug#775683: Selection of potential LVM devices also lists alignment gap artifacts



Package: partman-lvm
Version: 103
Severity: important
Tags: d-i patch

Similar to #775567 for partman-md, partman-lvm can be thrown by small
alignment artifacts and end up confusingly also listing lots of block
devices which are actually too small to be valid.

A simple fix is to simply not show block device objects that are too
small, i.e. less than 4MB in size. Trivial patch included here, and
I'll check this into git shortly as soon as I get a bug number for the
changelog. :-)

diff --git a/lib/lvm-base.sh b/lib/lvm-base.sh
index 656893a..f5bc221 100644
--- a/lib/lvm-base.sh
+++ b/lib/lvm-base.sh
@@ -209,7 +209,7 @@ pv_allowed () {
        if [ $lvm = no ]; then
                local fs
                open_dialog PARTITION_INFO $id
-               read_line x1 x2 x3 x4 fs x6 x7
+               read_line x1 x2 size x4 fs x6 x7
                close_dialog
                if [ "$fs" = free ]; then
                        # parted can't deal with VALID_FLAGS on free space
@@ -237,6 +237,12 @@ pv_allowed () {
                fi
        fi
 
+       # Don't list devices that are too small (less than 4MB),
+       # they're most likely alignment artifacts
+       if [ $size -lt 4194304 ]; then
+               lvm=no
+       fi
+
        [ $lvm = yes ]
 }
 


-- System Information:
Debian Release: 7.8
  APT prefers stable
  APT policy: (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash


Reply to: