View previous topic :: View next topic |
Author |
Message |
epig Tux's lil' helper
Joined: 16 Feb 2005 Posts: 88
|
Posted: Mon Sep 19, 2005 10:08 am Post subject: Auto-mounting USB memory stick (udev, dbus, hal) |
|
|
So I got my shiny new USB Memory stick. No problem mounting it the old-fashioned way (mount /dev/sda1 /mnt/usb)
But what I want to do is have my box mount this automatically every time I insert.
I have udev working properly, emerge hal (and dbus) and get them too running porperly.
When I insert the USB stick I find this in the log:
Code: | Sep 19 11:59:33 [kernel] scsi11 : SCSI emulation for USB Mass Storage devices
Sep 19 11:59:38 [kernel] Vendor: Sony Model: Storage Media Rev: 0100
Sep 19 11:59:38 [kernel] Type: Direct-Access ANSI SCSI revision: 00
Sep 19 11:59:38 [kernel] SCSI device sda: 1014784 512-byte hdwr sectors (520 MB)
Sep 19 11:59:38 [kernel] sda: Write Protect is off
Sep 19 11:59:38 [kernel] sda: assuming drive cache: write through
Sep 19 11:59:38 [kernel] SCSI device sda: 1014784 512-byte hdwr sectors (520 MB)
Sep 19 11:59:38 [kernel] sda: Write Protect is off
Sep 19 11:59:38 [kernel] sda: assuming drive cache: write through
Sep 19 11:59:38 [kernel] Attached scsi removable disk sda at scsi11, channel 0, id 0, lun 0
Sep 19 11:59:38 [kernel] Attached scsi generic sg0 at scsi11, channel 0, id 0, l un 0, type 0
Sep 19 11:59:38 [scsi.agent] disk at /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1 -5:1.0/host11/target11:0:0/11:0:0:0
Sep 19 11:59:39 [fstab-sync] added mount point /media/usbdisk for /dev/sda1
|
Everything seems to work well. Kernel sees the key, hald makes a mount point. and updates /etc/fstab
When I do a:
Code: | mr2 ~ # mount
/dev/hda2 on / type xfs (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw,nosuid)
devpts on /dev/pts type devpts (rw)
/dev/hdb1 on /home type xfs (rw,noatime)
none on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85)
|
I see that the device is not mounted.
So I check /etc/fstab and find that this line has been added:
Code: | /dev/sda1 /media/usbdisk vfat user,exec,noauto,utf8,noatime,sync,managed 0 0 |
Time to do a mount -a but still no disk mounted.
So I guess my question is: How do I get the key mounted automatically? I know it is possible, but I don't get how.....? What am I doing wrong?
Thanks in advance |
|
Back to top |
|
|
gustafson Guru
Joined: 12 Aug 2004 Posts: 430
|
Posted: Mon Sep 19, 2005 2:15 pm Post subject: |
|
|
The "noauto" option should be "auto". |
|
Back to top |
|
|
epig Tux's lil' helper
Joined: 16 Feb 2005 Posts: 88
|
Posted: Mon Sep 19, 2005 2:23 pm Post subject: |
|
|
Very well, how do I make this happen since it is an auto-generated entry?
Any place to set paramters like this? |
|
Back to top |
|
|
gustafson Guru
Joined: 12 Aug 2004 Posts: 430
|
Posted: Tue Sep 20, 2005 7:49 pm Post subject: |
|
|
Sorry, I don't really know. Good luck. |
|
Back to top |
|
|
sam_i_am Tux's lil' helper
Joined: 19 Sep 2003 Posts: 131
|
Posted: Tue Sep 20, 2005 11:59 pm Post subject: |
|
|
epig wrote: | Very well, how do I make this happen since it is an auto-generated entry?
Any place to set paramters like this? |
Well, if you really want, you can add a file with appropriate entry to /usr/share/hal/fdi/95userpolicy/. To see what kind of stuff to add, see /usr/share/hal/fdi/90defaultpolicy/storage-policy.fdi. But all that is pretty hairy (man hal, man fstab-sync etc). All it does is letting you mount it by hand with a slightly shorter command.
Most of all, I don't personally use it as I have a much better solution
If you are using KDE, then make sure you have the following in your /etc/portage/package.use and recompile if necessary.
kde-base/kdebase hal
kde-base/kdebase-kioslaves hal
(you may only need the latter, but I didn't take any chances). From your post, it seems hal and dbus are working OK. That's all you need.
Then, when you plug in the USB stick, a nice icon appears magically on the task bar. You can then either choose to mount it or browse files without mounting it. I find that gives me best balance between control and automation.
I've seen mention of ivman for auto mounting, but above is plenty for me.
HTH
Sam
PS: Gnome users may want to pipe in with their bag of tricks here |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|