11

When I plug in an external USB drive, it automatically mounts and it's accesible in /media/disk/

However after a while, this is how my /media directory looks like:

cesar@minas-tirith:~$ ls /media/
0BC7-569E  0BC7-569E_  disk  disk_  disk__  disk___

As you can see, the disk entry is repeated with additional _ appended at the end. I don't know why this happens, but I can imagine that under some circumstances, the system can't mount the disk in /media/disk/ and creates disk_, then it can't mount it in /media/disk_ and creates disk__ and so forth. The other entry 0BC7-569E I think it's from a SD media card so it's not only for USB drives.

I would like to know what is causing this? Is this expected behavior? or how can I prevent this from happening?

Cesar
  • 1,447

4 Answers4

4

For a long-term fix, you could add the drive to /etc/fstab with a designated mountpoint. I recommend using the UUID to identify the drive.

Bonus tip:

If you want the icon to be displayed when the drive is mounted, set the mountpoint somewhere within /media/. If you don't, set the mountpoint somewhere else, such as /mnt/.

wjandrea
  • 14,504
nathwill
  • 2,643
2

You can work around this, by unplugging the USB drive, and the going to a terminal (e.g. Application->Accessories->Terminal) and entering:

sudo rmdir /media/disk
sudo rmdir /media/disk_
sudo rmdir /media/disk__
sudo rmdir /media/disk___
etc

When you replug the disk in it should remount at /media/disk/

(Do the same for your /media/0BC7-569E)

8128
  • 28,868
1

This is not a complete answer, but rather a comment to help understand the issue better (I don't have enough reps yet to comment).

You can check diagnostic messages generated while usb / sdio devices are mounted and unmounted by running following command or by selecting (clicking on) the "dmesg" item in the left hand side of System -> Administrator -> Log File Viewer

dmesg | tail -20

The tail command prints only the most recent 20 msgs. While inserting or removing the card, run this several times or change the number at the end to see more/ less messages. This would give you an idea of what is going wrong.

koushik
  • 5,132
1

Make sure you always unmount USB devices before you un-plug them.