Re: Automatically mounting USB w/o GUI?
Tom Buskey writes: > > On Tue, Jul 27, 2010 at 3:39 PM, Benjamin Scott wrote: > > On Tue, Jul 27, 2010 at 11:27 AM, Joshua Judson Rosen > wrote: > > pmount will get you the `mounting removable volumes/media without being > root' > > feature. > > /etc/fstab and the plain old mount command will get you the > `mounting removable volumes/media without being root' feature. > > See the "user", "users", and "owner" options in mount(8), and the > options field in fstab(5). > > -- Ben > > FWIW - pmount isn't on my Fedora system either. Hunh--I guess they don't install it by default. It does appear to be *in Fedora*, though: https://admin.fedoraproject.org/pkgdb/acls/name/pmount -- "Don't be afraid to ask (λf.((λx.xx) (λr.f(rr." ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
On Tue, Jul 27, 2010 at 3:39 PM, Benjamin Scott wrote: > On Tue, Jul 27, 2010 at 11:27 AM, Joshua Judson Rosen > wrote: > > pmount will get you the `mounting removable volumes/media without being > root' > > feature. > > /etc/fstab and the plain old mount command will get you the > `mounting removable volumes/media without being root' feature. > > See the "user", "users", and "owner" options in mount(8), and the > options field in fstab(5). > > -- Ben > FWIW - pmount isn't on my Fedora system either. ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
On Tue, Jul 27, 2010 at 3:36 PM, Benjamin Scott wrote: > On Tue, Jul 27, 2010 at 10:01 AM, Tom Buskey wrote: > > I want my USB drive to show up mounted on /media/ after I > plug > > it in. I don't mind having to type something on the command line to > trigger it. > > I can describe one way to do this. > > A1. Set-up devfs or hotplug or udev or DeviceKit or whatever it is > this week to give your USB flash storage device a consistent name > under /dev/ Let's say /dev/foo but you could use /dev/sandisk or > /dev/jumpdrive or whatever you like. > I think that's what I want > > A2. Add an entry to /etc/fstab associating /dev/foo with /media/foo > (or /mnt/foo or whatever); give it a mount option of "users" so that > any user can mount it > > A3. Now, when you plug in the flash thingy, you can do "mount > /media/foo" and it will mount. You don't need to be root. > > If you want, you could also add: > > A4. Use automount/autofs/amd/whatever, so that when a user attempts to > access /auto/foo, the system automatically tries to mount /dev/foo on > /auto/foo. Optionally, create a symlink from /media/foo to /auto/foo > to make that more obvious. > And combine this with A1. > > If the flash device is FATor some other non-Unixy filesystem: > > A5. Add uid/gid/umask/dmask options to the /etc/fstab entry so that > the appropriate users can read/write the mounted filesystem. > > I have a link earlier in the thread that is supposed to do this with udev which is the flavor of the week over devfs. The link could also handle different OS types on the same device (I might reformat my USB device). > One attribute of this approach is that other than step A1, all steps > use standard Unix techniques which have been around since before USB > was even invented. I strongly prefer this building block approach, > I've used mount by user options in fstab before. I'm going to dig around with udev. I was really hoping for a "let any user mount any usb device w/o root or sysadmin knowledge". This is for my own system but I'll extrapolate for work situations. For example, I have a user that receives USB drives from a customer that needs to review & transfer data. Maybe a drive a week. The user doesn't/can't have root. There might be multiple drives plugged in. > rather than the "throw everything out and start from scratch with > every problem" that seems to have invaded Linux in the past few years. > Yeah, I agree. Mounting CDs and USB drives has never been standard amongst Unixen. There's also been a tendency to only do things in the GUI. Instead of running /usr/bin/gpk-application, they hide it in the GUI menu as system->administration->add/remove software. I can ssh in and run gpk-application, but I don't have a menu to click. > > IMO. YMMV. HTH. HAND. > > -- Ben > ___ > gnhlug-discuss mailing list > gnhlug-discuss@mail.gnhlug.org > http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/ > ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
On Tue, Jul 27, 2010 at 11:27 AM, Joshua Judson Rosen wrote: > pmount will get you the `mounting removable volumes/media without being root' > feature. /etc/fstab and the plain old mount command will get you the `mounting removable volumes/media without being root' feature. See the "user", "users", and "owner" options in mount(8), and the options field in fstab(5). -- Ben ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
On Tue, Jul 27, 2010 at 10:01 AM, Tom Buskey wrote: > I want my USB drive to show up mounted on /media/ after I plug > it in. I don't mind having to type something on the command line to trigger > it. I can describe one way to do this. A1. Set-up devfs or hotplug or udev or DeviceKit or whatever it is this week to give your USB flash storage device a consistent name under /dev/ Let's say /dev/foo but you could use /dev/sandisk or /dev/jumpdrive or whatever you like. A2. Add an entry to /etc/fstab associating /dev/foo with /media/foo (or /mnt/foo or whatever); give it a mount option of "users" so that any user can mount it A3. Now, when you plug in the flash thingy, you can do "mount /media/foo" and it will mount. You don't need to be root. If you want, you could also add: A4. Use automount/autofs/amd/whatever, so that when a user attempts to access /auto/foo, the system automatically tries to mount /dev/foo on /auto/foo. Optionally, create a symlink from /media/foo to /auto/foo to make that more obvious. If the flash device is FATor some other non-Unixy filesystem: A5. Add uid/gid/umask/dmask options to the /etc/fstab entry so that the appropriate users can read/write the mounted filesystem. One attribute of this approach is that other than step A1, all steps use standard Unix techniques which have been around since before USB was even invented. I strongly prefer this building block approach, rather than the "throw everything out and start from scratch with every problem" that seems to have invaded Linux in the past few years. IMO. YMMV. HTH. HAND. -- Ben ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
On 07/27/2010 10:01 AM, Tom Buskey wrote: > I want my USB drive to show up mounted on /media/ after I > plug it in. > I don't mind having to type something on the command line to trigger it. > > 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. Tom: I haven't tried this, but it seems to me that this is something that PolicyKit does, and I believe there is a console interface to it. However, my Google-fu seems to be weak this morning, and I haven't been able to come up with any recent posts. Here's one, though: https://fedoraproject.org/wiki/Features/PolicyKitOne -- Ted Roche Ted Roche & Associates, LLC http://www.tedroche.com ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
Tom Buskey writes: > > > > I want my USB drive to show up mounted on /media/ 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. > > It looks like udev can do what I want. http://snipt.net/rschu68/mount-usb-disk-with-udev-and-autofs/ which links to http://en.gentoo-wiki.com/wiki/Autofs It looks like I'll have to put some identifying info in udev/rules.d for each device I want to get mounted. It's still not as easy as volcheck; ls /cdrom/cdrom0/ :-/ ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
Tom Buskey writes: > > I want my USB drive to show up mounted on /media/ 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. pmount will get you the `mounting removable volumes/media without being root' feature. If you want it to happen *automatically*, you can try usbmount, or HAL + ivman. -- "Don't be afraid to ask (λf.((λx.xx) (λr.f(rr." ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
On Tue, 27 Jul 2010 10:33:48 -0400, Tom Buskey wrote: > On Tue, Jul 27, 2010 at 10:27 AM, Joseph Smith wrote: > >> >> >> >> On Tue, 27 Jul 2010 10:01:16 -0400, Tom Buskey wrote: >> > I want my USB drive to show up mounted on /media/ 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 (u 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 ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
On Tue, Jul 27, 2010 at 10:27 AM, Joseph Smith wrote: > > > > On Tue, 27 Jul 2010 10:01:16 -0400, Tom Buskey wrote: > > I want my USB drive to show up mounted on /media/ 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 (u 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. ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
On Tue, 27 Jul 2010 10:01:16 -0400, Tom Buskey wrote: > I want my USB drive to show up mounted on /media/ 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 (u 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. -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Automatically mounting USB w/o GUI?
On Tue, 27 Jul 2010 10:01:16 -0400, Tom Buskey wrote: > I want my USB drive to show up mounted on /media/ 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 (u 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. -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/