Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 1998 16:29:07 -0400
From:      Randall Hopper <rhh@ct.picker.com>
To:        aaronx@fearme.com, Jeremy Shaffner <jer@jorsm.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: scsi zip drive
Message-ID:  <19980520162907.A16037@ct.picker.com>
In-Reply-To: <XFMail.980520082628.aaronx@fearme.com>; from Aaron Yeung on Wed, May 20, 1998 at 08:26:28AM -0700
References:  <19980520102845.A10417@ct.picker.com> <XFMail.980520082628.aaronx@fearme.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Jeremy Shaffner:
 |Randall Hopper:
 |> If you want a script that'll cook UFS ZIP disks in FreeBSD, just let me
 |> know.  I too have a SCSI ZIP on sd0.
 |> 
 |> You can also insert an appropriate entry in /etc/fstab so that normally all
 |> you need to do is type "mount /zip" and it'll do the "mount -t msdos
 |> /dev/sd0s4 /zip" for you.  Let me know if you'd like me to mail it to you.
 |> 
 |> Finally I have a few cheesy setuid perl scripts I can mail you too so you
 |> can mount and unmount your ZIP disks without having to become root first.
 |> Again, just let me know.
 |> 
 |
 |Send 'em over, if you would. 

Aaron Yeung:
 |can you please send the scripts :-)
 |
 |oh and btw, how do you eject the zip disk? like just umount it then press
 |eject?

Sure.  Since there was some interest from more than one person, I'll just
post.

1. /etc/fstab entries for ZIP disks:
   (These allow you to just type "mount /zip" or "mount /doszip":

/dev/sd0s1              /zip            ufs     rw,noauto       0       0
/dev/sd0s4              /doszip         msdos   rw,noauto       0       0

   This assumes you stick with the convention of leaving your DOS (FAT)
   on Slice 4 (like ZIPs come formatted) and put your UFSs on Slice 1.

2. mountzip (Perl Script -- attached)

   Allows you to mount DOS or UFS ZIP disks without becoming root.  To
   install, "chown root mountzip; chmod 4710 mountzip".  Also be sure the
   /zip directory exists.)

3. umountzip (Perl Script -- attached)

   Allows you to un-mount ZIP disks without becoming root.  To install,
   "chown root mountzip; chmod 4710 mountzip".  Also be sure the /zip
   directory exists.

4. make-ufs-zip.sh

   Format a UFS in either sliced or dangerously dedicated mode.  Personally
   I prefer sliced since I use multiple disk formats.

Randall
[-- Attachment #2 --]
#!/usr/bin/suidperl -w

$ENV{'PATH'}  = '/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin';
$ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'};
$ENV{'IFS'}   = ''        if defined $ENV{'IFS'};

chdir( "/" );
( !system( "mount /dev/sd0s1 /zip"       ) && print "UFS /zip mounted\n" ) ||
( !system( "sudo mount -t msdos /dev/sd0s4 /zip" ) && print "DOS /zip mounted\n" ) || 
die "Mount failed\n";

[-- Attachment #3 --]
#!/usr/bin/suidperl -w

$ENV{'PATH'} = '/bin:/usr/bin:/usr/sbin:/sbin';
$ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'};
$ENV{'IFS'}   = ''        if defined $ENV{'IFS'};

chdir( "/" );
( !system( "umount /zip"    ) && print "/zip UNmounted\n"    ) ||
( !system( "umount /doszip" ) && print "/doszip UNmounted\n" ) ||
die "Umount failed\n";

( !system( "scsi -f /dev/rsd0.ctl -s 30 -c '1b 0 0 0 0:b6 v:b1 v:b1 0' 1 0" )
   || die "Eject failed\n" );

# Permutations for the last two args to scsi(8) with this other arg permut
#        $loej   $start  action
#        0       0       stop, don't eject medium
#        1       0       stop & eject
#        0       1       start, but don't try to load medium
#        1       1       start & load medium

[-- Attachment #4 --]
<c5VmoF\ttL[ܳ"+m"ꛒ+ƶq\]w
Uؗgg1 Zl0'\M6.KJ8}}	OG-\%%tτ	28GyĹNc^NcNiɵ8dJ"q4gZ-Iq^J&!=q j0)*kA,[p$PlJѐ#}cWnI{t"aZ'^ɸa93N;bXvrbgD
؇x(a%n펡Q
v/T8*x	E$JӮwKeQ[.4q{cx4u#a2J=	z~4}XddN,	3v$6%'ΎPzڌř*qk%~Ia/=9Xt
;1-Wx#]Z8%7?g+.ohaPXiꇄI`MͪK$MJdS5D4&Gk,	}F+Ǩ#$sXgb/ UE#0HXلU;f9NX$Mp,GEkI}1=L9X?BۖlK߲0?	f7p+ﷹ	o@
ž
3iG+h+
,*^J+~ey5)"nG7.詶g^9ui-GII2*ǝcPhם?zW
oR|%yslWWZQ?q-tK4Cujgĭz wU8EPYT_?BUb7?
lcrn0KSh]آe#;y^ !mR.~A8#ٔBhfؗ;mpQ(DK,:}yr]_„
—{]Tҩp6-&[;_uX
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980520162907.A16037>