systemd fails to generate .device units inside LXD containers

Bug #1713086 reported by A.J. Ruckman
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Won't Fix
Undecided
Dimitri John Ledkov

Bug Description

See LXD issue here for more context: https://github.com/lxc/lxd/issues/3638

After attaching a block device (in my case /dev/sdc3) to a LXD container, the dev-sdc3.device unit is not generated. However, the dev-sdc3.mount unit is generated correctly.

Steps to reproduce (from GitHub issue):

stgraber@castiana:~$ truncate -s 10G test.img
stgraber@castiana:~$ sudo losetup -f test.img
stgraber@castiana:~$ sudo losetup -a
/dev/loop1: [0022]:169383 (/var/lib/snapd/snaps/core_2381.snap)
/dev/loop2: [0022]:770242 (/var/lib/snapd/snaps/core_2312.snap)
/dev/loop0: [0022]:1170310 (/var/lib/snapd/snaps/core_2462.snap)
/dev/loop3: [0045]:309158 (/home/stgraber/test.img)
stgraber@castiana:~$ lxc launch ubuntu:16.04 issue3638
Creating issue3638
Starting issue3638
stgraber@castiana:~$ lxc config device add issue3638 sda unix-block source=/dev/loop3 path=/dev/sda
Device sda added to issue3638
stgraber@castiana:~$ lxc exec issue3638 -- mkfs.ext4 /dev/sda
mke2fs 1.42.13 (17-May-2015)
Discarding device blocks: done
Creating filesystem with 2621440 4k blocks and 655360 inodes
Filesystem UUID: 77832ca2-b16d-4b94-8f7d-9ea08c5e6913
Superblock backups stored on blocks:
 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

stgraber@castiana:~$ echo Y | sudo tee /sys/module/ext4/parameters/userns_mounts
Y
stgraber@castiana:~$ lxc exec issue3638 -- mount /dev/sda /mnt
stgraber@castiana:~$ lxc exec issue3638 bash
root@issue3638:~# echo "/dev/sda /mnt ext4 defaults 0 0" >> /etc/fstab
root@issue3638:~# cat /etc/fstab
LABEL=cloudimg-rootfs / ext4 defaults 0 0
/dev/sda /mnt ext4 defaults 0 0
root@issue3638:~# exit
stgraber@castiana:~$ lxc exec issue3638 -- umount /mnt
stgraber@castiana:~$ lxc exec issue3638 -- mount /mnt
stgraber@castiana:~$ lxc stop issue3638
stgraber@castiana:~$ lxc start issue3638
stgraber@castiana:~$ lxc exec issue3638 -- mount | grep mnt
stgraber@castiana:~$ lxc exec issue3638 -- systemctl -a | grep mnt
  mnt.mount loaded inactive dead start /mnt
stgraber@castiana:~$ lxc exec issue3638 -- systemctl -a | grep sda
  dev-sda.device loaded inactive dead start dev-sda.device
  dev-sda.mount loaded active mounted /dev/sda
stgraber@castiana:~$ lxc exec issue3638 -- ps aux | grep udev
root 54 0.0 0.0 41720 1864 ? Ss 16:55 0:00 /lib/systemd/systemd-udevd
stgraber@castiana:~$

description: updated
tags: added: lxd
tags: added: lxc
Changed in systemd (Ubuntu):
assignee: nobody → Dimitri John Ledkov (xnox)
tags: added: id-59df87551899547b7b2171c2
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed
tags: added: fr-623
Revision history for this message
Dan Streetman (ddstreet) wrote :

please reopen if this is still an issue

Changed in systemd (Ubuntu):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.