Need filesystem recovery after no unmount (crash/kill/poweroff)

Project:JNode FS
Component:Code
Category:feature request
Priority:critical
Assigned:Unassigned
Status:active
Description

Reproduction:
1. Start JNode in a VM with a harddisk mounted
Partition can be either FAT32 or ext2.
2. Kill the VM (same as poweroff of a real machine, or as a crash)
3. Start JNode again

Actual result:
The filesystem is mounted readonly or can't be mounted or is entirely broken.

Expected result:
Robustness in case of crash, poweroff and similar.
This is obviously critical in real use of JNode.

It's not possible to *guarantee* that, with most filesystem types, but it's possible to make corruption *unlikely* (e.g. only when poweroff during a critical, physical write to disk exactly at that moment) and confined to the files which were written at the time of poweroff.

#1

It lead us to the subject of writing checkdisk for each filesystem type.

Each time JNode is booting, a light checkdisk should be done for each mounted persistant filesystem (so, the RAM disk filesystem won't be checked).
If a potential corruption is detected, then force a complete checkdisk of that corrupted filesystem and try to recover it. As you guess, that light checkdisk should be fast enough to avoid increasing too much jnode boot time.

Additionnally, like it's done in kubuntu, a complete checkdisk could be forced each 30 mounts (that value should be configurable).

#2

Fabien D, completely agreed.