#986721 live-boot: Failed to unmount /run/live/medium: Device or resource busy - which might corrupt live USB sticks

#986721#5
Date:
2021-04-10 07:51:26 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?
     When rebooting or halting the Debian live system, it gives these
error messages:
     Failed to unmount /run/live/medium: Device or resource busy
     systemd-shutdown[1]: Could not detach loopback /dev/loop0: Device
or resource busy
     systemd-shutdown[1]: Failed to finalize file systems, loop devices,
ignoring.

     This error might corrupt the file system on the live USB flash drive.
     It been reported on different forums:
     https://github.com/systemd/systemd/issues/17988
     https://github.com/grml/grml/issues/109
     https://github.com/grml/grml/issues/150
     https://github.com/systemd/systemd/issues/2814

     System developers mentioned: "isn't the simpler and better fix to
change debian to not set things up that way? Specifically, why expose
the "components" of the overlayfs at all? why not just leave them
outside the tree when pivotting into the overlayfs?"

     This issue is not solved yet in live-boot 1:20210208. Is any
workaround we can try to avoid this?
     Thank you very much.

#986721#10
Date:
2021-04-15 17:25:50 UTC
From:
To:
[…]

The key problem is the deletion of the original root ramdisk in its init scripts. This needs to be avoided so there is a valid root (and upper mount) to switch back to on shutdown.

My attempts of getting the mount chain to untangle without changing that were fruitless xD
( https://github.com/systemd/systemd/issues/17988 )

[…]

#986721#15
Date:
2021-05-30 06:02:34 UTC
From:
To:
As I posted on https://github.com/systemd/systemd/issues/17988,

it seems systemd 248 has fixed this issue?
I tired systemd (248.3-1ubuntu1) from Ubuntu impish and systemd
(248.3-1) from Debian experimental, this are no such error messages anymore:
Failed to unmount /run/live/medium: Device or resource busy
systemd-shutdown[1]: Could not detach loopback /dev/loop0: Device or
resource busy
systemd-shutdown[1]: Failed to finalize file systems, loop devices,
ignoring.

Not sure if the error messages are hidden or is this issue really fixed...

Steven