Allow empty raw disk to be RAID members
authorJamie Cameron <jcameron@webmin.com>
Tue, 11 Aug 2009 06:24:49 +0000 (23:24 -0700)
committerJamie Cameron <jcameron@webmin.com>
Tue, 11 Aug 2009 06:24:49 +0000 (23:24 -0700)
raid/CHANGELOG
raid/raid-lib.pl

index f06ef7b..666a593 100644 (file)
@@ -20,3 +20,5 @@ Added a button for changing the number of active devices in a RAID 5 or 6 set, t
 ---- Changes since 1.470 ----
 Added an option to the RAID 1 creation form to mark one of the disks as missing initially.
 Run the update-initramfs -u command after changing mdadm.conf, to sync it into any ramdisk for use at boot time.
+---- Changes since 1.480 ----
+Raw disks with no partitions can now also be used as RAID members.
index 926724b..e7c6e75 100755 (executable)
@@ -538,6 +538,13 @@ foreach $d (&fdisk::list_disks_partitions()) {
                                $d->{'cylsize'} ? " (".&nice_size($d->{'cylsize'}*($p->{'end'} - $p->{'start'} + 1)).")" :
                                " ($p->{'blocks'} $text{'blocks'})") ]);
                }
+       if (!@{$d->{'parts'}} &&
+           !$used{$d->{'device'}} && !$skip{$d->{'device'}}) {
+               # Raw disk has no partitions - add it as an option
+               push(@disks, [ $d->{'device'},
+                              $d->{'desc'}.
+                              ($d->{'cylsize'} ? " (".&nice_size($d->{'cylsize'}*$d->{'cylinders'}).")" : "") ]);
+               }
        }
 foreach $c (@$conf) {
        next if (!$c->{'active'} || $used{$c->{'value'}});