Sergio Navarro i Fajardo wrote:
Hi of-team,

I've found some problems when creating raid1 devices.
1) the second raid1 device can't be created because no device exists. 2) If we add HD's which used to part of an old raid, it is not possible to create a raid1 device with them.

mdadm: /dev/sda1 appears to be part of a raid array:
    level=raid1 devices=2 ctime=Tue Nov  7 12:13:19 2006
mdadm: /dev/sdb1 appears to be part of a raid array:
    level=raid1 devices=2 ctime=Tue Nov  7 12:13:19 2006
Continue creating array? mdadm: create aborted.
  /dev/md0: Size must exceed minimum of 1024 sectors.
  Failed to setup physical volume "/dev/md0"
sh: 1: Permission denied

I've written down a patch.
*https://lists.openfiler.com/pipermail/openfiler-users/2006-November/002073.html :)*

Sweet. Many thanks. Applied.

R.

My regards
------------------------------------------------------------------------

--- volumes_raidmanage.html.orig        2006-11-07 10:20:23.000000000 +0100
+++ volumes_raidmanage.html     2006-11-07 16:11:17.000000000 +0100
@@ -277,10 +277,15 @@
if (!$found)
                        {
+                               # prevent old superblock error
+                               foreach ( split(" ",$member_devices) as $smd ) {
+                                       exec("/usr/bin/sudo /sbin/mdadm 
--zero-superblock " . $smd);
+                               }
+
                                if ($spare_count > 0)
-                                       exec("/usr/bin/sudo /sbin/mdadm --create /dev/md" . $i . " --level=" 
. intval($level) . " --raid-devices=" . $member_count . " --spare-devices=" . $spare_count . " " . 
$member_devices . $spare_devices);
+                                       exec("/usr/bin/sudo /sbin/mdadm --create --auto=md /dev/md" . $i . " 
--level=" . intval($level) . " --raid-devices=" . $member_count . " --spare-devices=" . $spare_count . 
" " . $member_devices . $spare_devices);
                                else
-                                       exec("/usr/bin/sudo /sbin/mdadm --create /dev/md" . $i . " 
--level=" . intval($level) . " --raid-devices=" . $member_count . " " . $member_devices);
+                                       exec("/usr/bin/sudo /sbin/mdadm --create --auto=md /dev/md" . $i . 
" --level=" . intval($level) . " --raid-devices=" . $member_count . " " . 
$member_devices);
                                        
                                sleep(2);       // Give a couple of seconds for 
the RAID device to become active
                                
------------------------------------------------------------------------

_______________________________________________
Openfiler-users mailing list
[email protected]
https://lists.openfiler.com/mailman/listinfo/openfiler-users

_______________________________________________
Openfiler-users mailing list
[email protected]
https://lists.openfiler.com/mailman/listinfo/openfiler-users

Reply via email to