Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#52820 - [devtools] makechrootpkg don't delete btrfs child subvolumes
Attached to Project:
Arch Linux
Opened by Robin D (Koaxiel) - Thursday, 02 February 2017, 07:43 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 24 March 2017, 16:11 GMT
Opened by Robin D (Koaxiel) - Thursday, 02 February 2017, 07:43 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 24 March 2017, 16:11 GMT
|
DetailsSummary and Info:
systemd-nspawn follows instructions in /usr/lib/tmpfiles.d/systemd-nspawn.conf, i.e if you use btrfs, a subvolume is created for /var/lib/machines even in a container. makechrootpkg fails in this case to clean the "copydir" because btrfs refuses to delete "copydir" as long as child subvolumes exist. I attached a patch for makechrootpkg.in to try to fix this case. |
This task depends upon
Closed by Doug Newgard (Scimmia)
Friday, 24 March 2017, 16:11 GMT
Reason for closing: Fixed
Additional comments about closing: https://git.archlinux.org/devtools.git/c ommit/?id=eec7fcf965763d5395c336f92cd56b 193d054947
Friday, 24 March 2017, 16:11 GMT
Reason for closing: Fixed
Additional comments about closing: https://git.archlinux.org/devtools.git/c ommit/?id=eec7fcf965763d5395c336f92cd56b 193d054947
patch.txt
More relevant: Your patch doesn't reliably work. For example, on my machine, I'd end up with:
# btrfs subvolume list --sort=-rootid -o /build/extra-x86_64/noclaf/
ID 1441 gen 18140 top level 1440 path chroots/extra-x86_64/noclaf/var/lib/machines
But /chroots/extra-x86_64/noclaf/var/lib/machines isn't a real path -- it *should* be /mnt/Haven/chroots/extra-x86_64/noclaf/var/lib/machines (/build is a symlink to /mnt/Haven/chroots).
Aside, your patch has some syntactical/safety issues. You're expanding the output of btrfs directly into an array, which results in an array of words, not lines ('ID', '1441', 'gen', etc) rather than ('ID 1441 gen ...')
I read the thread on the mailing list and I wonder if symlink "copydir" to /var/lib/machines wouldn't be more preferable.
Thus we could use machinectl remove "copydir" to delete the subvolume and the child subvolumes. It wouldn't be necessary to use btrfs tools.
At the moment, I can't manage to remove the subvolume via machinectl because an issue with systemd : https://github.com/systemd/systemd/issues/2001
What do you think of this method?