[SOLVED] How to map a WD NAS?

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
George16
Level 1
Level 1
Posts: 7
Joined: Sun Jul 01, 2018 4:08 am

[SOLVED] How to map a WD NAS?

Post by George16 » Sun Aug 26, 2018 10:14 am

A few months ago I changed from Windows to Linux Mint 18.3, Cinnamon. Now I want to synchronize my favourite folders, as I did earlier under Windows. Therefore I have a NAS, a Western Digital My Book Live. But I have a problem.
When I want to approach the NAS with the Nemo file manager, it is easy: just click on Network, select the NAS, give a username and password and I'm there. In the file manager I see the following path: afp://MyBookLive.local/. But with the few sync programs that I tried (such as FreeFileSync and LuckyBackup), this is not possible. There is no Network option to find the right path. I think this is a mounting issue. But I have already done many mounting attempts, but they all fail.

I used the following command (but there are many alternatives and options possible):

Code: Select all

sudo mount -t cifs //192.168.178.17/shares/Public /mnt/shares/Public
The result is mostly: File or directory doesn't exist.

The IP-address is the one of the NAS. The mounting point is existing. The NAS is a debian system and the directory /mnt/shares/Public exists. At WD they give hardly any support for Linux questions.

Does someone recognizes this problem? Is there someone who can help me?
Last edited by George16 on Thu Aug 30, 2018 10:57 am, edited 1 time in total.

altair4
Level 19
Level 19
Posts: 9278
Joined: Tue Feb 03, 2009 10:27 am

Re: How to map a WD NAS?

Post by altair4 » Sun Aug 26, 2018 11:56 am

I hate working with these NAS devices because you never know how up to date everything is on it.
sudo mount -t cifs //192.168.178.17/shares/Public /mnt/shares/Public
Is "shares" the entity that was shared and Public is a subfolder? Or is Public the entity that was shared? THere should be a way to find out using this command:

Code: Select all

smbclient -L MyBookLive.local
Or a smbclient -L 192.168.178.17

If it's the latter the syntax would be:

Code: Select all

sudo mount -t cifs //192.168.178.17/Public /mnt/shares/Public
There are 2 other options that play a role: sec and vers and the kernel level you are running on Mint affects this as well. My suggestion is a trial and error approach.

Start with the the oldest settings:

Code: Select all

sudo mount -t cifs //192.168.178.17/Public /mnt/shares/Public -o sec=ntlm,vers=1.0
Then drop the sec option, then change vers to 2.0, 2.1, and finally 3.0.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

George16
Level 1
Level 1
Posts: 7
Joined: Sun Jul 01, 2018 4:08 am

Re: How to map a WD NAS?

Post by George16 » Mon Aug 27, 2018 10:01 am

You wrote:
I hate working with these NAS devices because you never know how up to date everything is on it.
Maybe interesting: I am able to look into the NAS with a SSH command. Then I can look into the NAS system with a terminal and see all the versions (if you know the commands). It's a Debian system.
The entity that was shared is Public. This is a standard share without user name and password. Besides this standard share I have some private shares protected with user name and password. One of them is PCgeorge.
I used the following command:

Code: Select all

sudo mount -t cifs //192.168.178.17/Public /mnt/shares/Public -o sec=ntlm,vers=1.0
and wow: it worked! Now the Public share is mounted and I have access to it as desired. But I needed a general password.
Then I tried to do the same to mount the share PCgeorge with the following command. This is actually a much more interesting share for me:

Code: Select all

sudo mount -t cifs //192.168.178.17/PCgeorge /mnt/shares/PCgeorge -o sec=ntlm,vers=1.0
but then the password is refused, what I don't understand. I used several passwords for several attempts.
For now it's enough for a moment. Maybe you have a suggestion how to continue.

altair4
Level 19
Level 19
Posts: 9278
Joined: Tue Feb 03, 2009 10:27 am

Re: How to map a WD NAS?

Post by altair4 » Mon Aug 27, 2018 10:36 am

George16 wrote:
Mon Aug 27, 2018 10:01 am
I used the following command:

Code: Select all

sudo mount -t cifs //192.168.178.17/Public /mnt/shares/Public -o sec=ntlm,vers=1.0
and wow: it worked! Now the Public share is mounted and I have access to it as desired. But I needed a general password.
If you add another option to your list you should not be prompted for credentials to access a Public share: guest

Code: Select all

sudo mount -t cifs //192.168.178.17/Public /mnt/shares/Public -o guest,sec=ntlm,vers=1.0
Then I tried to do the same to mount the share PCgeorge with the following command. This is actually a much more interesting share for me:

Code: Select all

sudo mount -t cifs //192.168.178.17/PCgeorge /mnt/shares/PCgeorge -o sec=ntlm,vers=1.0
but then the password is refused, what I don't understand. I used several passwords for several attempts.
That one I don't understand either. Um ... if the NAS were just another Linux box running samba my first thought would be that the user name you are passing from Mint has not been added to the samba password database on the NAS.

For example on the NAS:

Code: Select all

sudo smbpasswd -a george
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

George16
Level 1
Level 1
Posts: 7
Joined: Sun Jul 01, 2018 4:08 am

Re: How to map a WD NAS?

Post by George16 » Mon Aug 27, 2018 11:15 am

The guest suggestion works fine.
I tried to change the password (yes there is a user George!):

Code: Select all

sudo smbpasswd -a George
New SMB password:
Retype new SMB password:
Failed to add entry for user George.
I tried to include the user name and password in the mount command, but that didn't work:

