Ubuntu – How to check integrity of system if Wubi not shut down properly

fsckrecovery-modewubi

For argument's sake, let's say that my Ubuntu installation of 14.04 (32-bit) using Wubi was not shut down properly, either due to it hanging or forcibly being shut down by a critically low battery. Also, for argument's sake, I am able to restart wubi without any problem. Does this mean that the integrity of the system (particularly, root.disk) has not been compromised? How would I go about checking this? Would running fsck in recovery mode suffice, or would I need to do something more?

Best Answer

You can run file system integrity checks on the host partition (NTFS) as well as on the root.disk (ext3/4). You should always run it in this order, because the root.disk is also a file and if it is corrupt, trying to fsck it won't help and may in fact damage it further.**

So, when I am concerned due to some event, for example a hardware crash that Alt+SysRq REISUB couldn't recover and a hard shutdown was required,... then I would:

  1. Boot Windows and select the host drive, Tools, Repair. If it's C: then you'll have to reboot and let Windows boot to get chkdsk to run.
  2. Boot from a Live USB/DVD and fsck the root.disk:

    fsck -fvy /media/win/ubuntu/disks/root.disk

You could probably fsck it in recovery mode also, but usually doing it from a live CD is easiest.

** I am very convinced of this having worked with many people who've lost their Wubi installs, and it seems that running fsck first (usually via boot-repair) on a corrupted NTFS filesystem can damage the root.disk beyond repair.

Related Question