Unable to umount removable media: device busy

Christopher Sean Hilton chris at vindaloo.com
Thu Jun 26 03:58:22 UTC 2008


On Jun 25, 2008, at 4:15 PM, Kevin Oberman wrote:
>
> I've had that problem since the dawn of HAL. gam_server tends to  
> keep it
> open. If I wait a long time after the last access to the device, I  
> think
> gam gives up on monitoring it, but that may link to other things  
> like the
> number of directories it monitors.
>
> Wish there was some way to tell gam to just let go of a device/ 
> directory
> wot eh unmount would always work.

After a little reading I'm guessing that gamin and gam_server are  
attempts to rewrite fam. Googling for gam_server brings up countless  
pages on it's misbehaviour with regard to CPU usage (gam_server is  
eating up 40% of my cpu and the like).

Is there any way to combine Hal, geom and the automounter into a more  
robust solution?

E.g. I fdisk and disklabel my USB stick with a Native FreeBSD  
filesystem. Then I use

      tunefs -L "myusbstick" /dev/da0s1a

to label the filesystem for geom. Now when I plug in the USB stick I  
get an entry in /dev/ufs/myusbstick.

Now I configure amd with a map like this:

/default	type:=program;\
                 mount:="/usr/sbin/mount mount /dev/ufs/${key} ${fs}";\
		unmount:="/usr/sbin/umount umount ${fs}";

*		fs:=${autodir}/${key};

In case you are interested you use a program mount because amd never  
times out a ufs mount. Command to mount the pendrive:

       ls -l /<map>/<label>/

To unmount the filesystem:

      amq -u /<map>/<label>

Finally to use something like this with gam make sure to change gam's  
time out to be at least twice as long as amd's

-- Chris

Chris Hilton                                   e: chris|at|vindaloo| 
dot|com
----------------------------------------------------------------------------
                   "The pattern juggler lifts his hand; The orchestra  
begin.
       As slowly turns the grinding wheel in the court of the crimson  
king."
                                            -- Ian McDonald / Peter  
Sinfield





More information about the freebsd-gnome mailing list