[CentOS] USB, AutoMount & VNC

Frank Thommen frank.thommen at embl-heidelberg.de
Fri Mar 27 23:12:13 UTC 2009


Guy Boisvert wrote:
> MHR wrote:
>> On Fri, Mar 27, 2009 at 6:35 AM, Guy Boisvert <boisvert.guy at videotron.ca> wrote:
>>> Hi!
>>>
>>>        I'm trying to figure out how to make automount do its job when nobody
>>> is logged at the console and the user access the server by VNC.  Does
>>> anybody knows how to make CentOS automount USB Hard Drives / Pendrive
>>> when accessed by VNC?
>>>
>> Could you describe the problem a little more clearly?  Separation of
>> console from USB-accessible hardware, how VNC fits in in this
>> scenario, etc.
>>
>> It sounds like someone wants to log in remotely (VNC), plug in a
>> (local) USB device and access it (remotely), which doesn't make sense
>> to me.
>>
>> Thanks.
>>
>> mhr
>> _______________________________________________
> 
> Hi,
> 
> 	It make senses if you're running a box headless (it will be headless 
> soon, now i'm testing it with K+V+M attached).  We're using a CentOS box 
> to plug USB Flash drive & external hard drive into it.  The CentOS box 
> is then used to FTP the content of these external drives to a Winblows 
> box, all that filtered by a firewall between the 2 boxes.  Only FTP is 
> allowed.
> 
> 	Doing some tests on the CentOS box, i saw that if i log into the 
> console, then the local session and the remote VNC sessions will see the 
> drives automounted.  If i log out of the console, then the VNC session 
> won't see anything.  It's like the automount works only if somebody is 
> logged at the console.

I assume that with "console" you mean X11/desktop manager.  In this case 
Gnome or KDE handle the mounting of removable devices for you.  The 
automounter hasn't anything to do with it.

If you want the automounter to handle removable devices, then you'll 
have to add appropriate automounter map entries.  Something like

/etc/auto.master:
/media /etc/auto.media

/etc/auto.media:
usb    :/dev/sda1


or you could use a program map like the following (not my invention, I 
took this from the autofs mailing list):

-----
#!/bin/sh
if ntfs-3g.probe /dev/sda1; then
	echo "-fstype=ntfs-3g,other-opts :/dev/sda1"
else
	echo "-fstype=vfat,other-opts :/dev/sda1"
fi
-----

You'll probably find other examples on the net.

I'm not sure if such an automounter setup collides with Gnome/KDE 
automounting.

Cheers

     frank



More information about the CentOS mailing list