Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jun 2008 23:27:18 -0400
From:      Christopher Sean Hilton <chris@vindaloo.com>
To:        Kevin Oberman <oberman@es.net>
Cc:        FreeBSD GNOME Users <gnome@freebsd.org>
Subject:   Re: Unable to umount removable media: device busy 
Message-ID:  <43EE2290-5D9C-4F0B-99BB-1B051D93738C@vindaloo.com>
In-Reply-To: <20080625201521.299CD4500E@ptavv.es.net>
References:  <20080625201521.299CD4500E@ptavv.es.net>

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

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






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43EE2290-5D9C-4F0B-99BB-1B051D93738C>