A computer is not good enough if you can not extend it to storage. Raspberry Pi is best suited for USB sticks. However, those under Raspbian Wheezy are not automatically included, such as on Windows, Mac OS or other Linux systems. we will learn today How to mount a usb drive raspbian
Therefore, the possibility should be established that USB sticks are automatically integrated and that also files can be stored on it.
- Basics: mount /unmount volumes, drives, and file systems
- Automatically mount / unmount a USB stick or hard disk
- Set up the possibility that USB sticks are automatically “mounted” when plugged in.
- Make sure that you can also save files to the USB stick.
Raspbian auto mount usb drive
Solution: Automatically mount/unmount USB sticks (Raspbian Wheezy)
It is about a USB stick to “mount” automatically. This means “unmount” or “mount” so that you can access it via the directory system. To do this, we will install the software “usbmount”, which is specially designed to “automatically mount” USB sticks.
sudo apt-get install usbmount
After installation, a directory named “media” is created in the root directory. In it are further directories with the names “usb0” to “usb7”, as well as a link with the name “usb”, which points to “usb0”. If a USB stick is now plugged in, it is automatically mounted.
Unfortunately, one can not write to the USB sticks as a normal user. For this you have to configure a little something. To do this, open the following file.
sudo nano /etc/usbmount/usbmount.conf
Here you look for the following option:
FS_MOUNTOPTIONS = ""
and change it into
FS_MOUNTOPTIONS = "- fstype = vfat, gid = users, dmask = 0007, fmask = 0117"
Then save the file: Ctrl + O, Enter, Ctrl + X. Then reboot the system:
Then you have access as a user writing on the inserted USB sticks.
To test, insert a USB stick, create and save the following file.
Show if the file really exists:
cd /media/usb ls
Then you can delete the file: