Subject: Re: Filesystems not unmounted on reboot

From: Rutherther <[email-masked]>
Date: Fri, 21 Mar 2025 17:50:51 +0100

Hello guys,

I am writing with an update, because not everything I wrote in the first
e-mail was true exactly. Please let me know if updates distrub you and I
won't be CCing you again.

"Rutherther" <[email-masked]> writes:

>
> I have created a VM system, tried rebooting a few times and it was fine,
> however then I tried reconfiguring, and for that run I got an error upon
> reboot. Not only that, I can't boot it anymore :) the filesystem got
> corrupted in a way that prevents boots. Welp.

This wasn't the case, I just haven't realized the correct partition to
boot from is /dev/vda2, not /dev/vda1, I copied the image from guix repo
and haven't realized it's wrong (I suppose it haven't used efi before,
but switched to it?). Since the images get the FS replaced by custom
partitions, this error was visible only after reconfigure. After
changing it to /dev/vda2 I am able to boot, but fsck is ran to repair
damage done.

>
> I am attaching both log (starting after reboot command)
> and the configuration used for the vm.
>

Since this was the first reconfigure after the system obtained by guix
system image, the log isn't exactly accurate to what would happen on
subsequent reconfigures.

The previous time the error was that / is busy. Maybe it was because of a
change in the filesystem services from the initial image to custom
config with `file-systems`
While that is definitely an issue as well, it might not be completely
related to the issue reported here by others. (imo there should be a way
for cases where the user is making big changes like changing file
systems to tell reconfigure to not apply it to the running system, to
only apply the bootloader and switch only after boot)

I am attaching log of reboot/halt after subsequent reconfigures where
the issue is manifested a bit differently. It is not / that would be
busy, but /run/user that is busy. I still think it could be because of
wrong order of stopping services, /run/user/0 is unmounted last,
but root file system tries to be unmounted prior to that.

Note that this doesn't happen without a reconfigure, I get this behavior
only after a reconfigure. The reconfigure can happen with no changes to
the config nor guix instance ran. I get this behavior consistently
on every reconfigure ran!

[  202.675565] shepherd[1]: Ignoring error while stopping root-file-system: (system-error "umount" "~S: ~A" ("/run/user" "Device or resource busy") (16))

Regards,
and apologies for two messages when it could've been one if I paid
more attention.
Rutherther