Arch Linux

Please read this before reporting a bug:

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#64698 - [devtools] root chroot broken when someone logs in while mkarchroot is running

Attached to Project: Arch Linux
Opened by lilydjwg (lilydjwg) - Sunday, 01 December 2019, 11:19 GMT
Last edited by Jonas Witschel (diabonas) - Wednesday, 22 June 2022, 12:00 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Pierre Schmitz (Pierre)
Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No



Additional info:
* devtools 20191016-1

Steps to reproduce:
* make sure /var/lib/archbuild is not on btrfs (in which case this issue doesn't exist)
* run extra-x86_64-build -c
* while it's running pacstrap and has /var/lib/archbuild/extra-x86_64/root/run mounted, another user logs in, thus creating a new mountpoint /run/user/$uid that propagates into /var/lib/archbuild/extra-x86_64/root/run/user/$uid
* run extra-x86_64-build -c again later, you'll see the error:

$ extra-x86_64-build -c
==> Creating chroot for [extra] (x86_64)...
-> Deleting chroot copy 'root'...
rm: skipping '/var/lib/archbuild/extra-x86_64/root/run', since it's on a different device
rm: skipping '/var/lib/archbuild/extra-x86_64/root/run', since it's on a different device
==> ERROR: Working directory '/var/lib/archbuild/extra-x86_64/root' already exists
==> ERROR: Aborting...

I suggest adding `unshare -m` in front of the `pacstrap` command.
This task depends upon

Closed by  Jonas Witschel (diabonas)
Wednesday, 22 June 2022, 12:00 GMT
Reason for closing:  Fixed
Additional comments about closing:  devtools 20220609
Comment by Felix Yan (felixonmars) - Monday, 16 August 2021, 17:18 GMT
There is a patch at for this.

I am not an expert here though. Hopefully someone will analyze this and open a proper PR :)
Comment by Felix Yan (felixonmars) - Friday, 18 February 2022, 13:41 GMT Comment by Chih-Hsuan Yen (yan12125) - Saturday, 18 June 2022, 03:55 GMT
The merge request is merged and included in devtools 20220609 🎉