Hi James:

There would be quite a bit of work to do there. It looks like the code for this is all in-line, and not set up as a function call.

Rafiu: can I submit patches against the 2.1 beta 1 code for x86_64 for this? Or has the CVS head moved far from that?

Joe

LeRoy, James wrote:
If we have one, can we get the other volume management pages updated
with the TB reporting as well?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joe
Landman
Sent: Monday, November 06, 2006 12:32 PM
To: [email protected]
Subject: [OF-users] patch to do several things

Hi OF-team:

   Here is a patch to do several things:

1) report/use TB for large volumes
2) include chunk size in RAID building (defaulting at 64k).

I needed the latter, and the former is merely a housekeeping detail. With this, one of our arrays looks like this now:

Array Level Array Size Device Size State Synchronization Manage Add Used In Delete
/dev/md0        RAID-0  24.56 TB        0 bytes         Clean
Synchronized View members All RAID partitions are used Unknown / unused Delete

as compared to 24560.00 GB.  I think the former is nicer than the
latter.

Without further ado, this is the patch (against volumes_raidmanager.html
from the 2.1 x86_64 beta 1).  Also as an attachment.



======8><=================================================



--- volumes_raidmanage.html.original    2006-11-06 10:13:27.211598246
-0500
+++ volumes_raidmanage.html     2006-11-06 13:19:50.555642069 -0500
@@ -219,7 +219,7 @@
                 $member_count = 0;
                 $spare_devices = "";
                 $spare_count = 0;
-
+               $chunk_size     = ${"chunksize"};
                 $devices_ok = TRUE;

