Page 1 of 1

[Solved] Automatically mount WD NAS

Posted: 26 Oct 2014, 20:28
by Iga007
Hello guys,
I would need help how to automatically mount my newly bought WD myCloud NAS.
As I'm in Linux I might be need more explanation.
Since 2014.02 I'm using Porteus for mainly web browsing and it's fine for me.
Now I would like to reach my files on the NAS and always useing the embeded "Mount drives" application is getting uncomfortable.
I can mount manually using that application but now I would like to know how to make it automatically mounted only the Public partition of my NAS.
Using fix ip address (192.168.0.200) for the NAS, usallly I'm typing to being mounted into the /mnt/NAS/Public.
Any solution? Thanks in advance!

Re: Automatically mount WD NAS

Posted: 26 Oct 2014, 21:00
by fanthom
i would go with /etc/rc.d/rc.local. something like here (update mount.cifs with your parameters):

Code: Select all

(
net=no
while [ $net = no ]; do ping -c1 192.168.0.200 >/dev/null && net=yes; done
mount.cifs <remotetarget> <dir> -o <options>
) &

Re: Automatically mount WD NAS

Posted: 30 Oct 2014, 21:03
by Iga007
Unfortunatelly this is not working for me :wall:
It seems the script inside the /etc/rc.d/rc.local runs before the desktop loaded and lots of network not connected like message scrolls down on the screen...
I'm using wifi and the connection is start approx 10sec later than the desktop is loaded...
I'm tried with LAN connection result is the same, connection only established after desktop is loaded.
Any other idea?
Thanks in advance!

Re: Automatically mount WD NAS

Posted: 30 Oct 2014, 21:20
by brokenman
Did you put the exact script that fanthom posted? This will loop until a connection is found before mounting. Another option is to use the 'autostart' folder for your desktop (search google for technique). This will at least wait until the desktop is up before pinging.

Does the NAS drive run linux? Perhaps you can open an ssh daemon on it and mount it over ssh. This is what I do.

Re: [Solved] Automatically mount WD NAS

Posted: 30 Oct 2014, 21:43
by Iga007
It's working :Yahoo!:
The )& was missed