LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   What's package daemon that add to /etc/fstab when you add USB sticks (http://www.linuxquestions.org/questions/linux-general-1/whats-package-daemon-that-add-to-etc-fstab-when-you-add-usb-sticks-615051/)

frenchn00b 01-20-2008 05:24 PM

What's package daemon that add to /etc/fstab when you add USB sticks
 
Hello,

On some machines and live cd, when you plug a USB stick, it changes the /etc/fstab automatically, and the user can mount it !!

Very easy, what is this daemon ? Does it exist a package for Debian Stable ? ( the started daemon might be in the /etc/init.d ...)

Thanks for the information !

bigrigdriver 01-20-2008 05:53 PM

If I am not mistaken, mounting the USB stick is handled by usbfs. Usbfs is mounted on boot if you have an entry like this in your /etc/fstab:
Code:

none            /proc/bus/usb            usbdevfs        defaults  0  0
When you plug in the USB stick, it should appear either in /mnt or /media.

jschiwal 01-20-2008 06:35 PM

If your system doesn't have this, using it might break how automounting works on your system. You could always just enter "mount" by itself and use the values returned to create your own entry in /etc/fstab, but make sure you use "UUID=" or "LABEL=" and not the device name. This is because the next time you insert a device it might be /dev/sdc1 instead of /dev/sdb1. You can use the "udevinfo" program to determine the UUID or LABEL of a disk. "udevinfo -q env -n /dev/sdb1" for example. Look for the line of output that says something like "ID_FS_UUID=4B1135F8699960E7", then use "UUID=4B1135F8699960E7" in place of the device in the fstab entry. ( The particular UUID number will be different of course. ). For fat32 filesytems, using the "uid=" option together with the "users" option will allow mounting by a normal user. Using the appropriate "fmask" and "dmask" values can give you exclusive access for that pendrive on that computer.

On many distro's the dbusd, hald and udevd daemons are involved along with helper programs which may include a KDE or Gnome daemon as well. Hal will detect the device and udev will create a device node for it. The PolicyKit package may be involved as well. After the device is mounted there will be a /media/.hal-mtab entry created for that device as well.

Other systems use hotplug to do most of the work.

If your system uses HAL, check if you have a "halmount" program which would allow you to mount a device from the console as a normal user.

frenchn00b 01-20-2008 08:30 PM

Thanks
add. info: I know that for instance with Suse distros, it is done automatically, even no X started.


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