From 3cc4e9b45f49fb0b1ea9e65c6910adb4a5297423 Mon Sep 17 00:00:00 2001 From: Daniel Stefan Haischt Date: Thu, 17 Aug 2006 12:11:55 +0000 Subject: bugfixing --- packages/freenas/www/disks_manage_init.php | 180 ++++++++++++++--------------- 1 file changed, 90 insertions(+), 90 deletions(-) (limited to 'packages/freenas/www/disks_manage_init.php') diff --git a/packages/freenas/www/disks_manage_init.php b/packages/freenas/www/disks_manage_init.php index be7ec5f8..3e772de3 100644 --- a/packages/freenas/www/disks_manage_init.php +++ b/packages/freenas/www/disks_manage_init.php @@ -174,100 +174,100 @@ echo $pfSenseHead->getHTML();   - " /> + " /> - '); - ob_end_flush(); - - /* Erase MBR if not checked*/ - - if (!$notinitmbr) { - echo "Erasing MBR\n"; - system("dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . " bs=32k count=640"); - - } - else - echo "Keeping the MBR\n"; - - switch ($type) - { - case "ufs": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - echo "\"fdisk: Geom not found\"is not an error message!\n"; - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - // Create filesystem - system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "s1"); - break; - case "ufs_no_su": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - // Create filesystem - system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "s1"); - break; - case "ufsgpt": - /* Create GPT partition table */ - system("/sbin/gpt destroy " . escapeshellarg($disk)); - system("/sbin/gpt create -f " . escapeshellarg($disk)); - system("/sbin/gpt add -t ufs " . escapeshellarg($disk)); - // Create filesystem - system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "p1"); - break; - case "ufsgpt_no_su": - /* Create GPT partition table */ - system("/sbin/gpt destroy " . escapeshellarg($disk)); - system("/sbin/gpt create -f " . escapeshellarg($disk)); - system("/sbin/gpt add -t ufs " . escapeshellarg($disk)); - // Create filesystem - system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "p1"); - break; - case "gmirror": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - //system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - /* Delete old gmirror information */ - system("/sbin/gmirror clear /dev/" . escapeshellarg($disk)); - break; - case "raid": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - echo "\"fdisk: Geom not found\"is not an error message!\n"; - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - break; - case "msdos": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - echo "\"fdisk: Geom not found\"is not an error message!\n"; - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - // Create filesystem - system("/sbin/newfs_msdos -F 32 /dev/" . escapeshellarg($disk) . "s1"); - break; - } - - echo(''); - } + Disk initialization details:"; + echo('
');
+      					ob_end_flush();
+
+      					/* Erase MBR if not checked*/
+
+      					if (!$notinitmbr) {
+      						echo "Erasing MBR\n";
+      						system("dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . " bs=32k count=640");
+
+      					}
+      					else
+      						echo "Keeping the MBR\n";
+
+      					switch ($type)
+      					{
+      					case "ufs":
+      						/* Initialize disk */
+      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
+      						echo "\"fdisk: Geom not found\" is not an error message!\n";
+      						/* Initialise the partition (optional) */
+      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
+      						/* Create s1 label */
+      						system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
+      						// Create filesystem
+      						system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "s1");
+      						break;
+      					case "ufs_no_su":
+      						/* Initialize disk */
+      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
+      						/* Initialise the partition (optional) */
+      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
+      						/* Create s1 label */
+      						system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
+      						// Create filesystem
+      						system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "s1");
+      						break;
+      					case "ufsgpt":
+      						/* Create GPT partition table */
+      						system("/sbin/gpt destroy " . escapeshellarg($disk));
+      						system("/sbin/gpt create -f " . escapeshellarg($disk));
+      						system("/sbin/gpt add -t ufs " . escapeshellarg($disk));
+      						// Create filesystem
+      						system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "p1");
+      						break;
+      					case "ufsgpt_no_su":
+      						/* Create GPT partition table */
+      						system("/sbin/gpt destroy " . escapeshellarg($disk));
+      						system("/sbin/gpt create -f " . escapeshellarg($disk));
+      						system("/sbin/gpt add -t ufs " . escapeshellarg($disk));
+      						// Create filesystem
+      						system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "p1");
+      						break;
+      					case "gmirror":
+      						/* Initialize disk */
+      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
+      						/* Initialise the partition (optional) */
+      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
+      						/* Create s1 label */
+      						//system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
+      						/* Delete old gmirror information */
+      						system("/sbin/gmirror clear /dev/" . escapeshellarg($disk));
+      						break;
+      					case "raid":
+      						/* Initialize disk */
+      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
+      						echo "\"fdisk: Geom not found\"is not an error message!\n";
+      						/* Initialise the partition (optional) */
+      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
+      						/* Create s1 label */
+      						system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
+      						break;
+      					case "msdos":
+      						/* Initialize disk */
+      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
+      						echo "\"fdisk: Geom not found\"is not an error message!\n";
+      						/* Initialise the partition (optional) */
+      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
+      						/* Create s1 label */
+      						system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
+      						// Create filesystem
+      						system("/sbin/newfs_msdos -F 32 /dev/" . escapeshellarg($disk) . "s1");
+      						break;
+      					}
+
+      					echo('
'); + } ?> -- cgit v1.2.3