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

Bug#775567: Selection of underlying RAID devices also lists alignment gap artifacts



Package: partman-md
Version: 72
Severity: important
Tags: d-i patch

(Trying to debug #764798, making a big RAID6 with lots of devices.)

partman-md shows all the "FREE SPACE" alignment artifacts when
offering the list of possible RAID members to use for creating a RAID
device. This is clearly silly and annoying, and likely to contribute
to user error when working with a large list of devices (hence tagged
as severity: important).

#558727 alluded to something *similar*, but Frans suggested that only
devices/partitions marked for use as physical RAID devices should be
listed. I don't agree - some people prefer to use raw disk devices
instead of partitions, and while I personally don't like that, it's a
valid choice.

A simple fix is to simply not show block device objects that are too
small, i.e. less than 1MB 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. :-)

I've tested this, and it works nicely...

diff --git a/lib/md-base.sh b/lib/md-base.sh
index 85de95e..6a52a4b 100644
--- a/lib/md-base.sh
+++ b/lib/md-base.sh
@@ -42,7 +42,7 @@ md_allowed () {
        local md=no
        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 as yet,
@@ -68,6 +68,12 @@ md_allowed () {
                close_dialog
        fi
 
+       # Don't list devices that are too small (less than 1MB),
+       # they're most likely alignment artifacts
+       if [ $size -lt 1048576 ]; then
+               md=no
+       fi
+
        [ $md = 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: