rancher / elemental-toolkit

:snowflake: The toolkit to build, ship and maintain cloud-init driven Linux derivatives based on container images
https://rancher.github.io/elemental-toolkit/docs/
Apache License 2.0
282 stars 49 forks source link

Ensure subvolume snapshots is mounted to list snapshots #2098

Closed davidcassany closed 1 month ago

davidcassany commented 1 month ago

This is fixes an issue about how we were updating the state.yaml file after upgrades. For the corner case of running upgrades from the recovery system the <state_partition>/@/.snapshots is unmounted before upgrading the state.yaml and this mount is required to properly list available snapshots and reflect that in state.yaml.

davidcassany commented 1 month ago

Yes, in fact there used to be only a snapshotsUmount one, but no snapshotsMount. It was this way because there was the assumption it was only mounted once and at the very same stage for all cases. This turns not to be accurate enough when upgrading the snapshot from the recovery system (likely to be a squashfs image on a different partition).