Re: USB Drive and Camera Automount

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




D. D. Brierton wrote:
Well, if it isn't too much trouble could you explain both? I'm not sure
which would be the better route for me, and if I understood more what
they entailed I'd have a better idea. But, naturally, don't put yourself
out over this.

For autofs:
in /etc/auto.master define the mountpoint for the devices and the configfile for them. example I automount on /mnt using the configuration in /etc/auto.mnt and set a timeount of 6 seconds (the unmount when unused for 6 seconds) like this:


/mnt /etc/auto.mnt --timeout=6

Then in /etc/auto.mnt I define the mounts:
cdrom	-fstype=iso9660,ro	:/dev/cdrom
usbcd	-fstype=iso9660,ro	:dev/cdrom1
camera	-fstype=vfat	:/dev/hde1
floppy	-fstype=auto	:/dev/fd0

I can access the like using the shell:
cd /mnt/camera
or in the filemanager by specifying the location.
Nautilus doesn't like this becaue the filesystem unmount, while the shell keeps it active. Since I usuall work with a shell it's noty a problem :)


For hotplug:
Check out the documentation on linux-hotplug.sourceforge.net

You need to add a line in /etc/hotplug/usb.usermap that has the name of you script (to be placed in /etc/hotplug/usb), the vendorID,and the ProductID at least. You may also make use of the other feilds in that file if needed. I've always seen match_flags set to 0x0003 in usermap. Other values are used in distmap and handmap, but I really don't know what they do.

Then you create the script in /etc/hotplug/usb (named the same as you added in the usermap file). The usbcam file is a good starting point, as is the example here <http://linux-hotplug.sourceforge.net/perf>. perf loads firmware too (the fxload command). Both give you an idea about changing device permissions and how to use the variable set when the script runs.

Have the script make the mountpoint if it's missing, change the device permissions, and mount the filesystem when $ACTION=add. I think if you add them to /etc/fstab wth noauto,owner for the options they will show up in the Disks menu (to allow mounting and unmounting) like the CD and Floppy do.

-Thomas




[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux