did anyone know howto auto mount the u disk in embedded linux system

Oct 10, 2008 2 Replies

if I insert a U-disk into the device, How can I know the U-disk had inserted? Thank you!


you can type "dmesg" after you insert a u-disk , to find the dev name of the u-disk and type mount command for example: mount /dev/sda /mnt/usb /mnt/usb is your mount point sda is the dev name of the u-disk

Create a udev rule that starts a specific programm and/or shell script when one insert a USB mass storage device:

KERNEL=="sd[a-z]*", SUBSYSTEMS=="usb", RUN+="/bin/bash /usr/local/sbin/do_something"

In the "do_something" script you can do whatever you want.

jbe

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required