fn: storage_reconcile_persistence
Purpose
Repair or clean stale SolidGroundUX-managed /etc/fstab storage entries.
Behavior
- Detects stale managed entries whose configured source no longer resolves.
- Detects filesystems labelled SGND_STORAGE that are present but not referenced by a valid managed /etc/fstab entry.
- When exactly one stale entry and one replacement SGND_STORAGE filesystem exist, offers to replace the stale UUID/source while preserving mount point and options.
- Validates the resulting /etc/fstab before activation and restores the backup on failure.
- Mounts the repaired filesystem when its target is currently unmounted.
- Falls back to the previous explicit stale-entry removal workflow when repair is ambiguous.
- Never formats, repartitions, or otherwise modifies filesystem contents.
- Honors console dry-run mode.
Returns
- 0 when persistence is already valid, repaired, removed by explicit confirmation, or cancelled.
- Non-zero when a requested repair/removal cannot be completed safely.
Usage
storage_reconcile_persistence
