7

The system changes my partition mount name with a numeric suffix dynamically (Example: Name becomes Name1, Name2, and so on).

I appreciate all your suggestions to fix this problem in my Ubuntu 16.04 LTS.

Thanks

8
  • I do not want to rename the Label . when I mount the partition from nautilus, it is getting mounted with different name. For example, if my partition name is 'X' it is getting mounted as 'X1' or 'X2'. Commented Nov 9, 2017 at 16:36
  • 1
    @DineshKalidassan I think I've had this problem. Specifically, the mount point is getting renamed every time you mount the position, right?
    – wjandrea
    Commented Nov 9, 2017 at 17:31
  • Exactly, the mount point is renamed. Did you fix the problem. Commented Nov 9, 2017 at 17:54
  • @DineshKalidassan Yes, I did, though I'm foggy on the details, even after finding the question I posted: Secondary HDD mounting in /media/username under wrong folder name
    – wjandrea
    Commented Nov 9, 2017 at 19:47
  • OK, I've read some things and I think I have an answer ready - just need to know the method you're using to mount the partition.
    – wjandrea
    Commented Nov 9, 2017 at 20:27

1 Answer 1

8

This seems to happen when three conditions are met:

  1. You mount the partition using the GUI (Nautilus or otherwise)
    • In the backend, this seems to use udisksctl mount
  2. There is no entry for the partition in the filesystem table (/etc/fstab)
    • If there were an entry, it would specify the mount point
  3. There is already a directory at the default mount point
    • The default mount point is /media/$username/$partition_label, so in this case, probably /media/dinesh/Name
    • I'm not sure why this happens. Maybe if the machine is not properly shut down?
    • It could also be a file not a dir, but practically, that doesn't happen

So, there are three solutions:

1. Delete the existing dir(s)

This is quick and dirty - more of a workaround than a solution.

With the drive unmounted, run this command:

sudo rmdir /media/$USER/Name*

Note that rmdir will only delete empty dirs, so if you accidentally run this while the drive is mounted, it shouldn't do any harm.

2. Create an entry for the partition in /etc/fstab

From nathwill's answer on a related question:

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/.

If you prefer GUI, you can use Disks (gnome-disks) to set up an fstab entry:

  1. From the Dash, type "Disks" then open it
    • Or from a terminal, run gnome-disks
  2. Select the disk
  3. Select the partition
  4. Click the gear icon (for more actions)
  5. Click Edit Mount Options
  6. Disable Automatic Mount Options
  7. Set Identify as to UUID=(uuid)
  8. Set the Mount point

3. Mount the partition using CLI

This uses sudo mount, which IMO is way more hassle than the other two options, so I won't even bother explaining it.


More details

When using udisksctl mount, if the default mount point already exists, it will append 1. If the mount point with 1 already exists, it will iterate the number (2, 3, etc). It seems like earlier versions of Ubuntu used udisks --mount in the backend, which would mount to /media/$partition_label, and append an underscore if the mount point already existed. For example, see Why does the mount point keeps changing, and how can I prevent it?

You must log in to answer this question.

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