0

I have a hard drive that contains a bunch of software and data from my previous PC. After upgrading my work unit, I just attached the drive and found the contents in a directory with a default name.

/media/user/839bfea0-099a-4971-a198-9312992d4a57

It has been this way the last few years, and I was too lazy to change it. In order for all the software and data be accessible, I just mount the drive once every time I boot up. It's not much of a problem.

But just today, there had been a series of blackouts and my UPS was not working, so my work unit lost power several times. I think it must have affected my unit and my drive cannot be found. I tried to reattach the drive, and it was successfully discovered, but the thing is there are two drives now which looks like this:

looks like this

The original drive name cannot be opened, prompting that I don't have permission to open it. It has an x icon instead of a drive icon. I cannot cd into it in terminal. Cannot perform chmod on it too.

Then I noticed this new drive. It has the same name as the previous one, except it is ending with 1. It contains all the contents of the drive. So I'm suspecting it had just been renamed. Although, since I have a bunch of software outside this drive that access software and data inside. It would be much of hassle to change repoint everything to this new location. I was hoping I could just rename it back to its previous name instead to preserve everything that references to it. Is there any way to do this?

1
  • Please add the output of ls -la /media/user/839bfea0-099a-4971-a198-9312992d4a57 and id -u. And also cat /etc/fstab (You can limit it to the correspondent line).
    – pLumo
    Jul 18, 2019 at 8:53

1 Answer 1

2

Linux automatically mounts removable media under a folder /meda/$USER (where $USER should be replaced by your login name. To that aim, a mount point, i.e. a folder where the medium will be mounted, is created. As name of the folder, the file system LABEL is used if it is set. Otherwise, the system used the UUID of the drive, as is your case. When the medium is unmounted, either by yourself or during system shutdown, that folder is removed.

In your case, the folder was not removed because of an improper shutdown. Thus, next time the system tries to mount the drive, it attempts to create a mount point, but sees that such folder already exists. Accordingly, the system will create a different folder.

To restore the "original" mount point:

  1. Unmount the medium. You can simply do this from your file manager as normal user.
  2. Delete the original mount point of the media. You need to do this as administrator (root). The easiest way would be using the terminal, with the command sudo rmdir /media/user/839bfea0-099a-4971-a198-9312992d4a57. If that would not work because for one or another reason, there are files in that folder, then first check the contents of the folder. If there is nothing of interest, then delete the folder with a similar command, where you replace rmdir by rm -rf.

Next time you reinsert the medium, it will again be mounted on the original mounting point.

Tip: If you give the medium a LABEL, (for example "Backupdrive") then the label will be used as mount point. This will make the mounted medium much more recognizable.

You must log in to answer this question.

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