JohnyClassic Posted June 28, 2021 Share Posted June 28, 2021 I'm having trouble setting up permanent access to an Unraid share from an Ubuntu Server VM. Setting up the share in the VM settings seems to prevent me from connecting to it via SSH so instead I've been trying to mount it over the network. This works in order to mount once: sudo mount -t cifs -o username=username,password=password //serverip/share /media/share/ But I'd like it to automatically mount on reboot. And when I mount it using the method above, I can only write to the share using root privileges. So I created a an ~/.smbcredentials file, set the chmod permissions and added the following to the /etc/fstab file: //serverip/share /media/share cifs uid=ubuntuuser,credentials=/home/ubuntuuser/.smbcredentials,iocharset=utf8,sec=ntlm 0 0 But this doesn't seem to automatically mount the share after reboot. Does anyone know how to get the share to auto mount after reboot with full read and write permissions? Thanks! Quote Link to comment
ghost82 Posted June 28, 2021 Share Posted June 28, 2021 (edited) 6 hours ago, JohnyClassic said: But this doesn't seem to automatically mount the share after reboot. Once you edit fstab try it with: sudo mount -a Does it show no errors? 6 hours ago, JohnyClassic said: uid=ubuntuuser Did you use uid=1000 ? What is the format of the content of .smbcredentials? Edited June 28, 2021 by ghost82 Quote Link to comment
JohnyClassic Posted June 28, 2021 Author Share Posted June 28, 2021 8 hours ago, ghost82 said: Once you edit fstab try it with: sudo mount -a "mount error(2): No such file or directory" Quote Did you use uid=1000 ? No I didn't, I thought I was supposed to add the Ubuntu username. Although, after adding that I'm still getting the above error. Quote What is the format of the content of .smbcredentials? username=username password=password Quote Link to comment
ghost82 Posted June 28, 2021 Share Posted June 28, 2021 (edited) 1 hour ago, JohnyClassic said: "mount error(2): No such file or directory" No I didn't, I thought I was supposed to add the Ubuntu username. Although, after adding that I'm still getting the above error. username=username password=password No by uid you need to specify the user id, i.e. a number. uid 1000 is the first non root user. As far as .smbcredentials, add also the domain: username=myUser password=myPass domain=WORKGROUP Of course, put a real user, a real password and a real domain. Make sure that the mounting point, i.e. the folder, already exists on your guest (/media/share/). Always respect capital and non capital letters. I would also add a / after share in the fstab: not sure it's mandatory but share is a folder so I would specify it by /media/share/ instead of /media/share Edited June 28, 2021 by ghost82 Quote Link to comment
JohnyClassic Posted June 29, 2021 Author Share Posted June 29, 2021 21 hours ago, ghost82 said: No by uid you need to specify the user id, i.e. a number. uid 1000 is the first non root user. As far as .smbcredentials, add also the domain: username=myUser password=myPass domain=WORKGROUP Of course, put a real user, a real password and a real domain. Make sure that the mounting point, i.e. the folder, already exists on your guest (/media/share/). Always respect capital and non capital letters. I would also add a / after share in the fstab: not sure it's mandatory but share is a folder so I would specify it by /media/share/ instead of /media/share I updated it all with everything you noted above. I'm still getting "mount error(2): No such file or directory". Quote Link to comment
JonathanM Posted June 29, 2021 Share Posted June 29, 2021 What are the permissions and owner of /media/share? Quote Link to comment
JohnyClassic Posted June 29, 2021 Author Share Posted June 29, 2021 23 minutes ago, jonathanm said: What are the permissions and owner of /media/share? It was (0755/drwxr-xr-x) and root. I tried changing it to (0777/drwxrwxrwx) and to the Ubuntu user but I'm still getting the error. Are there specific permissions I should set? looks like the workgroup is still set to root. I'm not sure if that matters. Quote Link to comment
JonathanM Posted June 29, 2021 Share Posted June 29, 2021 Try adding vers=1.0 to the fstab line Quote Link to comment
JohnyClassic Posted June 29, 2021 Author Share Posted June 29, 2021 1 hour ago, jonathanm said: Try adding vers=1.0 to the fstab line That worked! Thanks so much for the help guys. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.