-1

This question already has an answer here:

I'm trying to mount my usb drive on my raspberry pi automatically, so that I don't have to redo it every time the device starts.

I followed the instructions here: https://www.raspberrypi-spy.co.uk/2014/05/how-to-mount-a-usb-flash-disk-on-the-raspberry-pi/

It works when I mount it manually.

However, when I try to follow the instructions for automating this process, it doesn't work. when i do sudo reboot as shown in the instructions I linked to, it wipes the usb drive, and then I have to mount it all over again in order to access my files.

I made double sure there are no typos in my file /etc/fstab or anything (I hope?). Here is the line in /etc/fstab:

UUID=DA0A-FB7B /media/usb exfat auto,nofail,noatime,users,rw,uid=pid,gid=pi 0 0

The only surprising thing during the mounting process was the message:

FUSE exfat 1.3.0
WARN: volume was not unmounted cleanly.

What am I doing wrong?

EDIT I realized one thing that I was doing wrong: I did not have the correct file type in UUID=DA0A-FB7B /media/usb exfat auto,nofail,noatime,users,rw,uid=pid,gid=pi 0 0. But I editted the /etc/fstab file to fix that. Now, after I reboot when I try to access /media/usb, it is telling me ls: cannot access 'usb': Transport endpoint is not connected. Is there another step I'm missing?

** second EDIT ** For some reason, when I remove the usb from the drive, and then insert it again, the automount works. So, every time I reboot the Pi, I need to remove the USB and insert it again. Not sure why but that was the trick (in addition to fixing the filesystem type, as I mentioned above).

marked as duplicate by Milliways, Fred, Ingo, Ghanima Oct 10 at 7:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I agree this question is a duplicate - what do I do about this? – Sother Oct 9 at 18:07
3

Try the usbmount package. sudo apt-get install usbmount

Read about it at: https://www.raspberrypi.org/forums/viewtopic.php?t=205016

Worked for me.

Regards, Jon G

2

If it works when you mount it manually you are probably missing the auto flag in the fstab configuration.

You should also use UUID instead of the device name (eg. /dev/sdb1). This way you won't have problems when using more than one USB drive.

(comment - Can't check any of this because you didn't include the line you've entered in fstab)

  • Thanks for your answer - I actually did include the auto flag, AFAICT, although perhaps you want to check what I posted in my question. – Sother Oct 9 at 17:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.