#!/usr/local/bin/perl # edit_disk.cgi # Display information about a disk, with links to low-level format, # repair and other dangerous options require './format-lib.pl'; $access{'view'} && &error($text{'ecannot'}); &ui_print_header(undef, "Edit Disk", ""); print "
\n"; $d = $ARGV[0]; @dlist = &list_disks(); @dinfo = split(/\s+/, $dlist[$d]); print "\n"; print "\n"; print "
Disk Details
\n"; print "\n"; print "\n"; print "\n"; $dinfo[0] =~ /c(\d+)t(\d+)d(\d+)/; print "\n"; print "\n"; @inq = &disk_info($d); print "\n"; print "
Disk Type: $dinfo[1]
Device: /dev/dsk/$dinfo[0]
SCSI:\n"; print "\n"; print "\n"; print "
Controller $1
Target $2
Unit $3
Vendor:\n"; print "\n"; print "\n"; print "
Name $inq[0]
Product $inq[1]
Revision $inq[2]
\n"; print "
\n"; print "\n"; print "\n"; @plist = &list_partitions($d); for($i=0; $i<@plist; $i++) { @stat = &device_status("/dev/dsk/$dinfo[0]s$i"); if (@stat) { $inuse = 1; } if ($stat[2]) { $mounted = 1; } } print "\n"; print "\n"; print "\n"; } else { print "\n"; } print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Disk Tasks
Format Disk
\n"; if (!$inuse) { print "\n"; print "
Does a low level format of the disk, permanently erasing\n"; print "all data. This is only necessary if the disk has not been\n"; print "formatted by the vendor.
You cannot format this disk because it contains\n"; print "filesystems that are in the system mount list.
Copy Partitions
\n"; print "\n"; print "
Copy the partition map from this disk to other disks. This\n"; print "is useful if you have a large number of disks that need the same\n"; print "partition layout, such as for a MetaDisk array.
\n"; print "

\n"; &ui_print_footer("", "disk list");