From owner-freebsd-current Fri Jun 23 8:21:18 2000 Delivered-To: freebsd-current@freebsd.org Received: from gw.nectar.com (gw.nectar.com [209.98.143.44]) by hub.freebsd.org (Postfix) with ESMTP id BB10437B721; Fri, 23 Jun 2000 08:21:11 -0700 (PDT) (envelope-from nectar@nectar.com) Received: from bone.nectar.com (bone.nectar.com [10.0.1.105]) by gw.nectar.com (Postfix) with ESMTP id 173259B36; Fri, 23 Jun 2000 10:21:11 -0500 (CDT) Received: by bone.nectar.com (Postfix, from userid 1001) id B2C041DC6; Fri, 23 Jun 2000 10:21:08 -0500 (CDT) Date: Fri, 23 Jun 2000 10:21:08 -0500 From: "Jacques A . Vidrine" To: Brian Fundakowski Feldman Cc: Wes Peters , Greg Lehey , FreeBSD current users , FreeBSD-arch@FreeBSD.ORG Subject: Re: -e option to umount? Message-ID: <20000623102108.H76049@bone.nectar.com> Reply-To: freebsd-current@freebsd.org Mail-Followup-To: "Jacques A . Vidrine" , Brian Fundakowski Feldman , Wes Peters , Greg Lehey , FreeBSD current users , FreeBSD-arch@FreeBSD.ORG References: <395265AA.AEC5EB8@softweyr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from green@FreeBSD.org on Thu, Jun 22, 2000 at 01:44:47PM -0700 X-Url: http://www.nectar.com/ Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [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 / n@nectar.com / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message