Drive changed path after reverting changes of sharing data using NFS

After following this tutorial I wanted to revert the changes but the drive changed name for some reason. How do I leave it with the same name it had?

I’ve done:

sudo rm /etc/systemd/system/*.mount
sudo rm /etc/systemd/system/*.automount

I removed the lines from /etc/exports/ and /etc/fstab and then I restarted. When I mounted the drive, the path changed to /run/media/user/X1, when it was /run/media/user/X before.

Everything under /run/ is temporary and not static. The path can change between every mount. Do not use /run/ for anything other temporary mounts thru your GUI. Do not expect the path to be static.

If you want to be a static path use a entry in fstab or a systemd mount unit. But do not mount it under /run/ with these methods.

1 Like

normally, any drive that has got a Label
(a name which you have given it when you formatted the drive)
will appear under
by that name

if your drive name was X and now it is X1
you might have changed the label

Did you actually call your drive just “X”? …

… or it has got no label and the system uses some other thing to decide the name under which it will appear in /run/media/$user
and that might change every time you connect the drive

Easiest is to set a label, a name
so what the drive appears as will be consistent and not change over time.

Since it is an NTFS drive and I have no experience with this filesystem I cannot tell you how to check for or set a name/Label.

I’m not using any path myself. I’m just mounting the drive from the file manager and it gets mounted there.

The label of the drive is X but the file manager has mounted it in X1 when before it mounted it in X. I don’t know why it’s changed.

And this is a good approach if you want to copy some files to or from it. Like an USB Thumbdrive, but not if you need a static and predictable path that always work. It is just temporary.

1 Like

What’s the GUI way of mounting it permanently? It’s an internal drive so I don’t know why I have to bother mounting it.

Not sure about KDE, but on Gnome and XFCE, there is none. Use a text editor and add line to fstab or create a systemd mount unit. And of course do not mount it under /run

I had created a folder /run/media/user/X and I hadn’t seen it. After removing it and restarting, the drive has mounted again were it did before.

How is this an answer?
Ad you’re still using /run…which we’ve repeatedly advised against…

I just don’t see why if this was necessary it wouldn’t be done by the operating system itself. Everybody else except the most tech savy users are using the default /run location without problems.

There is no GUI way to mount anything permanently - the only method to permanently mount a device on a predictable path is using

  1. fstab (requires the mount point to be created manually)
  2. systemd mount units (mount units create the mount point on first mount)
  3. systemd automount units - requires an existing mount unit (must not be enabled or mountpoint occupied)

Gnome disks can assist in creating the mount line in fstab - still the mountpoint must be created by hand)

And don’t use /run as target for a permanent mount point. /run exist only in memory.

That is a statement which requires you to document it … please …

1 Like

Ever heard the phrase “just because you could, doesn’t mean you should.”

/run is for user mounted stuff. So basically your file manager. It’ or its content can change at boot. Or even while using your computer. While /mnt isn’t, and obviously not that volatile.

In the end it’s up to you. But then unexpected consequences should be…expected.

Until something unexpected happens. Then, not so much.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.