** Tags added: fr-623

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1713086

Title:
  systemd fails to generate .device units inside LXD containers

Status in systemd package in Ubuntu:
  Confirmed

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:~$

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1713086/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to