systemd: Can't unmask root mount (-.mount)

5,232

Solution 1

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.

Solution 2

You could try removing the -.mount

sudo rm /run/systemd/system/-.mount

and then reloading systemd

sudo systemctl daemon-reload

Solution 3

Had the same problem. I added sudo like this:

sudo systemctl unmask  -- -.mount

But the changes were not visible to me until I refreshed systemctl:

sudo systemctl daemon-reload

But still the changes were not visible when running systemctl unmask -- -.mount:

● -.mount - Root Mount
   Loaded: masked (Reason: Unit -.mount is masked.)
   Active: active (mounted) since Thu 2019-02-14 04:11:58 CST; 6 months 14 days ago
    Where: /
     What: /dev/mmcblk0p2
    Tasks: 0 (limit: 2077)
   Memory: 0B
   CGroup: /system.slice/-.mount

I had to reboot the system before systemctl unmask -- -.mount displayed anything different:

● -.mount - /
   Loaded: loaded (/etc/fstab; generated)
   Active: active (mounted) since Thu 2019-02-14 04:11:58 CST; 6 months 14 days 
    Where: /
     What: /dev/mmcblk0p2
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
Share:
5,232
ayew
Author by

ayew

Updated on September 18, 2022

Comments

  • ayew
    ayew over 1 year

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

  • will
    will over 4 years
    From what you describe that worked OK after a reboot. However, the action: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit -.mount is masked -- I unmasking your ROOT directory: "/". Check man systemd first, if you want to do this.
  • SO_fix_the_vote_sorting_bug
    SO_fix_the_vote_sorting_bug about 4 years
    Wow, how you ever found this is beyond me. Nice work!
  • pateksan
    pateksan about 4 years
    @jdk1.0 It's ironic then that I'm totally stuck on a java problem atm.
  • Peter Rowell
    Peter Rowell over 3 years
    Thank you. I'm playing with my new Pi 4 and was trying to figure out how to a) clone the root partition, b) play with a bunch of stuff, c) blow it up, and d) restore, lather-rinse-repeat. I found partclone but the apt install partclone kept bombing. Only other program running? gparted. I killed it and everything went smooth as glass.