Code: Select all

sudo mount -t cifs //192.168.178.17/PCgeorge /mnt/shares/PCgeorge -o sec=ntlm,vers=1.0,username=xxxx,password=yyyy
The result was some 50 lines of help text for the mount command.

altair4
Level 19
Level 19
Posts: 9278
Joined: Tue Feb 03, 2009 10:27 am

Re: How to map a WD NAS?

Post by altair4 » Mon Aug 27, 2018 11:43 am

I don't know about Debian but in Ubuntu you can't create a user name with upper case letters:
tester@vub1804:~$ sudo adduser George
adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX[_SYSTEM] configuration variable. Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.

tester@vub1804:~$ cat /etc/adduser.conf | grep NAME_REGEX
#NAME_REGEX="^[a-z][-a-z0-9_]*\$"
Are you sure yu don't have the user name george instead:

Code: Select all

id george
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

George16
Level 1
Level 1
Posts: 7
Joined: Sun Jul 01, 2018 4:08 am

Re: How to map a WD NAS?

Post by George16 » Mon Aug 27, 2018 1:00 pm

Are you sure yu don't have the user name george instead:

Code: Select all

id george
See both results:

Code: Select all

$ id george
id: ‘george’: unknown user
$ id George
id: ‘George’: unknown user
I'm sure the user name is George. But I tried to change the password for george, same result:

Code: Select all

sudo smbpasswd -a george
New SMB password:
Retype new SMB password:
Failed to add entry for user george.
But maybe this hasn't to do with an SMB password. The user name George is defined in the administration software of My Book Live. I don't know how this works out in the file system software.

altair4
Level 19
Level 19
Posts: 9278
Joined: Tue Feb 03, 2009 10:27 am

Re: How to map a WD NAS?

Post by altair4 » Mon Aug 27, 2018 1:29 pm

I don't know what to tell you but based on your last post you don't have a user named george regardless of capitalization.

Run the following on the NAS:

Code: Select all

cat /etc/passwd | grep eorge
Does George, george, or perhaps pcgeorge show up?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

George16
Level 1
Level 1
Posts: 7
Joined: Sun Jul 01, 2018 4:08 am

Re: How to map a WD NAS?

Post by George16 » Tue Aug 28, 2018 4:29 am

Run the following on the NAS:

Code: Select all

cat /etc/passwd | grep eorge
Does George, george, or perhaps pcgeorge show up?
I connected with SSH to the NAS. Then I entered the following command:

Code: Select all

MyBookLive:~# cat /etc/passwd | grep eorge
George:x:1000:1000:George,2,,:/shares:/bin/sh
Does this help to find the right mount command?

altair4
Level 19
Level 19
Posts: 9278
Joined: Tue Feb 03, 2009 10:27 am

Re: How to map a WD NAS?

Post by altair4 » Tue Aug 28, 2018 7:57 am

I do not know. I don't know how the NAS is doing samba.

If I do a google search of MyBook private shares everyone is accessing it with the user name of "admin" ...
sudo mount -t cifs //192.168.178.17/PCgeorge /mnt/shares/PCgeorge -o sec=ntlm,vers=1.0,username=admin,password=yyyy
I suppose that might work if admin is also George but what about all the oher clients to this system.

This looks more like a question for WD.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

George16
Level 1
Level 1
Posts: 7
Joined: Sun Jul 01, 2018 4:08 am

Re: How to map a WD NAS?

Post by George16 » Wed Aug 29, 2018 8:40 am

Yes, I found the solution !!! It is

Code: Select all

sudo mount -t cifs //192.168.178.17/PCgeorge /mnt/shares/PCgeorge -o vers=1.0,username=George,password=yyyy,rw
The option vers=1.0 is essential, thanks to Altair4. The option sec=ntlm is not necessary. I made a mistake by adding spaces after the option comma's, that is not allowed.
The only problem now is the fact that I can read the files in the mounted directories, but I may not write to them. Although the mount should be default rw I added the rw option. But this didn't help. Have you any idea?

altair4
Level 19
Level 19
Posts: 9278
Joined: Tue Feb 03, 2009 10:27 am

Re: How to map a WD NAS?

Post by altair4 » Wed Aug 29, 2018 8:47 am

Take possession of the mounted share:

[1] Unmount it first:

Code: Select all

sudo umount /mnt/shares/PCgeorge
[2] Then change the mount to this:

Code: Select all

sudo mount -t cifs //192.168.178.17/PCgeorge /mnt/shares/PCgeorge -o vers=1.0,username=George,password=yyyy,rw,uid=1000,nounix
Note: uid=1000 will make the mounted share owner you - if your uid is 1000. To verify the uid number run:

Code: Select all

id
And you really don't need the rw option. There is no harm in keeping it there however.

EDIT: Might as well offer a variation that will allow every local Mint user or process access to the share:

Code: Select all

sudo mount -t cifs //192.168.178.17/PCgeorge /mnt/shares/PCgeorge -o vers=1.0,username=George,password=yyyy,rw,uid=1000,file_mode=0777,dir_mode=0777,nounix
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

George16
Level 1
Level 1
Posts: 7
Joined: Sun Jul 01, 2018 4:08 am

Re: How to map a WD NAS?

Post by George16 » Wed Aug 29, 2018 9:13 am

This works great ! Thank you Altair4 for all your help.

Post Reply

Return to “Other networking topics”