I have a raspberry Pi and using Raspbian (without the GUI) and need USB pen drives to be mounted to /media/usb and cdrom drive to be mounted to /media/cdrom.
I have set up a script using autofs
/etc/auto.master
/media /etc/auto.media --timeout=2
/etc/auto.media
cdrom -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
usb -fstype=vfat,rw,nosuid,nodev :/dev/sda1
However it doesn't seem to be working, what would be the best method to have these auto mount? Or is there just something wrong with my scripts?
The pen drive is always /dev/sda1
or at least /dev/sda
but for my purposes it will always be the first partition, the memory card in a pi is /dev/mmcblk0p1
I have also checked that autofs
is running.
Seems the respective folder in /media is not being created, and if i try to create it myself i get permission denied even as root.
/media
permissions are:
drwxr-xr-x 2 root root 0
/dev/sda1
? In fact, is it ever? That is usually the name of the 1st HDD, the memory card in a Pi I guess. – terdon Jun 10 '13 at 16:24autofs
service running? Check withservice autofs status
. – terdon Jun 10 '13 at 17:47