Removable Media - Automount
This article Based on work by Myno, andre, mindbender, downlalaway, Thorongil, frontalot, and TcT. Originally by downlalaway at Linkstationwiki.org
This is a basic run through of USB devices connecting for Debian on an PPC LinkStation. See Murasaki LinkStation's USB hot-plugging system for information about removable Media with the original Firmware or OpenLink on, for example, the LS1 and LS2.
On the PPC LinkStation the USB hard drive is USB 2.0 at 3Mb/s (on a laptop HD). NB. This was based on using the original kernel #990 conversion of the LS 1 and not the Freelink project. It has been updated for use with Freelink 1.11 but requires run-throughs by others to check. USB and hotplug was/is a little flakey on 2.4 kernels in recognising devices. A reboot while the device is in should make things work. The 2.6 debian kernel is highly recommended if hot-swapping of usb devices might occur.
USB Removable Media: Automount
Note to kernel 2.4.17_mvl21-sandpoint #997 users (ships with Freelink 1.1.1): You need to move a few modules out of the way before you can continue:
mv /lib/modules/2.4.17_mvl21-sandpoint/kernel/drivers/scsi/scsi_mod.o /root/
mv /lib/modules/2.4.17_mvl21-sandpoint/kernel/drivers/scsi/sd_mod.o /root/
mv /lib/modules/2.4.17_mvl21-sandpoint/kernel/drivers/usb/storage/usb-storage.o /root/
Reboot when done.
Note to Linkstation HG users: You may also need to do this; adjust the paths to your needs.
I found this to be the easiest way to automount removable USB devices:
apt-get install autofs gawk wget bzip2 make wget http://myy.helia.fi/~karte/linux/doc/automatic-mounting-autofs-files/mounttero-0.5.tar.bz tar -xjf mounttero-0.5.tar.bz cd mounttero-0.5 make /etc/init.d/autofs restart apt-get remove gawk # this step is optional
The devices will be mounted automagically in /mnt/auto/, for example, /mnt/auto/usb/ in case of a typical USB thumb drive, and unmounted automagically after four seconds when unplugged.
Edit /etc/auto.tero and comment out all /dev/hda? entries:
#hda1 -fstype=auto,nosuid,nodev,user :/dev/hda1
#hda2 -fstype=auto,nosuid,nodev,user :/dev/hda2
#hda3 -fstype=auto,nosuid,nodev,user :/dev/hda3
#hda4 -fstype=auto,nosuid,nodev,user :/dev/hda4
Kernel 2.6 (Power PC)
This will add USB Drive automounting and mount USB drives to /media/usb0,1,2,3 etc. symbolic links in /mnt/share will also be created usb0,usb1,usb2,usb3 so that they will be accessable via your samba share
apt-get remove hotplug apt-get install usbmount
You should change the lines in /etc/usbmount/usbmount.conf to give you more universal access
- Line that starts FILESYSTEMS change to FILESYSTEMS="ext3 ext2 vfat"
- Line that starts MOUNTOPTIONS change to MOUNTOPTIONS="noexec,nodev,noatime"
- Line that starts FS_MOUNTOPTIONS change to FS_MOUNTOPTIONS="-fstype=vfat,umask=000"
These commands will create symbolic links will be into the shared filespace ( /mnt/share )
ln -s /media/usb0/ /mnt/share ln -s /media/usb1/ /mnt/share ln -s /media/usb2/ /mnt/share ln -s /media/usb3/ /mnt/share
Enjoy and please carefully comment if it doesn't work or changes needed.