Skip to content

Instantly share code, notes, and snippets.

@noelje
Created March 21, 2021 12:41
Show Gist options
  • Save noelje/2b359a0f093c2c2861f8fb2825307548 to your computer and use it in GitHub Desktop.
Save noelje/2b359a0f093c2c2861f8fb2825307548 to your computer and use it in GitHub Desktop.
Mount a USB: Raspberry Pi
Re: How do you mount a USB Drive?
Quote
Fri Mar 22, 2013 10:55 pm
If you
sudo nano /etc/fstab
then add the line to the end
/dev/sda2 /mnt/usb vfat defaults 0 2
it should mount at boot, assuming the sda2 does not change, which it can if other drives exist at boot up.
A better option is to use uuid instead of /dev/
the uuid can be found using the following
ls -l /dev/disk/by-uuid/
or gparted has the same info
then your fstab line would start
UUID=long_hex_number_from_previous_command /mnt/usb vfat defaults 0 2
Using that method means it doesn't matter whether your drive comes up as sda1 or sdb2 or whatever if another drive is in when the Pi is booted.
I've always used uuid on all of my computers.
Stu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment