I'm on Debian 8.1 and trying to mount a network drive (WD MyCloud) on startup. At first I added the following to /etc/fstab:
192.168.1.101/the_red_drive /media/the_red_drive cifs uid=fossi,credentials=/home/fossi/.smbcredentials
While this worked initially, it ended up causing interrupting the boot process and opening an emergency session. From some research I did, it seems to be caused by the command being run prior to the network being set up properly.
I then followed this guide adding the following to /etc/init.d/fossi_startup:
#!/bin/bash ### BEGIN INIT INFO # Provides: fossi_startup # Required-Start: $remote_fs $syslog $network # Required-Stop: $remote_fs $syslog $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Enable service provided by daemon. ### END INIT INFO mount -t cifs -o uid=fossi,credentials=/home/fossi/.smbcredentials \ //192.168.1.101/the_red_drive /media/the_red_drive
I then ran the following commands as per guide:
sudo chmod +x /etc/init.d/fossi_startup.sh sudo update-rc.d fossi_startup.sh defaults 100
However this doesn't seem to execute or at least doesn't execute successfully. How can I run the mount on startup without interfering with the boot process?