I rebooted my Raspberry Pi and discovered it has auto mounted the external hard drive under /media/pi/driveLabel! I had originally created a mount point at ~/USBHDD/ before the reboot.

How can I unmount from /media/pi and auto mount on ~/USBHDD/ every time I boot my Raspberry Pi? I'm running Raspbian Jessie.


You will need to tell your system that you want this drive mounted to the directory of your choice by modifying /etc/fstab:

/dev/sda1 /home/pi/USBHDD/ auto,users,rw,uid=pi,gid=pi 0 0

Or, if you want only a particular drive to be mounted there and happen to know its UUID:

UUID=XXXX /home/pi/USBHDD/ auto,users,rw,uid=pi,gid=pi 0 0

Here is a good tutorial on the subject in case you get lost or face issues.

  • 2
    /dev/sda is generally a block device node, and what you mount are partitions containing filesystems, e.g., /dev/sda1 -- although this then presumes the first partition (so the UUID option is probably better). – goldilocks Aug 16 '16 at 16:25
  • @goldilocks Thanks for a quick catch, that's exactly what I meant to write. – Dmitry Grigoryev Aug 16 '16 at 16:28
  • I think using UUID would be better approach, however how do I know UUID ? maybe sudo blkid – Ciasto piekarz Aug 17 '16 at 6:20
  • @Ciastopiekarz For starters try ls -l /dev/disk/by-uuid/ – Dmitry Grigoryev Aug 17 '16 at 6:42
  • @DmitryGrigoryev does /etc/fstb executes before /etc/rc.local ? – Ciasto piekarz Aug 20 '16 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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