If I shut down my computer while a device that was mounted by udisks is still mounted, the folder where it was mounted still remains. If I then mount that device again later, a '1' will be appended to the name (or higher numbers if the lower numbers are taken).

The owner of these empty folders is root; owner has rwx permissions, the rest has none.

I'm running Arch Linux with xfce4 as desktop manager. My udisks version is 2.1.7-1

I configured udisks to mount the devices in /media using these instructions: https://wiki.archlinux.org/index.php/Udisks#Mount_to_.2Fmedia_.28udisks2.29

Is there anything I can do to fix this so the folders will be removed on shutdown?

My problem is similar to this problem, with the difference being in which situation it occurs: Make udisks2 clean up stale mount points? . This appered to be a bug in udisks (solved by now). Should I report my situation as a bug too?

Edit: This only applies to shared mounts. If I remove the rule that makes mounts shared by default the cleaning up is done properly.

1 Answer 1


I found this mentioned in a Github issue; they suggest mounting /media as a tmpfs so it will be cleaned up on restart. In /etc/fstab:

tmpfs /media tmpfs nodev,nosuid,size=1M 0 0
  • But from reading the udisks2 Arch Wiki it should not be necessary to mount /media as a tmpfs OR to place a script in /etc/tmpfiles.d to do the same thing. From my testing plug in and out ONE USB key and the mount point directory IS removed, but if I plug in two or more USB keys and then plug out one of them that mount point dir is not removed. May 16, 2022 at 22:33

You must log in to answer this question.

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