I didn't know how to phrase this question better. I hope the following description is clear. I have Linux Mint 19.3 Cinnamon installed alongside Windows 10, on a dual-boot system. Between the two OS, I have a shared partition, named DATA, where I put files that I may need to access from either of the OS. This drive/partition, DATA, is located at /media/username folder in Linux. Now, I need to access a remote folder and its subfolders, kept on our server. Let's say, the shared folder is at // with several subfolders. I thought to map/mount this remote folder to a location on my DATA drive, more specifically, at /media/username/DATA/Projects/MappedFolders.

One important detail. The above address and OurSharedFolder are accessible only when I am connected via VPN.

To permanently map this network folder was easy in Windows 10. To do this on Linux, I followed simple steps given at this page, in the "Permanent mount" section. Basically, created and saved a credentials file using

sudo nano /root/.smbcredentials

and also saved the mount path configuration in fstab file

// /media/username/DATA/Projects/MappedFolders cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

Then I created the MappedFolders folder at the /media/username/DATA/Projects/ location. Finally, I executed

mount -a

This created the desired mounted drive. So far so good.

But the problem started when I changed the name of the MappedFolders folder to SharedFolders. I changed the physical folder name, as well as the path in the fstab file. Then executed mount -a again. It created the mount folder, but automatically, the location of my "Projects" folder, which is inside the shared drive DATA, changed from /media/username/DATA/Projects/ to /media/username/DATA1/Projects/.

I unmounted using the

umount -a -t cifs

but, the DATA1 alias remained. I changed back the mounted folder's name to MappedFolders as earlier, and mounted again, and now there is DATA, DATA1 and DATA2. They all point to DATA. But it has changed the location of my Projects folder to DATA2.

In short, for each mount and umount operation, it created a new shortcut for DATA drive.

The implication is that now the datafiles inside the Projects folder have a new path, and broken links in the files that access those datafiles.

I hope I am clear in my description.

Thanks ahead!

1 Answer 1


Ok, after consulting with a colleague, found a workaround. Posting here just in case if someone faces a similar problem in future.

The problem is (was) that the Linux automatically assigns a mount name. The solution is to give a fixed name for mounting.

First, I deleted the redundant copies of DATA, the ones which had a blank folder I had created for mounting. In my case, these were DATA and DATA1 folders.

sudo rm -rf DATA

DATA2 had the folders of my original DATA drive. So I kept it as it is. Then, I opened the Disk program from Linux menu. Selected the DATA partition (yes, it kept the original name).

enter image description here

Clicking on the "Additional partition options" button found below the Volumes, it opened a context menu. From this menu, I selected "Edit Mount Options". The next are the following changes.

  1. Set "User Session Defaults" to OFF (in order to make changes to the default settings).
  2. In the option "Identify As", I selected LABEL=DATA. This will hard-define the mount label as DATA, for the current and all future mountings.

enter image description here

That's it. Rebooting the system brought back the DATA partition mount name. One small difference. The path of the DATA was not anymore /media/username/DATA, but instead /mnt/DATA. I found this setting even better (than /media/username), hence I kept it that way. Just fixed the broken file addressing in my program configuration.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .