Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm wondering if anyone has tackled the issue of having a USB flash drive automatically mount to the file system when it is inserted? I am working on a TI DM355 DaVinci EVM board running MontaVista Linux 4.0.1.
I can do this manually easily enough by:
mkdir /mnt/usbflash
mount /dev/sda1 /mnt/usbflash
To make this mount occur automatically, I *think* that I need to use autofs to do this, but if that's wrong I'd like to know.
Using autofs, here is what I did...
I inserted the following into /etc/auto.master:
/mnt/usbflash /etc/auto.usbflash --timeout=30 --ghost
I inserted the following into /etc/auto.usbflash:
usbflash -fstype=auto,sync :/dev/sda1
I then:
mkdir /mnt/usbflash
/etc/init.d/autofs restart
and this appeared to work. But for some reason, the directory /mnt/usbflash was mysteriously deleted. And inserting the USB stick does not force an automatic mount.
im not sure if this is elegant but you can waste negligible processor cycles by doing something like:
[untested]
Code:
while [ 1 ]
do
mnt=`dmesg | tail | grep usb` # my system spits out the make/ model of the usb thumb drive when i insert it
if [ mnt ]
then
mount /mnt/point /dir
fi
done
You can download a program called automount and this program will automatically mount a usb flsh drive for you without any edit of /etc/fstab or script.
You can download a program called automount and this program will automatically mount a usb flsh drive for you without any edit of /etc/fstab or script.
this seems like the least abrasive solution. i've never looked at the source for automount but i suspect that it does the equivelent of :
Code:
while [ 1 ]
do
mnt=`dmesg | tail | grep usb` # my system spits out the make/ model of the usb thumb drive when i insert it
if [ mnt ]
then
mount /mnt/point /dir
fi
done
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.