Saturday, April 7, 2012

solution for ubuntu not loading stuck in grub terminal


This has cost me lot of my time and effort to recover from this weird situation. There were some other methods to get rid of this situation. But i had a more unique requirement. That i needed my ubuntu installation restored. Because there were lot of things inside my ubuntu installation which were really important. I hope you are someone like me. You don't need loss your ubuntu installation.

Let's move on. 

I had ubuntu installed inside windows 7 using the wubi installer. One day i have shut down the machine after using with ubuntu and i disconnected my power supply before the system shuts down. Unfortunately , my laptop battery has been removed at that time (for a replacement) and when i disconnect the power supply it was totally without power. Next time when i started the machine and i select the ubuntu from operating system selection menu, it goes to grub terminal..

something like this 

grub>

There was a note mentioning that you can see the commands by pressing TAB key. I have tried various methods mentioned in internet and i had lost one of my partitions by doing those things. But finally i found a solution.

When you boot Windows and look in the C:\ubuntu\disks directory you'll notice the root.disk is missing. In some cases, the \ubuntu\disks directory is missing completely or is corrupted.

Running chkdsk
Depending on the problem, Windows may have run an automatic chkdsk or you may need to run it manually. It's not always necessary, but it will never hurt, so the first thing is to run it.
  • Go to My Computer on XP or Computer on Vista/7,
  • right click the drive you installed Ubuntu on e.g. right click on C:,
  • select Properties, select the Tools tab, then under Error-checking click Check now.
  • Select to Automatically fix file system errors or Scan for and attempt recovery of bad sectors 
  • When the drive you installed on is C: the computer will tell you it has to schedule the scan for the next time you start your computer. Reboot to complete. 


Locate recovered files/directories
The first thing to do is to look for the \found.000 folder on the drive in question i.e. C:\found.0000. This is hidden by default and (on my Windows 7 install) I also had to tell Windows not to "Hide protected OS files" just to see it. You may also have to recover from an administrator command prompt on Win7 (see below).

Hit the START key, enter CMD, then look above and right click on CMD.exe and select "Run as
Administrator".


C:\>cd \found.000
C:\found.000>dir
 Volume in drive C is OS
 Volume Serial Number is B4B7-99A8

 Directory of C:\found.000

19/07/2011  02:02 PM    15,000,000,000 file0000.chk
               1 File(s)              8 bytes
               0 Dir(s)  222,258,069,504 bytes free


So now you look for your root.disk (or other .disk files) and copy them back to the \ubuntu\disks folder. If the entire \ubuntu\disks folder is missing, you'll likely find a dir0000.chk directory and within that the root.disk, swap.disk and empty \boot\grub folders. Copy this back to \ubuntu renaming the directory todisks.

C:\found.000>move file0000.chk \ubuntu\disks\root.disk
        1 file(s) moved.

or if the whole disks folder is recovered
C:\found.000>move dir0000.chk \ubuntu\disks
        1 dir(s) moved.


If you're missing the root.disk but there is no file of that name, it may have been renamed chk0000.chk. Rename this to root.disk and copy back to \ubuntu\disks.

If the corruption was minor, then likely everything will work fine. If the corruption is major Windows may not even recover the root.disk at all.

I hope this helps you to recover your files. Remember to backup important data on your Wubi install. There's no reason to install important personal files on a root.disk - you can access them easily on the /host partition.

Cheers !!!!!!!!!!!

This site has helped me in solving this issue 


No comments:

Post a Comment