1

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.

1 Answer 1

2

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.

6
  • 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, 2016 at 16:25
  • @goldilocks Thanks for a quick catch, that's exactly what I meant to write. Aug 16, 2016 at 16:28
  • I think using UUID would be better approach, however how do I know UUID ? maybe sudo blkid Aug 17, 2016 at 6:20
  • @Ciastopiekarz For starters try ls -l /dev/disk/by-uuid/ Aug 17, 2016 at 6:42
  • @DmitryGrigoryev does /etc/fstb executes before /etc/rc.local ? Aug 20, 2016 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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