[I think this thread belongs only on -current for the moment. Please
followup there.]
On Thu, Jun 22, 2000 at 01:44:47PM -0700, Brian Fundakowski Feldman wrote:
> For what it's worth, there's a port, ports/sysutils/eject, which is made
> to do this. I'm not one to deny a simple feature in the base system,
> though, even if this feature is not /really/ that simple.
There are two problems with ports/sysutils/eject:
= It uses only CDIOCEJECT, which will not work for all removable
media (e.g. SCSI disks, tapes).
= It tries to unmount the device after ejecting it. This doesn't
make since for all devices. Even for those that it _does_ make
sense, it can be hard to correctly determine how (by what name)
the device is mounted.
So I wrote a simple utility that ejects media as follows:
= Check to see if the given device is known to cam, and if so
use camlib to eject it.
= If that doesn't work, try the CDIOCEJECT ioctl.
= If that didn't work, give up.
It is available as a port at: http://www.nectar.com/freebsd/neject.tar
Included in the port distfile is a patch (umount.patch) that adds a `-e'
option to umount. If you use it, then umount will run eject for each
local filesystem that is unmounted.
I figure umount should call eject, rather than the other way around,
since umount already knows the device name and mount point.
I actually think that there should be load/eject media ioctls defined
that are not specific to CDs. I'll post a separate message to that
effect on -current.
--
Jacques Vidrine / [EMAIL PROTECTED] / [EMAIL PROTECTED]
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message