I'm trying to have systemd mount a volume by symlink. Unfortunately when I try it times out waiting for the systemd device to show up.
# systemctl start mnt-ephemeral0.mount
A dependency job for mnt-ephemeral0.mount failed. See 'journalctl -xn' for details.
# journalctl -xn
Aug 04 17:02:09 i-c7a88499 systemd[1]: Expecting device dev-block-ec2-ephemeral0.device...
Aug 04 17:03:39 i-c7a88499 systemd[1]: Job dev-block-ec2-ephemeral0.device/start timed out.
Aug 04 17:03:39 i-c7a88499 systemd[1]: Timed out waiting for device dev-block-ec2-ephemeral0.device.
Aug 04 17:03:39 i-c7a88499 systemd[1]: Dependency failed for /mnt/ephemeral0.
The message says it's waiting for dev-block-ec2-ephemeral0.device
. My unit file specifies What=/dev/block/ec2/ephemeral0
, which is a symlink to /dev/xvdb
.
man 5 systemd.device
says:
systemd will dynamically create device units for all kernel devices that are marked with the "systemd" udev tag
However it appears to only create the device unit for the /sys
path.
# systemctl list-units | grep 'xvdb\|ephemeral0'
sys-devices-vbd\x2d2064-block-xvdb.device loaded active plugged /sys/devices/vbd-2064/block/xvdb
The ephemeral0
is a properly recognized udev symlink:
# udevadm info -q symlink -n /dev/xvdb
block/ec2/ephemeral0 disk/by-uuid/d57e2dd9-0062-448c-a914-0b6df045dafb
# ls -l /dev/block/ec2/ephemeral0
lrwxrwxrwx 1 root root 10 Aug 4 16:59 /dev/block/ec2/ephemeral0 -> ../../xvdb
Here is the current unit file:
[Unit]
After=ephemeral0-format.service
[Mount]
What=/dev/block/ec2/ephemeral0
Where=/mnt/ephemeral0
Is there any way to get this mounted through a systemd.mount unit?
Could I create a fake unit like systemd did for that sys-devices-vbd...
one?