for ($part_index = 0; $part_index < count($of_disks); $part_index++)
@@ -278,9 +278,9 @@
                         if (!$found)
                         {
                                 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 /dev/md" . $i . " --level=" . intval($level) . " --raid-devices=" . $member_count . " --spare-devices=" . $spare_count . " --chunk=". $chunk_size . " " . $member_devices . $spare_devices ."> /tmp/out1 2> /tmp/out2");
                                 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 /dev/md" . $i . " --level=" . intval($level). " --chunk=". $chunk_size . " " . " --raid-devices=" . $member_count . " " . $member_devices . " > /tmp/out1 2> /tmp/out2 " );

sleep(2); // Give a couple of seconds for the RAID device to become active

@@ -355,8 +355,10 @@

$part_size = ($of_disks[$i]["blocksize"] *
$of_disks[$i]["partitions"][$j]["blocks"]);

-                                                       if ($part_size >

(1024 * 1024 * 1024))
- $part_size_string = sprintf("%.02f GB", ($part_size / (1024 * 1024 * 1024.0)));
+                                                       if ($part_size >

(1024 * 1024 * 1024 * 1024.0))
+ $part_size_string = sprintf("%.02f TB", ($part_size / (1024 * 1024 * 1024.0 * 1024.0))); + else if ($part_size > (1024 * 1024 * 1024 )) + $part_size_string = sprintf("%.02f GB", ($part_size / (1024 * 1024 * 1024.0))); else if ($part_size > (1024 * 1024)) $part_size_string = sprintf("%.02f MB", ($part_size / (1024 * 1024.0))); else if ($part_size > (1024))
@@ -491,7 +493,9 @@
print("<td bgcolor=\"" . $dvalue . "\" align=\"center\">RAID-" . $md[$i]["level"] . "</td>\n");
                         $part_size = $md[$i]["array_size"];

-                       if ($part_size > (1024 * 1024 * 1024))
+                       if ($part_size > (1024 * 1024 * 1024 * 1024))
+                                $part_size_string = sprintf("%.02f TB",

($part_size / (1024 * 1024 * 1024.0 * 1024.0)));
+                       else if ($part_size > (1024 * 1024 * 1024))
                                 $part_size_string = sprintf("%.02f GB",

($part_size / (1024 * 1024 * 1024.0)));
                         else if ($part_size > (1024 * 1024))
                                 $part_size_string = sprintf("%.02f MB",

($part_size / (1024 * 1024.0)));
@@ -504,7 +508,9 @@

                         $part_size = $md[$i]["device_size"];

-                       if ($part_size > (1024 * 1024 * 1024))
+                       if ($part_size > (1024 * 1024 * 1024 * 1024))
+                                $part_size_string = sprintf("%.02f TB",

($part_size / (1024 * 1024 * 1024.0 * 1024.0)));
+                       else if ($part_size > (1024 * 1024 * 1024))
                                 $part_size_string = sprintf("%.02f GB",

($part_size / (1024 * 1024 * 1024.0)));
                         else if ($part_size > (1024 * 1024))
                                 $part_size_string = sprintf("%.02f MB",

($part_size / (1024 * 1024.0)));
@@ -645,11 +651,12 @@
                 print("<div align=\"center\">\n");
print("<table cellpadding=\"8\" cellspacing=\"2\" border=\"0\">\n");
                 print("<tr>\n");
- print("\t<td colspan=\"5\" bgcolor=\"" . $GLOBALS["color_table_heading"] . "\" align=\"center\"><strong>Select RAID array type</strong></td>\n"); + print("\t<td colspan=\"4\" bgcolor=\"" . $GLOBALS["color_table_heading"] . "\" align=\"center\"><strong>Select RAID array type</strong></td>\n"); + print("\t<td colspan=\"1\" bgcolor=\"" . $GLOBALS["color_table_heading"] . "\" align=\"center\"><strong>Select chunk size</strong></td>\n");
                 print("</tr>\n");

                 print("<tr>\n");
- print("\t<td colspan=\"5\" bgcolor=\"" . $GLOBALS["color_table_row1"] . "\" align=\"center\">\n"); + print("\t<td colspan=\"4\" bgcolor=\"" . $GLOBALS["color_table_row1"] . "\" align=\"center\">\n"); print("\t<select onchange=\"add_changed()\" name=\"level\">\n"); print("\t\t<option value=\"0\">RAID-0 (striped)</option>\n"); print("\t\t<option value=\"1\">RAID-1 (mirrored)</option>\n");
@@ -657,7 +664,24 @@
print("\t\t<option value=\"6\">RAID-6 (extra-parity)</option>\n"); print("\t\t<option value=\"10\">RAID-10 (mirrored + striped)</option>\n");
                 print("\t</select>\n");
-               print("</td>\n");
+               print("</td>\n<center>chunk size</center>");
+
+ print("\t<td colspan=\"1\" bgcolor=\"" . $GLOBALS["color_table_row1"] . "\" align=\"center\">\n"); + print("\t<select onchange=\"add_changed()\" name=\"chunksize\">\n");
+                print("\t\t<option value=\"4\">4 kB</option>\n");
+                print("\t\t<option value=\"8\">8 kB</option>\n");
+                print("\t\t<option value=\"16\">16 kB</option>\n");
+                print("\t\t<option value=\"32\">32 kB</option>\n");
+ print("\t\t<option value=\"64\" selected >64 kB</option>\n");
+                print("\t\t<option value=\"128\">128 kB</option>\n");
+                print("\t\t<option value=\"256\">256 kB</option>\n");
+                print("\t\t<option value=\"512\">512 kB</option>\n");
+                print("\t\t<option value=\"1024\">1M </option>\n");
+                print("\t\t<option value=\"2048\">2M</option>\n");
+                print("\t\t<option value=\"4096\">4M</option>\n");
+                print("\t</select>\n");
+                print("</td>\n");
+
                 print("</tr>\n");

                 print("<tr>\n");
@@ -694,8 +718,9 @@
                                         }

$part_size = ($of_disks[$i]["blocksize"] *
$of_disks[$i]["partitions"][$j]["blocks"]);
-
- if ($part_size > (1024 * 1024 * 1024)) + if ($part_size > (1024 * 1024 * 1024 * 1024)) + $part_size_string = sprintf("%.02f TB", ($part_size / (1024 * 1024 * 1024.0 * 1024.0))); + else if ($part_size > (1024 * 1024 * 1024)) $part_size_string = sprintf("%.02f GB", ($part_size / (1024 * 1024 * 1024.0))); else if ($part_size > (1024 * 1024)) $part_size_string = sprintf("%.02f MB", ($part_size / (1024 * 1024.0)));


--
Joseph Landman, Ph.D
Founder and CEO
Scalable Informatics LLC,
email: [EMAIL PROTECTED]
web  : http://www.scalableinformatics.com
phone: +1 734 786 8423
fax  : +1 734 786 8452
cell : +1 734 612 4615
_______________________________________________
Openfiler-users mailing list
[email protected]
https://lists.openfiler.com/mailman/listinfo/openfiler-users

Reply via email to