This is a basic script, adapt the values and add what you want Sudo mount /dev/sda1 /mnt/usb -o uid=pi,gid=pi echo "USB drive mounted successfully" This will save you searching this page next time ? Create a small script
Sudo umount /mnt/usb Create a small script to save your preferencesĮven if this was the manual way to mount a USB drive, I recommend saving this in a script if you are not familiar with this kind of command. If you want to remove the USB key, you can dismount it with: The uid and gid options allow pi to read and write files on the USB keyĪnd then check you can see your files and create a new one: Sudo mount /dev/sda1 /mnt/usb -o uid=pi,gid=pi In my case, I want to mount /dev/sda1 to /mnt/usb.
The mount command allows us to mount a device on a specific folder.
In this part, we’ll see how to mount a USB drive quickly on the Raspberry Pi. – automatically: need more configuration to start, but this will be automatic next times Manually mount the USB drive
– manually: for fast access on temporary devices Now, we can mount the USB drive with two methods: Generally, we create it in /mnt or /media. On Linux systems you need to create a new folder to mount the drive in it later. Note the UUID just before the drive name (it could be longer depending on your disk). This allows us to know this a known drive and do something specific when you plug it on your Raspberry Pi.įind the line corresponding to your drive name (sda1 for example). When you format a disk, the system assign an ID to the disk.
sudo apt install ntfs-3g Plug your deviceįor big external drives, you will need extra power to run the drive correctly (“Under-voltage detected!” will appear in the terminal). And if you are working with NTFS drives, check that you have the required package installed (NTFS is mainly for Windows devices and may not be required in your case).