tails-greeter: give feedback while successfully repairing a damaged persistent filesystem
Originally created by Tails on #5760 (Redmine)
When one enables persistence with a persistent FS whose state is inconsistent state, tails-greeter appears to hang, while it’s actually waiting for the fsck/recovery process to finish. Some people will interpret this as a system crash, because it takes longer than normal.
On a 14GB test persistent volume, the recovery took more than a minute. It continued booting fine after recovery.
Relevant kernel messages:
kjournald starting. Commit interval 5 seconds
EXT3-fs (dm-0): using internal journal
EXT3-fs (dm-0): recovery complete
EXT3-fs (dm-0): mounted filesystem with ordered data mode
Also, regarding filesystem corruption caused by users unplugging their USB stick while the Persistent Storage is mounted, @sajolida suggested:
- When unlocking, we create a flag file in the Persistent Storage.
- When shutting down cleanly, we delete this flag file.
- If this empty file is there when unlocking the Persistent Storage:
- In all cases, we can instruct the user to shutdown properly next time.
- If the file system is corrupted, it can help us troubleshooting this failure mode.
(In theory we should know whether the filesystem was unmounted cleanly or not, and the ext4 repair operation is visible in the kernel logs, but I doubt udisks makes this info available to us, so a flag file may be the best approach.)