2

i have an external hard drive connect to my TP-Link router and shared using USB Share, i am unable to connect to this Share from Ubuntu, i can only see shared volumes but can't gain access. I can connect to it from Windows and even from my Android device using X-plore File Manager. What can i do ?

My router is old and it supports only SMBv1 shares.

proless8
  • 25
  • 1
  • 4
  • Whats the error when you enter the password? – jamalm Dec 18 '18 at 11:12
  • @jamalm noting just same dialog reopens and asks me to enter user and password again – proless8 Dec 18 '18 at 11:59
  • It could be that you are entering the wrong password. The GUI doesn't tell you when you entered the wrong credentials, try to enter a wrong password to confirm my suspicion, it will probably just pop up again aswell. Try to create a new user from the TP-Link so you are sure of the password. According to the second image it states in the right-hand side that the passwords are not displayed for security reasons so chances are that the passwords there aren't the real passwords. – jamalm Dec 18 '18 at 12:13
  • 1
    i am using the guest user account on my android device as well as Windows and it is working ! – proless8 Dec 18 '18 at 12:16
  • Okay well that is strange. I'm going to detail an answer with steps to mount the smb share through the fstab file. Do try it and let me know the results. You will need root access to edit this file. – jamalm Dec 18 '18 at 12:21

2 Answers2

1

Try to mount the smb share through your fstab file. You will need root access to do this. Start by opening a command line terminal and typing su -. If you do not know the root password try sudo su - and enter your own user account's password.

Open the /etc/fstab file through gedit or whatever text editor you are comfortable with, we'll go with gedit because its the default on ubuntu: gedit /etc/fstab.

Go to the end of the file on a new line and enter the following:

//192.168.0.254/volume1 /media/windowsshare cifs username=user,password=pass 0 0

substituting user and pass with the username and the password you used to log in. You can also substitute windowsshare with whatever name you wish.

Now save and exit the editor. Navigate to /media/ and create the folder that you named in the fstab, so in our case here we do the following:

  • cd /media

  • mkdir /media/windowsshare

Now try to mount the share from the fstab by typing:

mount -a

This command tells ubuntu: "Mount all filesystems defined in /etc/fstab" so it should pick up the new entry.

If there are no errors, we are golden! If there are, do let me know.

A common error could be that Ubuntu does not have mount.cifs. In this event go back to the terminal (as root) and type apt-get install cifs-utils. This will allow you to mount smb shares onto your system.

To find the files in your file browser go to File System -> media -> windowsshare.

jamalm
  • 199
  • 4
  • 14
  • it didn't work i get this error : mount error(112): Host is down Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) – proless8 Dec 18 '18 at 12:54
  • try adding vers=1.0 to the /etc/fstab file so: `//192.168.0.254/volume1 /media/windowsshare cifs vers=1.0,username=user,password=pass 0 0` – jamalm Dec 18 '18 at 13:11
  • 1
    thanks it is working fine now. will it be auto mounted after reboot ? – proless8 Dec 18 '18 at 13:15
  • Yes as long as there is an entry in the fstab, ubuntu will always try to mount that filesystem. I feel i should mention the security risk associated with having a password visible in the `/etc/fstab`, all users can read the password to that mount, it should be okay as long as no one is accessing your machine. to see what i mean, you can type in the terminal `cat /etc/fstab` and it displays the username and password in plaintext to the mount. To hide this, it requires a bit more configuration. If you want i can edit the answer to include the more secure method, otherwise, glad i could help! – jamalm Dec 18 '18 at 13:20
  • 1
    last thing the share didn't automount on reboot i have to add **x-systemd.automount** to fstab, but now it see the mount both under Devices (as a hard drive) and Network (as folder), can i change this ? – proless8 Dec 19 '18 at 17:22
  • 1
    I'm not too sure on the x-systemd.automount inside the fstab, i've never had to do something like that. As for the double appearance, it will appear under Devices because you have it mounted through the FileSystem Table (fstab) and it will appear over the network because it is available over the network. IT shouldn't cause any issues. Just ignore the network one and things should be fine. I don't think you can remove it from Network explicitly, not as far as i know at least.. hope this helps – jamalm Dec 20 '18 at 10:51
1

Had the same problem many times with TPLink routers, they really don't do Linux. The below is from my Archer VR600 set up, but very similar worked with a 8980

I mount my drive with an alias in my ~/.bashrc file

alias mount-smb='mount -t cifs //192.168.1.1/volume\(sda1\) /mnt -o vers=1.0'

Confusingly the volume is called 'volume(sda1)', despite there being no support for Linux, hence the escaping of the parentheses in the bash command.

Then even more confusingly the drive is listed in the router setup as G: which can be ignored, it is not even used in windoze.

You need to access your router in advanced mode and check exactly what the volume name is, it varies wildly between different models and firmware versions.

This command mounts to /mnt and specifies version 1.0 to ensure compatibility.

You will be asked for the password for the account you set up when enabling smb access to the USB drive.

Arceye
  • 11
  • 2