LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   automount/unmount usb pendrive on lenny (minimal) (https://www.linuxquestions.org/questions/linux-newbie-8/automount-unmount-usb-pendrive-on-lenny-minimal-841410/)

vrusu 10-30-2010 01:03 PM

automount/unmount usb pendrive on lenny (minimal)
 
Hi
I need your help to configure udev to auto-(u)mount usb pen-drive on my minimal lenny (No X,hal,etc, only udev).
kernel correctly detect :
Code:

[287909.514127] usb 1-1.4: new high speed USB device using orion-ehci and address 4
[287909.635454] scsi1 : usb-storage 1-1.4:1.0
[287910.635307] scsi 1:0:0:0: Direct-Access              Patriot Memory  PMAP PQ: 0 ANSI: 0 CCS
[287910.648078] sd 1:0:0:0: Attached scsi generic sg1 type 0
[287911.793129] sd 1:0:0:0: [sdb] 15646720 512-byte logical blocks: (8.01 GB/7.46 GiB)
[287911.802235] sd 1:0:0:0: [sdb] Write Protect is off
[287911.807491] sd 1:0:0:0: [sdb] Mode Sense: 23 00 00 00
[287911.807503] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[287911.817745] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[287911.824003]  sdb: sdb1 sdb2
[287911.837361] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[287911.843581] sd 1:0:0:0: [sdb] Attached SCSI removable disk

I can manually mount.

But I would like an hot-plug automount like in my ubuntu desktop, on /media/{us_label_or_uuid}

thank you!

markush 10-30-2010 01:50 PM

Hello vrusu and welcome to LQ,

an additional line in your /etc/fstab should solve that:
Code:

/dev/sdb1  /media/usb  auto  defaults auto user  0 0
the downside of this is that the mountpoint is not automatically created and you'll have to add a line for every possible device (e.g. additionally /dev/sdc1). I'm not sure if there are other ways without hal.

Markus

EDIT: :doh: another idea http://reactivated.net/writing_udev_rules.html one can define actions for udev rules.


All times are GMT -5. The time now is 01:03 PM.