Using a Zip drive with Samaba

Dave Reed dreed at capital.edu
Mon Jul 3 00:18:41 GMT 2000


> From: "Robert Dahlem" <Robert.Dahlem at gmx.net>
> 
> Dave,
> 
> On Mon, 3 Jul 2000 08:05:20 +1000, Dave Reed wrote:
> 
> >>>Has anyone been able to get a zip drive working with samba?  I 
> >>>want to set up a systsem where the drive gets mounted, in a letter 
> >>>like F: and students can pop in and out zip disks without having to 
> >>>deal with any unix interfaces.
> 
> >> Just do it like you would do it with a CD:
> >> 	root preexec = mount /mnt/zip
> >> 	root postexec = umount /mnt/zip
> 
> >When exactly does the postexec get executed?  If a Win user
> >double-clicks on the corresponding share under network neighborhood,
> >it mounts fine, but when they close the window for the share, the
> >postexec doesn't execute.  If you use the "log-off" feature, then it
> >disconnects or if you "map a network drive" and then disconnect it,
> >the postexec executes.
> 
> You answered it by yourself: postexec gets executed, when the share is 
> unmounted. Closing a window obviously does not do this.
> 
> >Is there a way to get the postexec to execute when they close the
> >window that is for the share or another manner without having the 
> >user "log off"?  Otherwise, the user can't take the zip drive out 
> >like they probably expect if they are a Windows user.
> 
> The trick is to _unmount_ the share. Give them an icon with something 
> like
> 
> 	NET USE X: /D
> 
> behind.
> 
> Regards,
>         Robert


I guess I was hoping there was an easier way.

In case the original poster is curious, I did the following:

On the Windows machine, create a shortcut to MS-DOS with name "connect zip"
and have it run the program:
c:\windows\net.exe use f: \\computer_name\zip

and when the user double clicks on it, the zip becomes accessible as
the f drive.

Create another MS-DOS shortcut with name "eject zip" and have it run:
c:\windows\net.exe use f: /d

The relevant portion of the smb.conf is:

[zip]
   comment = zip disk
   path = /mnt/zip
   writeable = yes
   root preexec = mount /mnt/zip
   root postexec = eject zip

If you don't want the zip ejected, just use umount instead of eject.

Dave


More information about the samba mailing list