Mounting MyCloud EX2 on a Linux desktop - using Samba

This post addresses how to mount using nfs http://community.wd.com/t5/WD-My-Cloud-EX2/Mounting-MyCloud-EX2-on-a-Linux-desktop/td-p/730120. For some reason it is closed so this is what I did to mount using samba.

sudo apt-get install cifs-utils

sudo nano /etc/fstab => add //192.168.1.12/share /mnt/share_nas    cifs    credentials=/etc/samba/.cred,sec=ntlm    0    0

Note that you wouldn’t do 192.168.2.10:/mnt/HD/HD_a2/share, just  //192.168.1.12/share.

/etc/samba/.cred is the usual

username=username
password=password

Also previously had problems accessing in Ubuntu nautilus after I suspended the computer but mounting the drives properly as per above solved the issue (as well as the most recent firmware upgrade).

1 Like

I have been doing the same thing but in reverse direction, that is mounting any CIFS share (i.e. any Windows, Mac or Linux shares) using Samba onto EX2 for almost a year now. I then copy/move files around. I have found this to be the fastest way to copy files to EX2 in some situations (especially data from a QNAP NAS that I also have). In EX2’s case cifs (Samba) is already installed and running, so you don’t have to worry about installing it. The only problem is that you get a “Permission denied” error when issuing a sudo command. But I have found a way to get around it.

To get around the limitation, I have created a script that temporarily allows me sudo access and when I am done, I have another script to reverse my sudo sccess changes because I do not like to retain this sudo access once I am done with whatever I needed sudo for.

So to enable sudo access in SSH, you first make this one time change (until next EX2 reboot - it will be reversed if you reboot EX2 because /etc directory is recreated from scratch):

Type ‘visudo’ to edit the /etc/sudoers file on EX2 using vi. Then edit the line for root under {# User privilege specification" to be:

root ALL=(ALL) NOPASSWD: ALL

After you have made the above one-time change in vi, you are then ready to create the two scripts I talked about above.

Script 1 - enables sudo access (named it grant_sudo.sh):

#!/bin/sh

cp /usr/local/modules/lib/sudoers.so /usr/local/config/

chown root:root /usr/local/config/sudoers.so

rm /lib/sudoers.so

ln -s /usr/local/config/sudoers.so /lib/sudoers.so

Script 2 - disables sudo access (named it revoke_sudo.sh):

#!/bin/sh

rm /lib/sudoers.so

rm /usr/local/config/sudoers.so

ln -s /usr/local/modules/lib/sudoers.so /lib/sudoers.so

To mount any CIFS share (i.e. Windows or Mac shares) on the EX2 you will need to:

  1. Run grant_sudo.sh

  2. Create a mount point with the command ‘mkdir /mnt/cifs’

  3. Mount the CIFS share with the command:
    sudo mount -t cifs //<share server’s IP>/ /mnt/cifs -o username=XXXX,password=YYYY

where username and password are the remote computer’s login credentials

  1. Run revoke_sudo.sh

Now you can move files and folders around between /mnt/cifs and EX2 directories located at /mnt/HD/HD_a2/

If this helps you, please click the star under my username to give me a kudo.

Sorry I am not too good with the WD Clound EX2 and Ubuntu. Is this meant for the privately share folders on WD?

I am having problem connecting to the private folders…

…Is this meant for the privately share folders on WD?..

Yes, but only to EX2 shares that you have permissions to read (or write).

…I am having problem connecting to the private folders…

Without seeing the exact error message (assuming you tried what was documented in the first post above), we have no idea what your problem is exactly. And if it is a general Linux question, like, sudo isn’t working for you…well, then try to google search for such questions.