Date: Fri, 26 Jun 1998 07:57:55 -0700 From: Josef Grosch <jgrosch@superior.mooseriver.com> To: Frank Terhaar-Yonkers <fty@cisco.com>, freebsd-stable@FreeBSD.ORG Subject: Re: some trick to disklabel ZiP disks? Message-ID: <19980626075755.A8561@mooseriver.com> In-Reply-To: <199806261200.IAA12465@claret.cisco.com>; from Frank Terhaar-Yonkers on Fri, Jun 26, 1998 at 08:00:48AM -0400 References: <199806261200.IAA12465@claret.cisco.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 26, 1998 at 08:00:48AM -0400, Frank Terhaar-Yonkers wrote: > > Shouldn't it be this simple? > If not, pls advise! > > TIA - Frank > ========================== > (toot)~ ->fdisk -i sd1 > ... > Information from DOS bootblock is: > 1: <UNUSED> > 2: <UNUSED> > 3: <UNUSED> > 4: sysid 165,(FreeBSD/NetBSD/386BSD) > start 1, size 196607 (95 Meg), flag 80 (active) > beg: cyl 0/ sector 2/ head 0; > end: cyl 95/ sector 32/ head 63 > Should we write new partition table? [n] y > > (toot)~ ->disklabel -r -w sd1 auto > disklabel: ioctl DIOCSDINFO: No space left on device > Exit 1 > Enclosed is a perl script that formats zip disks. Enjoy! -------------------ENCLOSED-------------------ENCLOSED--------------------- #!/usr/local/bin/perl # # $Id: FsZip.pl,v 1.2 1997/06/20 11:20:16 root Exp $ # use Getopt::Std; use English; # # Init varabales # $base = "sd2"; # Zip device - MUST SET THIS TO YOUR DEVICE !!! $Slice = "sd2c"; # disk slice - MUST SET THIS TO YOUR DEVICE !!! $MountPoint = "/mnt"; # Mount directory $Fs = "/dev/$Slice"; $device = "/dev/$base"; $r_device = "/dev/r$base"; $ScsiFormat = "/sbin/scsiformat"; $Dd = "/bin/dd"; $DiskLabel = "/sbin/disklabel"; $NewFs = "/sbin/newfs"; $Zero = "/dev/zero"; $Mount = "/sbin/mount"; $Umount = "/sbin/umount"; $InitDir = "lost+found"; $mode = "0777"; $mount = 0; $format = 0; $Help = 0; # # Must be root to run this # &ErrorMsg unless ! $UID != 0; # # Commad line options # getopts('fmh'); $mount = 1 unless ! $opt_m == 1; $format = 1 unless ! $opt_f == 1; $Help = 1 unless ! $opt_h == 1; &Usage unless ! $Help == 1; # # Are you sure about this ?? # print "About to place a new filesystem on $device\n"; print "Do you wish to continue ? y or n [n] "; chop($reply = <STDIN>); #exit unless ! $reply ne 'y'; if ($reply ne 'y') { exit; } # # Format this disk if ($format) { print "About to format $device. This should take 7 to 8 minutes\n"; print "Now would be a good time to get coffee\n"; `$ScsiFormat -w $base`; print "Done with format\n"; } # # Partition table # print "Wiping partition table\n"; `$Dd if=$Zero of=$r_device count=2`; # # Disklabel # print "Writing new disklabel\n"; `$DiskLabel -Brw $base auto`; # # Filesystem # print "Creating new filesystem\n"; `$NewFs $Slice`; # # lost+found # print "Creating lost+found directory\n"; `$Mount $Fs $MountPoint`; chdir($MountPoint); mkdir($InitDir, $mode); chdir($ENV{PWD}); # # Do we leave it mounted ? # if (! $mount) { `$Umount $MountPoint`; } else { print "Leaving disk mounted\n"; } print "Done !! \n"; exit(0); sub Usage { print "$PROGRAM_NAME [-f] [-m] [-h]\n"; print " -f -- Format disk \n"; print " -m -- Leave disk mounted \n"; print " -h -- This message \n"; exit(0); } sub ErrorMsg { print "You must be root to run this !\n"; exit(1); } -------------------ENCLOSED-------------------ENCLOSED--------------------- -- Josef Grosch | Another day closer to a | FreeBSD 2.2.7 jgrosch@MooseRiver.com | Micro$oft free world | UNIX for the masses To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980626075755.A8561>