Monday, March 8, 2010

Mounting .disk files on Ubuntu

Sometimes we may be very unfortunate and we may not be in a situation to boot our Ubuntu. In such situations our only choice is to go for the file recovery.

This can be done easily in Ubuntu.

First use the Ubuntu live CD and boot your system.
Then locate the root.disk file. which is your Ubuntu's root directory.

If you have installed Ubuntu inside Windows
you may find this in C:\ubuntu\root.disk

in such situation you need to first mount your filesystem partition. This can be done by

Code:
sudo mkdir /win
sudo mount /dev/sda1 /win


always, replace "sda1" with the appropriate configuration, i.e. "sda2" or "sda3"...
(just remember: a=disk, 1=partition number)
and now you can find your partition in /win Directory.

Now you can mount your root.disk and this can be done by:
Code:
sudo mkdir /vdisk
sudo -o loop /win/ubuntu/disks/root.disk /vdisk


now your files in root.disk can be accessed through /vdisk