Ubuntu – How to recover Ubuntu data if it’s installed inside Windows


I want to install Ubuntu inside Windows.

However, if Windows gets corrupted, how can data from the Ubuntu system be recovered?

Best Answer

The data can be recovered if Windows is unbootable but you can still access the filesystem. All of the data is stored inside of a filesystem image called C:\ubuntu\disks\root.disk.

Simply boot an Ubuntu livecd, mount the NTFS partition and then mount that image (sudo mount -o loop /path/to/root.disk /mnt), get to where you mounted it (/mnt if you used the above command) and backup your data.

If you cannot mount the root.disk and you suspect filesystem corruption, then you should do the following (the order is important):

  1. Run chkdsk /r from Windows to fix any NTFS file system corruption
  2. Mount and fsck the root.disk from a live CD in case there is ext3/4 corruption

If there is no file system corruption you can also access the root.disk from within Windows using ext2read