Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxc-copy fails on btrfs-backed container #2655

Closed
jonjonw opened this issue Sep 28, 2018 · 0 comments
Closed

lxc-copy fails on btrfs-backed container #2655

jonjonw opened this issue Sep 28, 2018 · 0 comments

Comments

@jonjonw
Copy link

jonjonw commented Sep 28, 2018

Issue description

I am unable to clone a btrfs-backed container. It appears to be using the wrong path for the base rootfs.

Steps to reproduce

  1. On a btrfs volume, create a container:
    lxc-create -n base -B btrfs -t download -- --dist archlinux --release current --arch amd64
  2. Attempt to make a copy of the container: lxc-clone -n base -N child -B btrfs
  3. Confirm it was not created: lxc-ls

Information to attach

Adding -o to get some logs gives:
# lxc-copy -n base -N child -B btrfs -o /var/log/lxc/child.log
lxc-copy: base: storage/btrfs.c: btrfs_create_snapshot: 530 Invalid cross-device link - Failed to create btrfs snapshot "/var/lib/lxc/child/rootfs" from "/usr/lib/lxc/rootfs"
lxc-copy: base: lxccontainer.c: copy_storage: 3571 Error copying storage.
lxc-copy: base: tools/lxc_copy.c: do_clone: 369 Failed to clone

Note the error indicates "from "/usr/lib/lxc/rootfs"" but the rootfs for base is at "/var/lib/lxc/base/rootfs"

Required information

  • Distribution: archlinux
  • The output of
    • lxc-start --version: 3.0.2
    • lxc-checkconfig
      `--- Namespaces ---
      Namespaces: enabled
      Utsname namespace: enabled
      Ipc namespace: enabled
      Pid namespace: enabled
      User namespace: enabled
      Network namespace: enabled

--- Control groups ---
Cgroups: enabled

Cgroup v1 mount points:
/sys/fs/cgroup/systemd
/sys/fs/cgroup/cpu
/sys/fs/cgroup/freezer
/sys/fs/cgroup/cpuset
/sys/fs/cgroup/memory
/sys/fs/cgroup/pids
/sys/fs/cgroup/devices
/sys/fs/cgroup/perf_event
/sys/fs/cgroup/hugetlb
/sys/fs/cgroup/net_cls,net_prio
/sys/fs/cgroup/blkio
/sys/fs/cgroup/rdma

Cgroup v2 mount points:
/sys/fs/cgroup/unified

Cgroup v1 clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: missing
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled, not loaded
Macvlan: enabled, loaded
Vlan: enabled, not loaded
Bridges: enabled, loaded
Advanced netfilter: enabled, not loaded
CONFIG_NF_NAT_IPV4: enabled, not loaded
CONFIG_NF_NAT_IPV6: enabled, not loaded
CONFIG_IP_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled, not loaded
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled, not loaded
FUSE (for use with lxcfs): enabled, loaded

--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities:

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
`

  • uname -a
    Linux ghost 4.18.9-1-ck-skylake #1 SMP PREEMPT Wed Sep 19 21:04:45 EDT 2018 x86_64 GNU/Linux
  • cat /proc/self/cgroup
    12:rdma:/ 11:blkio:/ 10:net_cls,net_prio:/ 9:hugetlb:/ 8:perf_event:/ 7:devices:/user.slice 6:pids:/user.slice/user-1000.slice/user@1000.service 5:memory:/user.slice/user-1000.slice/user@1000.service 4:cpuset:/ 3:freezer:/ 2:cpu:/ 1:name=systemd:/user.slice/user-1000.slice/user@1000.service/gnome-terminal-server.service 0::/user.slice/user-1000.slice/user@1000.service/gnome-terminal-server.service
  • cat /proc/1/mounts
    proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 dev /dev devtmpfs rw,nosuid,relatime,size=16278644k,nr_inodes=4069661,mode=755 0 0 run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0 efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0 /dev/nvme0n1p2 / ext4 rw,noatime 0 0 securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0 cgroup2 /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0 cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0 pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0 cgroup /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0 cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0 cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0 cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0 systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=36,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=9761 0 0 debugfs /sys/kernel/debug debugfs rw,relatime 0 0 mqueue /dev/mqueue mqueue rw,relatime 0 0 hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0 binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0 configfs /sys/kernel/config configfs rw,relatime 0 0 /dev/sda2 /var/lib/lxc btrfs rw,noatime,compress=zstd,space_cache,autodefrag,subvolid=24190,subvol=/lxc 0 0 /dev/sda2 /mnt/btrfs/tank btrfs rw,noatime,compress=zstd,space_cache,autodefrag,subvolid=5,subvol=/ 0 0
brauner pushed a commit to brauner/lxc that referenced this issue Sep 28, 2018
Closes lxc#2655.

Fixes: 9de31d5 ("tree-wide: s/strncpy()/strlcpy()/g")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
brauner pushed a commit to brauner/lxc that referenced this issue Sep 28, 2018
Closes lxc#2612.
Closes lxc#2655.

Fixes: 9de31d5 ("tree-wide: s/strncpy()/strlcpy()/g")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
brauner pushed a commit that referenced this issue Oct 7, 2018
Closes #2612.
Closes #2655.

Fixes: 9de31d5 ("tree-wide: s/strncpy()/strlcpy()/g")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant