I have a NAS (a Western Digital "My Book"). I connected it to my TP-Link Router via USB.It shows up in the TP-Link Router GUI no problem.
On my Ubuntu 20.04, I connected to it using the File Manager
smb://10.0.0.1/
and userid/password as required for TP-Link Router. And that all works just fine. I can create files and folders, and I can delete files and folders, no problem.
I also opened the drive in the "Files" app. And then right clicked on a directory called "backups" and selected "Open In Terminal" and it did. The working directory in that terminal is:
$ pwd/run/user/1000/gvfs/smb-share:server=10.0.0.1,share=g/backups
So that part works too. Great.
Now, I'd like to mount the drive (permanently so also need an fstab entry). Searching the 'net says to use:
sudo apt install cifs-utilssudo apt install keyutilssudo mkdir -p /mybooksudo mount -t cifs //10.0.0.1/g -o user=xxx,pass=yyy,vers=2.1 /mybook
I get:
mount error(2): No such file or directoryRefer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
dmesg says:
[552171.204549] CIFS: Attempting to mount //10.0.0.1/g[552171.214272] CIFS VFS: cifs_mount failed w/return code = -2
Searched the 'net and there are a lot of people saying that it works for them. So I am doing something wrong.
Here's some other things I've tried:
- with the File Manager connection set up and with it not connected, same failures
- tried it on Ubuntu 22.04, same failures
- tried vers=2.0, 1.9 and a few others; no errors, no warnings in dmesg, but no files or folders in /mybook
- tried smb://10.0.0.1/g with a warning about "smb", but that's expected, the workaround is to use //10.0.0.1/g
- tried //10.0.0.1 (i.e no "G:" drive), "mount error(22): Invalid argument"
- tried "-v", gives an extra line on the output, no clue why it's "no such file or directory"
- moved the "/mybook" parameter to different places, no joy
- adding trailing slashes "/mybook/" and "//10.0.0.1/g/", no joy.
- added ",domain=WORKGROUP" no joy.
- Also tried "dom=tplink" i.e. the "server name" specified in the tp-link router. no joy.
Any ideas for me to try?
Update:This almost works:
gio mount smb://10.0.0.1/gsudo ln -s "/run/user/1000/gvfs/smb-share:server=10.0.0.1,share=g" /mybook2cd mybook2
When I tried to create a file ("touch x.txt") I get:
/mybook2$ touch x.txttouch: setting times of 'x.txt': Permission denied
But the x.txt does exist and the time does get set:
$ ll x.txt-rwx------ 1 myuser myuser 0 Jan 19 21:12 x.txt*
I tried using sudo. This time the file does NOT get created:
rm x.txt$ sudo touch x.txttouch: cannot touch 'x.txt': Permission deniedll x.txt$ ll x.txtls: cannot access 'x.txt': No such file or directory
Note that creating a directory works just fine:
mkdir xll .
shows the directory is created and the time is correctly set.
Note that "gedit x.txt" works fine too. No warning about the time.
But rsync gets the same warning:
rsync -a ~/Documents/ /mybook2/Documents/rsync: failed to set times on "/mybook2/Documents/.": Is a directory (21)rsync: failed to set times on "/mybook2/Documents/Fritzing": Is a directory (21)etc.
Update: tried the following:
sudo nano /etc/fstab //10.0.0.1/g /mybook cifs username=admin,password=AppleJungle1-,rw,uid=1000,gid=500,vers=3.0sudo mount -a
got error:
mount error(2): No such file or directorydmesg[605786.944989] CIFS: Attempting to mount //10.0.0.1/g[605786.953870] CIFS VFS: cifs_mount failed w/return code = -2
- tried it with and without "/g"
- tried vers=2.0 and vers=3.0
- created a subdir
mkdir /mybook/g
and tried fstab with '//10.0.0.1/g' and '//10.0.0.1' and '//10.0.0.1/'. All failed in the same way - tried "/g" and "/G" no joy