Create /dev/md* device file if missing when creating a RAID set
authorJamie Cameron <jcameron@webmin.com>
Wed, 30 Jan 2008 20:31:02 +0000 (20:31 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 30 Jan 2008 20:31:02 +0000 (20:31 +0000)
raid/CHANGELOG
raid/raid-lib.pl

index 4f56060..f938ee9 100644 (file)
@@ -14,3 +14,4 @@ Added a section for configuring RAID problem notification when using MDADM.
 ---- Changes since 1.390 ----
 Converted all pages to use the new Webmin UI library, for a more consistent look.
 Added a confirmation page before deleting a RAID array.
+Create /dev/md* device file if missing when creating a RAID set.
index c8ea3e0..e111ddd 100644 (file)
@@ -269,6 +269,10 @@ else {
 # Call mkraid or mdadm to make a raid set for real
 sub make_raid
 {
+if (!-r $_[0]->{'value'} && $_[0]->{'value'} =~ /\/md(\d+)$/) {
+       # Device file is missing - create it now
+       &system_logged("mknod $_[0]->{'value'} b 9 $1");
+       }
 if ($raid_mode eq "raidtools") {
        # Call the raidtools mkraid command
        local $f = $_[1] ? "--really-force" : "";