I recently ran into a problem where my mount in fstab caused my entire Pi to stop working when my external hard drive was not plugged in.
It would get stuck on the emergency mode and ctrl+D would not allow me to progress.
So I added the nofail option to the mount in my /etc/fstab file but this has caused the mount to happen after my program starts even when present.
My program is run from /etc/rc/local.
Any help to get around this would be greatly appreciated. I want to be able to mount the drive before my program runs but allow it to fail if the drive is not present.
This is my fstab:
Code: Select all
proc /proc proc defaults 0 0
/dev/mmcblk0p5 /boot vfat defaults 0 2
/dev/mmcblk0p6 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
/dev/sda1 /mnt ntfs defaults 0 0
Code: Select all
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
#sudo /home/pi/GPIO/LCDTest1/LCDTest1
(
cd /home/pi/projects/RaspberryPiPlayer/bin/ARM/Debug/
sudo /home/pi/projects/RaspberryPiPlayer/bin/ARM/Debug/RaspberryPiPlayer.out &
)
exit 0