I was running a systemd-nspawn container with command:

systemd-nspawn --console=passive -qbUD container-directory 2>&1 >/dev/null &

to provide a clean build environment. While cleaning up, I forgot to shutdown the container init and instead issued this command on the host console:

sudo rm -rf container-directory

Immediately, I realized that something was wrong because the shell would complain that the directory isn't empty. I tried to shutdown the container with:

sudo machinectl stop container-directory

but noticed that the container won't shut down. In this situation, would there be anything outside of the container that might have been lost? I'm worried that items in /sys or /proc may have been affected if they were mounted via bind mount. There wasn't anything seriously important on the whole system, but I'm wondering if the system may have become unstable due to the effect of this command, such as losing the content of efivars.

1 Answer 1


As for /sys I remember a story from the past when deleting efivars bricked devices but I don't remember how it ended. I'm still confident that wasn't the issue with Linux itself but with bad EFI ROMs which couldn't handle the situation. If I'm not mistaken the issue manifested itself only after trying to reboot/power cycle, so what you did couldn't have affected your running system.

Nothing in /proc can be deleted, this directory is always RO.

but noticed that the container won't shut down.

It won't shut down probably because it can't find the files. You still can kill the relevant processes.

In the end I'd double check that EFI is still set up properly (sudo efibootmgr) before attempting to reboot.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .