Automatically mounting USB w/o GUI?

Joseph Smith joe at settoplinux.org
Tue Jul 27 10:40:47 EDT 2010




On Tue, 27 Jul 2010 10:33:48 -0400, Tom Buskey <tom at buskey.name> wrote:
> On Tue, Jul 27, 2010 at 10:27 AM, Joseph Smith <joe at settoplinux.org>
wrote:
> 
>>
>>
>>
>> On Tue, 27 Jul 2010 10:01:16 -0400, Tom Buskey <tom at buskey.name> wrote:
>> > I want my USB drive to show up mounted on /media/<some label> after I
>> plug
>> > it in.
>> > I don't mind having to type something on the command line to trigger
> it.
>> >
>> > In Solaris, I put a CD/Floppy/USB in and type "volcheck".  Then it
> checks
>> > for the presence of something and mounts it.
>> > I can type df and see where it mounts it.  I don't run mount or
> anything
>> > else that requires root.  If I want to use a file manager, I can.  But
> I
>> > don't have to.
>> >
>> > That's what I want.
>> >
>> > Here's the scenario:
>> >     Server in basement w/o monitor.  No one is logged in.  No gnome,
no
>> > KDE,
>> > no X11 anything
>> >     Plug USB in (ummmm tuesday)
>> >     login remotely via SSH (friday?)
>> >     want to transfer files to USB from server.
>> >     eject USB device (monday)
>> >     grab USB & put in backpack on way out door
>> >
>> >
>> > When I'm using Ubuntu/Gnome or Fedora/Gnome, I usually have to fire up
>> > thunar or some other GUI file manager and the device then gets mounted
>> and
>> > I
>> > quit the file manager and use the command line.  They don't work so
> well
>> on
>> > a slow SSH tunnel.
>> >
>> >
>> > So, does anyone know how to have linux mount the USB drives to /media
>> like
>> > the GUI file managers do w/o using the mount command?
>> >
>> > FWIW, I'm using Fedora 12 but I should be able to do this in Ubuntu
> 10.04
>> > as
>> > well.  And I'm *not* using a GUI tool to do it, so please no Gnome/KDE
> or
>> > "Click on System -> ..." or anything else using a mouse.
>>
>> Well, you could always write a simple bash script to do the mount and if
> it
>> is going to be same day/time every week use cron to run bash script.
Hope
>> that helps.
>>
>>
> Maybe I should have said "some random time" and "random time + more
> random".
> The times are not important.  I plug a random drive into the server,
> sometime later login via SSH to transfer files to the drive, eject when I
> finish, grab the drive on the next swing by the server.
> 
> The GUIs are using something.  There must be a way to scan the bus &
mount
> that the GUIs do.  And there must be a way to manualy run the scan
instead
> of polling or reacting to an event/interrupt.  I don't mind writing a
> script
> around that.

Most file managers that I have seen don't actually mount the drive until
you click on it.

-- 
Thanks,
Joseph Smith
Set-Top-Linux
www.settoplinux.org



More information about the gnhlug-discuss mailing list