[Solved] Automatically mount WD NAS

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
Iga007
White ninja
White ninja
Posts: 4
Joined: 26 Oct 2014, 20:05
Distribution: Porteus LXDE
Location: Hungary

[Solved] Automatically mount WD NAS

Post#1 by Iga007 » 26 Oct 2014, 20:28

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!
Last edited by Iga007 on 30 Oct 2014, 21:46, edited 1 time in total.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4614
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Automatically mount WD NAS

Post#2 by fanthom » 26 Oct 2014, 21:00

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>
) &
Please add [Solved] to your thread title if the solution was found.

Iga007
White ninja
White ninja
Posts: 4
Joined: 26 Oct 2014, 20:05
Distribution: Porteus LXDE
Location: Hungary

Re: Automatically mount WD NAS

Post#3 by Iga007 » 30 Oct 2014, 21:03

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!

User avatar
brokenman
Site Admin
Site Admin
Posts: 5558
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Automatically mount WD NAS

Post#4 by brokenman » 30 Oct 2014, 21:20

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.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Iga007
White ninja
White ninja
Posts: 4
Joined: 26 Oct 2014, 20:05
Distribution: Porteus LXDE
Location: Hungary

Re: [Solved] Automatically mount WD NAS

Post#5 by Iga007 » 30 Oct 2014, 21:43

It's working :Yahoo!:
The )& was missed

Post Reply