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

5 comments:

  1. sudo -o loop /win/ubuntu/disks/root.disk /vdisk
    this command is not running....
    plase help me mount my .disk file ne how...
    and if u give any reply please update me about it on bhupiister@gmail.com

    ReplyDelete
  2. Tell me more about your error!
    Have you mounted your "filesystem partition"(/dev/sda1 or /dev/sda2, etc) and were you able to access your root.disk file?

    Most probably you might have mounted a wrong "filesystem partition"!

    ReplyDelete
  3. Haha, the issue is with "sudo -o loop" -- you should do "sudo mount -o loop".

    Thanks for putting me on the right track! May others' linux installs be saved as mine has!

    ReplyDelete
  4. thanks. your post avoided me to format & lose data.

    ReplyDelete
  5. Thank you! Thanks to your post I could rescue some data I needed for work and some private data from a hard drive of a laptop which stopped working, it would have been terrible if the data had been lost. Thank you!

    ReplyDelete