🌑

Linhost.info

Mount a USB Drive in Raspberry Pi With Read/Write Access- Linux

Because I tend to forget this is a simple way of mount a USB drive in Raspbian. Remember we are working with FAT/FAT32 formatted drive and permissions are handled differently in the case of a FAT drive permissions are not supported . First we need to find out how the system views our drive and partitions .

1
2
pi@raspberrypi:/mnt/usb $ ls /dev/sd\*
/dev/sda /dev/sda1

Create a mount point for the drive .

1
sudo mkdir /mnt/usb

Now that we know our drive is /dev/sda and the partition is /dev/sda1 we can proceed to mount . By making use of umask=000 we allow read, write and execute for all .

1
sudo mount /dev/sda1 /mnt/usb -o umask=000

Once mounted you can view the newly mounted drive and start writing to it .

1
2
3
4
5
6
7
8
9
10
11
pi@raspberrypi:/mnt/usb $ df -h

Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 11G 3.7G 75% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 463M 4.0K 463M 1% /dev/shm
tmpfs 463M 7.1M 456M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 463M 0 463M 0% /sys/fs/cgroup
/dev/mmcblk0p1 63M 21M 43M 34% /boot
/dev/sda1 30G 16K 30G 1% /mnt/usb

— Jan 23, 2017