Rename a SMB volume on Mint 19

Forum rules
Before you post please read this
Post Reply
Nicko
Level 1
Level 1
Posts: 5
Joined: Tue Nov 13, 2018 8:12 am

Rename a SMB volume on Mint 19

Post by Nicko » Tue Nov 13, 2018 8:19 am

Greetings,

Working as system admin and maintaining some old computers in my work place I have installed Mint 19 Cinnamon desktop on a client desktop since its a lightweight OS and still modern and very functional for all the tasks that a user needs but i came across a small issue when i had to "mount" some network volumes (SMB volumes).
We use a NAS device where the most users work with their files and so many clients desktops must have permantly mounted 3 or 4 SMB volumes/partitions of the NAS device.
However when i mount (even temporary) a SMB volume i cant rename it and i dont want the users to be able to the ip address of the SMB volume on the shortcut on the desktop or on the file manager since the name of the mounted smb volume contains the ip of the nas.
What can i do so i can mount permantly (even after a reboot of the pc) these volumes of my NAS device and with the names that i like.

Thank you in advance!

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

Re: Rename a SMB volume on Mint 19

Post by altair4 » Tue Nov 13, 2018 2:00 pm

You might not want them to automount.

Give this a shot: On Demand CIFS Mounting of Shares

The concept here is you create a mount point under /media or the users home directory and use cifs not gvfs ( which the file manager uses ). Then the name of the share displayed in the file manager will match the name of the mount point.

The process described above is a mount on demand not an automount. You can convert it to a true automount by ignoring the last step - remove the noauto,user options but that is a tricky thing to pull off in Mint because it takes so long for the network stack to initialize in Mint. Same thing happens in Ubuntu just not to the degree it happens in Mint..
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

Nicko
Level 1
Level 1
Posts: 5
Joined: Tue Nov 13, 2018 8:12 am

Re: Rename a SMB volume on Mint 19

Post by Nicko » Wed Nov 14, 2018 12:21 pm

Thank you so much for your detailed explanation and this so helpful guide! It's interesting and it helped me a lot also that you mention that on 4.13++ kernel of linux smb protocol v3 is the default and so if our NAS smb is a bit older (in our organisation it supposrts version 1 of smb) we have manually to add as well the parameter of vers=1.
However still my problem is that although now when i mount a nas volume/folder i have friendly names on them without the ip of my nas being displayed on the icons of file manager still when i reboot the computer and even if i have add on fstab these volumes as the guide is pointing i cant access them but only if i mount them again from terminal the /media/nameofnasvolume


Any idea why is this happening?
I am attaching a screenshot of my /etc/fstab and one of the command that i am using on terminal to mount them successfully.
As you can see just for experiment i havent the parameter "noauto" on one line but still...
thank you so much in advance
Attachments
Στιγμιότυπο από 2018-11-15 18-21-45.png
Στιγμιότυπο από 2018-11-15 18-08-16.png

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

Re: Rename a SMB volume on Mint 19

Post by altair4 » Wed Nov 14, 2018 2:42 pm

even if i have add on fstab these volumes as the guide is pointing i cant access them but only if i mount them again from terminal the /media/nameofnasvolume
That should not be happening. You never have to use the terminal with my approach. All you have to do is click on the link on the side panel of your file manager.

Maybe it is the space you have in your fstab statement between noauto and ,user on one and vers=1.0 and ,user on the other.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

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

Re: Rename a SMB volume on Mint 19

Post by altair4 » Thu Nov 15, 2018 8:40 am

I had a chance to revisit this on my own system and I can remove the "Maybe" in my previous post.

I use the this method on my own system and this line in fstab works just as I described in the HowTO:

Code: Select all

//vwin10.local/shared /media/Win10Shared cifs username=smbuser,password=smbuserpw,uid=1000,iocharset=utf8,noauto,user 0 0
** A mount "link" appears on the side panel of my file manager labeled Win10Shared
** Clicking on that link mounted the Win10 share.

Now I edited that fstab line to insert a space between noauto and user:

Code: Select all

//vwin10.local/shared /media/Win10Shared cifs username=smbuser,password=smbuserpw,uid=1000,iocharset=utf8,noauto, user 0 0
** There is no mount "link" on the side panel.
** There is nothing to click to mount the share.

If I run mount it tells me there is something wrong with the syntax:
altair@xub1804:~$ sudo mount -a
mount: /etc/fstab: parse error at line 34 -- ignored
Deleting the space before user eliminated the problem.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

Nicko
Level 1
Level 1
Posts: 5
Joined: Tue Nov 13, 2018 8:12 am

Re: Rename a SMB volume on Mint 19

Post by Nicko » Thu Nov 15, 2018 10:10 am

Thank you so much for walkthroughing me on this and for your time that you spend to check it.
I did as you pointed out though i am still taking a error on the line 12 (the first volume of my smb nas). Line 13 (second volume on the smb) seems to be fine.
I even copy pasted your correct line making of course the right changes on the ip of my nas , and the password and username of the client pc making sure no spaces are added.
Attachments
Στιγμιότυπο από 2018-11-16 16-08-11.png
Στιγμιότυπο από 2018-11-16 16-07-45.png
Στιγμιότυπο από 2018-11-16 16-07-45.png (8.23 KiB) Viewed 260 times
Στιγμιότυπο από 2018-11-16 16-07-21.png

Nicko
Level 1
Level 1
Posts: 5
Joined: Tue Nov 13, 2018 8:12 am

Re: Rename a SMB volume on Mint 19

Post by Nicko » Thu Nov 15, 2018 12:04 pm

Additionally i was thinking if it has to do something with the user id that the user protokollo_3 has on the NAS device (Thecus) since its different from the user id that the protokollo_3 has in the linux mint client pc.
As you can see from the screenshot on Thecus NAS the PROTOKOLLO_3 user is having a ID 1059.
Attachments
Στιγμιότυπο από 2018-11-16 18-00-22.png
Στιγμιότυπο από 2018-11-16 18-00-22.png (15.75 KiB) Viewed 255 times

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

Re: Rename a SMB volume on Mint 19

Post by altair4 » Thu Nov 15, 2018 1:02 pm

Not sure why I didn't notice this before but you have another syntax error. I cannot reproduce your same characters but something like this is incorrect:

Code: Select all

//10.96.255.42/'name of folder' /media/'name of folder' ....
That is not the way you declare a path with spaces in fstab. For every space you need to insert \040 . So the line would look like this:

Code: Select all

//10.96.255.42/name\040of\040folder /media/name\040of\040folder
No quotes '
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

Nicko
Level 1
Level 1
Posts: 5
Joined: Tue Nov 13, 2018 8:12 am

Re: Rename a SMB volume on Mint 19

Post by Nicko » Fri Nov 16, 2018 10:14 am

Thank you so much! Now it works like a charm :D :D
It was indeed a nice experience to learn some more about smb configurations on linux! (Though that with the spaces was a bit tricky!)

At a point i was so dissapointed that i was looking for other tricks to make the mounting on these smb volumes to work like using crotab feature @reboot line and execute from there the mount commants each time on the boot or even edit rc.local config file (although on mint 19 is inactive due to SystemD wayof handling the process).

Post Reply

Return to “Mounting Partitions”