1

I have Ubuntu Core running on a Raspberry 3 and I am trying to mount external USB disk and have followed the instructions on: Mount instructions

When running the command

igor-lopez@localhost:~$ systemctl start home-igor-lopez-backup-vol1.mount

I get the failure:

Failed to start home-igor-lopez-backup-vol1.mount: Unit home-igor-lopez-backup-vol1.mount is not loaded properly: Invalid argument.

My mount file(/writable/system-data/etc/systemd/system/home-igor-lopez-backup-vol1.mount) looks like this:

[Unit]
Description=Mount for Backup Vol1

[Mount]
What=/dev/disk/by-uuid/eb48ffde-6fcd-48e4-a31b-316628728f4c
Where=/home/igor-lopez/backup/vol1
Type=ext4

[Install]
WantedBy=multi-user.target

and the mount point does exist:

igor-lopez@localhost:~/backup/vol1$ pwd
/home/igor-lopez/backup/vol1

and so does the disk:

/dev/disk/by-uuid/eb48ffde-6fcd-48e4-a31b-316628728f4c -> ../../sda1

Since the user was created during install and connected to my launchpad account I have a dash in the user name. The mount file should have a name matching the mount point but slash replased with dash but I do not want to change the user name if I can avoid it.
Running the same command with sudo gave additional info:

Jan 05 13:24:28 localhost.localdomain systemd1: home-igor-lopez-backup-vol1.mount: Where= setting doesn't match unit name. Refusing.

So it looks like the mount file entry:

Where=/home/igor-lopez/backup/vol1  

is the culprit and I have no idea on how to solve it.

Tried changing the Where location according reply by grawity to:

Where=/home/igor\x2dlopez/backup/vol1  

but that did not help.

1 Answer 1

0

Since unit file names cannot contain slashes, those are replaced with dashes. But to prevent ambiguity, dashes that were originally there must be replaced with something else; systemd uses C-style \x## hexadecimal escapes for this. So igor-lopez must be written as igor\x2dlopez.

Use systemd-escape to find the correct name:

$ systemd-escape --path /home/igor-lopez/backup/vol1
home-igor\x2dlopez-backup-vol1
3
  • Thanks for the reply but I updated the Where location to: Where=/home/igor\x2dlopez/backup/vol1 but still got the same error.
    – IgorLopez
    Commented Jan 5, 2019 at 16:11
  • You were supposed to update the unit file name, not the Where= setting. Commented Jan 5, 2019 at 16:34
  • I tried that as well but did not succeed in naming the unit file with \x2d first but then escaping the slash first, mv home-igorx-lopez-backup-vol1.mount home-igor\\x2dlopez-backup-vol1.mount did the trick and now the start command worked. Thanks for the help.
    – IgorLopez
    Commented Jan 5, 2019 at 20:46

You must log in to answer this question.

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