March 10, 2017

Raspberry Pi mount exFAT Flash Drive as storage

Goal

Mount USB flash drive to RPi.

I can use large SD card, but:
(1) I already have a small SD card I want to re-use, and want to separate OS and data.
(2) I want to back up/store from Windows for data files.
(3) large capacity flash drive is cheap.

Environment

  • Windows 10 64bit
  • RPi, Raspbian Jessie Lite

Mount exFAT USB Flash Drive

I have 64GB USB flash drive that is exFAT pre-formatted.
  1. sudo apt-get install exfat-fuse
  2. sudo reboot
  3. Pug in the USB flash drive
  4. sudo lsblk --output NAME,FSTYPE,LABEL,UUID,MODE
    • Take note of the UUID value for the flash drive
Manual mount:
  1. sudo ls -l /dev/disk/by-uuid/
    • Find the UUID link.  e.g. "DCBD-4FCC -> ../../sda1"
  2. sudo mkdir /mnt/usbstorage
  3. sudo mount uid=pi,gid=pi /dev/sda1 /mnt/usbstorage

Auto mount:
  1. sudo vi /etc/fstab
  2. Add this line:
    UUID=DCBD-4FCC /mnt/usbstorage  exfat   nofail,uid=pi,gid=pi    0       0
    • change UUID value with yours
  3. sudo reboot

Note: since it's exFAT, you can't create sym link in this drive, and linux permission doesn't work.


No comments:

Post a Comment