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 freswa (frederik) - Friday, 21 February 2020, 21:22 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
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 0%
Votes 1
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

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 :)