I have following setup: Raspberry Pi 2 Raspbian Jessie Powered USB hub external 2.5" hard disk Problem: If I have Raspberry powered up and connect HDD to USB hub, I can mount it with no problems. It works with sudo mount and I have added it to /etc/fstab also and with command "sudo mount -a" it works as supposed. But if I reboot Raspbian, it cannot mount drive from fstab. Boot process stops from 1min 30 sec, and it tries to mount /dev/sdb1.device (or UUID=xxxx, I have tried that also). USB flash stick mounts normally. Is there maybe some reason, that some external HDDs don't communicate with boot process or what's the matter?
My [educated] guess: the HDD is not active until later in the boot or after the boot
sudo crontab -e -u pi
and then add this line at the very bottom of the file:
@reboot sleep 30 && sudo mount /dev/disk/by-uuid/[UUID OF YOUR HDD] /path/to/where/you/want/it/mounted
[UUID OF YOU HDD] with the UUID of your Hard Drive, obviously.
This causes the HDD to be mounted 30 seconds after boot, to make sure that the HHD is active. If this does not work, try changing the delay to 60.
First you need to find out UUID of your disk by following command
sudo blkid Note your disk UUID.
Now open fstab file with gedit
sudo gedit /etc/fstab Replace your old disk UUID with your noted UUID. Save file and reboot your system. You will be able to mount disk.
I found this answer which worked for me. I did not have to do cron job and waith 30 seconds.