If you want to run your Raspberry Pi as a Network-attached Storage (NAS), and let it run without a Desktop and without a Monitor attached (aka headless), you run into the trouble that a USB storage device of any kind isn’t automounted like you’re used to on your bigger Linux machine or if you start up the Desktop on the pi (with startx). In this case this howto is for you.
The Issue
If you attach an external storage on a Linux machine with a running GUI (Desktop) you’re used to that it-just-works. And compared to Windows machines, you don’t have to wait for any drivers to be installed and also that if you connect it another time to another time, you don’t have to wait for yet another installation annoyance. But if you connect the same device to a Linux system, or in this case a headless Raspberry pi, almost nothing happens. If you’re geeky enough you might still see in the syslog, that the system actually detects the device but you still would need to mount it by hand.
Supposingly the idea behind this is that if a Linux system is running headless, 99 out of 100 times it is running as some kind of server, where automounting a device that is attached might cause trouble. That’s why we need to set up the system, so that we get the beloved it-just-works experience, even though we’re not running the GUI.
The Fix
Thanks to a little piece of software called “usbmount” it’s fairly easy to make USB storage devices appear instantly when attached. Install it like this:
- Log into your Raspberry Pi
- Install usbmout by typing
- sudo apt-get install usbmount
- Reboot (not mandatory)
- DONE
If you connect a USB storage device now, you’ll find it at /media/usb. If you connect multiple devices, they will be mounted as /media/usb0, usb1, usb2 etc.
Speed Issues and mounting options
Checkout this howto if you’d like to speed up the reading and writing speed of the external device.
Post a Comment
0Comments