#!/usr/local/bin/perl # raid_form.cgi # Display a form for creating a raid device require './raid-lib.pl'; &foreign_require("mount", "mount-lib.pl"); &foreign_require("lvm", "lvm-lib.pl"); &ReadParse(); $conf = &get_raidtab(); # Display headers $max = 0; foreach $c (@$conf) { if ($c->{'value'} =~ /md(\d+)$/ && $1 >= $max) { $max = $1+1; } } &ui_print_header(undef, $text{'create_title'}, ""); $raid = { 'value' => "/dev/md$max", 'members' => [ { 'name' => 'raid-level', 'value' => $in{'level'} }, { 'name' => 'persistent-superblock', 'value' => 1 } ] }; # Find available partitions $disks = &find_free_partitions(undef, 1, 1); if (!$disks) { print "
$text{'create_nodisks'}
\n"; &ui_print_footer("", $text{'index_return'}); exit; } print "
\n"; &ui_print_footer("", $text{'index_return'});