Can't purge snapd in LXD: rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/...': Function not implemented
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxd |
Fix Released
|
Unknown
|
|||
snapd (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
In LXD containers snapd can't be purge-removed. One tool affected by this bug is autopkgtest-
Steps to reproduce:
lxc launch ubuntu:jammy paride-j
lxc exec paride-j -- apt-get -y remove --purge snapd
Kinetic is also affected, I didn't test older releases. To see how this affects autopkgtest-
autopkgtest-
This reminds me of LP: #1903967, but it's likely a different issue.
--- relevant log excerpt ---
[...]
Purging configuration files for snapd (2.56.2+
Stopping snap.lxd.
Stopping unit snap.lxd.
Waiting until unit snap.lxd.
snap.lxd.
Removing snap.lxd.
Stopping snap.lxd.
Stopping unit snap.lxd.
Waiting until unit snap.lxd.
snap.lxd.
Removing snap.lxd.
Stopping snap.lxd.
Stopping unit snap.lxd.
Waiting until unit snap.lxd.
snap.lxd.
Removing snap.lxd.
Stopping snap-core20-
Stopping unit snap-core20-
Waiting until unit snap-core20-
snap-core20-
Removing snap core20 and revision 1611
Removing snap-core20-
Stopping snap-lxd-
Stopping unit snap-lxd-
Waiting until unit snap-lxd-
snap-lxd-
Removing snap lxd and revision 23541
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
rm: cannot remove '/var/snap/
[...]
Related branches
- Ubuntu Release Team: Pending requested
-
Diff: 1218 lines (+589/-59) (has conflicts)15 files modifiedlib/adt_testbed.py (+291/-8)
lib/adtlog.py (+11/-1)
lib/autopkgtest_args.py (+12/-0)
lib/testdesc.py (+59/-12)
runner/autopkgtest (+111/-21)
runner/autopkgtest.1 (+10/-1)
setup-commands/setup-testbed (+17/-0)
ssh-setup/nova (+6/-3)
tests/autopkgtest (+2/-2)
tests/testdesc (+3/-3)
tools/autopkgtest-build-lxd (+10/-0)
virt/autopkgtest-virt-lxc (+4/-0)
virt/autopkgtest-virt-lxd (+31/-3)
virt/autopkgtest-virt-qemu (+4/-0)
virt/autopkgtest-virt-ssh (+18/-5)
- Brian Murray: Approve
- Ubuntu Release Team: Pending requested
-
Diff: 28 lines (+10/-0)1 file modifiedtools/autopkgtest-build-lxd (+10/-0)
no longer affects: | lxd (Ubuntu) |
Changed in lxd: | |
status: | Unknown → Fix Released |
It looks like the LXD snap has mounted "proc" and "sys" over /var/snap/ lxd/common/ var/lib/ lxcfs/{ proc,sys} / but it's not unmounting them.
In the "remove" hook, the LXD snap should unmount any mounted filesystems; not doing so can have disastrous effects if there are also user partitions mounted in there.