Debian – systemd: Can’t unmask root mount (-.mount)

debianservicessystemctlsystemd

(Dist: Debian 10)

I have a reoccurring error message that mainly pops up when using systemctl (also when installing a package, and occasionally in a few other places that escape me),

Unit -.mount is masked.

Sometimes (depending on what command called the error message) it is more verbose, such as

Error: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit -.mount is masked.

This error doesn't impede installing packages or any systemd services which are enabled already (and as such are loaded at boot), but using systemctl or service to restart, start or stop a service fails. This means I have to reboot the whole server to restart a service, which can be a little annoying.

Trying to unmask the root mount with systemctl unmask -- -.mount appears to work (nothing is returned), but systemctl status -- -.mount still outputs the following after:

● -.mount - Root Mount
   Loaded: masked (Reason: Unit -.mount is masked.)
   Active: active (mounted) since Mon 2019-08-05 15:03:38 AEST; 4h 8min ago
    Where: /
     What: /dev/sde1
    Tasks: 0 (limit: 4915)
   Memory: 0B
   CGroup: /system.slice/-.mount

Any ideas? I'm don't want to start from a fresh install for this server, so either I find a fix or just deal with having to restart if I need to reload a service.

Best Answer

I was getting the same while performing step 6 in this answer: https://askubuntu.com/a/1028709/1003629.

By trial and error I found this was no longer an issue if I closed GParted.

Edit after I got three upvotes: it would appear gparted locks something, perhaps access to the partition table or a file that holds it, it would be great if someone can edit my answer to clarify this.

Related Question