Score:1

Same External Drive Being Mounted with Different Names

tr flag

I am on Ubuntu 20.04 Desktop and I have an external drive that is a "workhorse" for a lot of my backup routines.

Problem:
For whatever reasons unbeknownst to me.. following a recent reboot, it now mounts the same external drive under two names, which is causing my scripts and apps to fail b/c they can find the correct path. For example:

The path to my external should be:

/media/user/external (and indeed in nautilus, I see it mounted as normal as "external")

Where things get weird is when I run Nautilus with admin privileges and I see that the external drive has also been mounted at:

/media/user/**external1** (the "1" is being appended to the external drives name and wreaking havoc on backup routines.

In a nutshell, any script or running as root will see an incorrect path to my external drive and fail.

I didn't manually created any mount points... this has been working normal as expected for years, this stopped...

Question:
How can I ensure the drive is only mounted correctly, once?

Any tips?

David avatar
cn flag
To be clear regular user sees one name a different name is used when you use sudo?
nightwatch avatar
tr flag
yes, that is correct
nightwatch avatar
tr flag
any script running as the root user sees the incorrect path to the external drive
David avatar
cn flag
You may want to add that to the question.
David avatar
cn flag
Did you create the mount point? The default and I just verified on one of my machines is /media/username/name of the drive. So in my case the path is /media/david/Elements. If I plug in a second drive same name on the device it is auto called Elements1 .Your system is seeing external is in use and using external1 . Sorry I do not know how that can be changed.
sudodus avatar
jp flag
Is your script mounting the drive? In that case, let it first check that it is not already mounted (and if it is mounted, either use the current mount or unmount and mount again, if that is necessary for ownership and permissions).
nightwatch avatar
tr flag
@sudodus my script does not mount the drive... I wouldn't know how to code that..
sudodus avatar
jp flag
I suggest that you download and run the [Ubuntu Forum's `system-info` script](https://github.com/UbuntuForums/system-info/) and let it upload its result to a pastebin. Then edit your original question to add a link to the pastebin. Do this when you have the problem (that the drive is mounted twice). This will help us (who try to help) to understand what you have and that will make it easier for us to find a solution.
nightwatch avatar
tr flag
Unfortunately, I saw this too late... I solved it... but I have seen this problem before.. (a "ghost mount" is the only I can describe it. I unmounted the drive in nautilus as regular user and root. However under `/media/user` there remained a directory called "external". I deleted it and rebooted... problem solved
nightwatch avatar
tr flag
Yeah, apparently the first answer and I reached identical solutions... And based on that post it seems that my problem was caused by a hard reset that I could avoid.
Score:1
tr flag

The solution to this is straightforward.

  1. As the regular open nautilus and properly unmount the drive.

  2. As root user open another nautilus window and correctly unmount the drive.

  3. then, via terminal $cd /media/user/ and execute ls (if you still see your external mount listed, that is what I can only call a "ghost mount", delete it, then reboot... you are back in action)

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.