Directory Storage Named with Hyphen - Invalid Systemd Mount Unit

Feb 9, 2019
Creating a new Directory Storage config (via Node > Disks > Directory) where the config name contains a hyphen (such as `local-ssd`), results in an invalidly named Systemd mount unit.

Task Log

# /sbin/sgdisk -n1 -t1:8300 /dev/sdb
The operation has completed successfully.
# /sbin/mkfs -t ext4 /dev/sdb1
mke2fs 1.43.4 (31-Jan-2017)
Discarding device blocks:      4096/117212625  3149824/117212625  5771264/117212625  8916992/117212625 12062720/117212625 28315648/117212625 31461376/117212625 34082816/117212625 37228544/117212625 40374272/117212625 42995712/117212625 46141440/117212625 48762880/117212625 51908608/117212625 54530048/117212625 57675776/117212625 60297216/117212625 62918656/117212625 66064384/117212625 69210112/117212625 71831552/117212625 74977280/117212625 77598720/117212625 80744448/117212625101715968/117212625                   done                           
Creating filesystem with 117212625 4k blocks and 29310976 inodes
Filesystem UUID: b60b7b5a-d5b3-4291-abd1-305fe285ea03
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

Allocating group tables:    0/3578         done                           
Writing inode tables:    0/3578         done                           
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information:    0/3578         done

# /sbin/blkid /dev/sdb1 -o export
Failed to start mnt-pve-local-ssd.mount: Unit mnt-pve-local-ssd.mount is not loaded properly: Invalid argument.
See system logs and 'systemctl status mnt-pve-local-ssd.mount' for details.
TASK ERROR: command 'systemctl start mnt-pve-local-ssd.mount' failed: exit code 1

Unit Status

root@pve3:~# systemctl status mnt-pve-local-ssd.mount
● mnt-pve-local-ssd.mount - Mount storage 'local-ssd' under /mnt/pve
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)
    Where: /mnt/pve/local-ssd
     What: /dev/disk/by-uuid/b60b7b5a-d5b3-4291-abd1-305fe285ea03

Feb 09 16:06:44 pve3 systemd[1]: mnt-pve-local-ssd.mount: Where= setting doesn't match unit name. Refusing.

The unit name should have the hyphen in `local-ssd` escaped. The correct name can be determined by using `systemd-escape`.

Renaming Unit

root@pve3:~# cd /etc/systemd/system/
root@pve3:/etc/systemd/system# systemd-escape -p --suffix=mount '/mnt/pve/local-ssd'
root@pve3:/etc/systemd/system# mv mnt-pve-local-ssd.mount 'mnt-pve-local\x2dssd.mount'
root@pve3:/etc/systemd/system# systemctl start 'mnt-pve-local\x2dssd.mount'
root@pve3:/etc/systemd/system# systemctl status 'mnt-pve-local\x2dssd.mount'
● mnt-pve-local\x2dssd.mount - Mount storage 'local-ssd' under /mnt/pve
   Loaded: loaded (/etc/systemd/system/mnt-pve-local\x2dssd.mount; disabled; vendor preset: enabled)
   Active: active (mounted) since Sat 2019-02-09 16:30:15 CST; 4s ago
    Where: /mnt/pve/local-ssd
     What: /dev/sdb1
  Process: 70252 ExecMount=/bin/mount /dev/disk/by-uuid/b60b7b5a-d5b3-4291-abd1-305fe285ea03 /mnt/pve/local-ssd -t ext4 -o defaults (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   Memory: 296.0K
      CPU: 9ms
   CGroup: /system.slice/mnt-pve-local\x2dssd.mount

Feb 09 16:30:15 pve3 systemd[1]: Mounting Mount storage 'local-ssd' under /mnt/pve...
Feb 09 16:30:15 pve3 systemd[1]: Mounted Mount storage 'local-ssd' under /mnt/pve.
  • Like
Reactions: alkopz


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!