I mounted my USB stick as
I formatted the disk to ext4 as it provided a good read/write speed compared to FAT (and I don’t plan on removing the drive anyway as I backup ROMs over the network).
Then I found the drives unique ID (UUID) with this command
once before I plugged in the drive and once after to see which uuid appeared. Once I knew the uuid I opened the fstab file:
sudo nano /etc/fstab
which opened as
proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults 0 2 /dev/mmcblk0p2 / ext4 defaults,noatime 0 1 # a swapfile is not a swap partition, no line here # use dphys-swapfile swap[on|off] for that
/dev/mmcblk0p2 I added the line
UUID=44916713-0138-40f9-a7de-68266894bd20 /home/pi/RetroPie/roms auto defaults 0 2
this line is the UUID found in above, then the directory I want it to mount at,
auto means automatically decide the filesystem,
defaults is the default rw access (and some other stuff),
0 means don’t backup and
2 is the order for error checking. (See https://help.ubuntu.com/community/Fstab for more details).
Next you need to delete the current contents on the
/rom/ directory (make sure you have backups!!) so that it is empty – mounting devices needs to have empty mount points. I used WinSCP as it was easier than using the command line.
/rom/ directory is empty you just need to tell the system to remount the drives with
sudo mount -a
if you then type
df -h you should see something like
Filesystem Size Used Avail Use% Mounted on /dev/root 15G 2.7G 12G 20% / devtmpfs 364M 0 364M 0% /dev tmpfs 368M 0 368M 0% /dev/shm tmpfs 368M 5.3M 363M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 368M 0 368M 0% /sys/fs/cgroup /dev/mmcblk0p1 57M 20M 38M 35% /boot /dev/sda1 59G 3.8G 52G 7% /home/pi/RetroPie/roms
Maybe not the best way but works for me. One word of warning you have to unmount the drive manually if you want to take it out! Without doing it you will most likely end up with errors or data corruption. If the Pi is off then there is no issue taking it out.
Although I formatted the drive to ext4 there is no reason why you couldn’t format it as FAT and then you could still access it with a Windows PC to.
Not sure if this helps but was my solution 😀