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>

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

--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii

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
--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=mountzip

#!/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";

--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=umountzip

#!/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

--ikeVEW9yuYc//A+q
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="make-ufs-zip.sh.gz"

H4sIAIU8YzUAA81WbW/iRhD+XP+KwY50iXQGTIJb3LMikpgrbRMiHK7qm5K1vQYrxra8y3Fc
0//e2V0DDqR31wpVtZDYl2dn5+WZ2TEarSDJWmymGZoB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9VfwV7JaUfw/o3EtdEsRvec0Q3Vq/Yi25f0L4avHZxvErfx6IHewVTgV
9UVQD1lUkgxfvhWEqoQLP4tCglUDHb5inM437j+w4w1sG2MG5p1y4W7eMEtTgJ31EL6qtxlo
AV3SEtiioGWQ5uEjBAQ7wON5XqqSB6wgIW2c/IPUUhd/LrUOGIV+FkE4I9mUQr7MaMlm2Jfk
sfQ7zwu0o5Rt6+pwl84fUSiYBbRES/XpLJiLOrfPfXlyXahfwoQKgs7Cl3uJXVTV0qnlcDYt
C7kmWzu1uKjkiPFfg3VYosoMAAA=

--ikeVEW9yuYc//A+q--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



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