Recovering a backed-up root.disk, No grub, Error: No Such Device: 04B245F....

Asked by Thor aNDERSEN

I've been running Ubuntu under Wubi. Recently my Windows OS got totally corrupted. I was able to backup all my files (including everything in C:\ubuntu), but had to reformat the drive and reinstall Windows.

I cannot figure out how to reinstate my old disk image for Wubi. Nothing I've found online seems to apply to my situation.

I reinstalled Wubi and replaced the new root.disk with my old one, I choose the "Ubuntu" option in the Windows bootloader, it flashes some errors, turns purple and freezes on this error:

     error: no such device: 04B245F2B245E92E

     press any key to continue...

I'm having a hell of a time finding the "any" key on my computer, as nothing I press does anything. It's just stuck. Most troubleshooting guides I've found involve getting dumped into Grub or a command prompt at this point. I don't understand why I would end up at a Grub menu. Even a clean working install of Wubi doesn't go to a grub menu -- it goes straight from the Windows bootloader into Ubuntu. On both a clean Wubi install and on my backed-up Wubi root.disk /boot/grub/menu.lst does not exist.

I have been able to mount the old disk image from a clean wubi install, and gain access to my old ubuntu files that way. But I would like to recover all my files, programs, settings and configurations if there were some relatively easy way to accomplish this. Could I use rsync to copy the files over to the new disk image? Or is there some configuration file I could edit on the old disk image to point it at the correct "device"?

Question information

Language:
English Edit question
Status:
Solved
For:
Wubi Edit question
Assignee:
No assignee Edit question
Solved by:
Thor aNDERSEN
Solved:
Last query:
Last reply:
Revision history for this message
bcbc (bcbc) said :
#1

The grub.cfg (grub menu that replace menu.lst on grub legacy) is stored on the root.disk and it is used to boot Ubuntu. The problem is that it is pointing at the original partition it was on, not the new one you've installed wubi to.

So... Wubi boots like this:
1 BIOS
2 Window bootloader
3 grub4dos
4 wubildr
5 loop mount root.disk and show grub.cfg
6 boot using grub.cfg <=== this is the problem

You can just boot from the grub prompt by entering:
search --set=diskroot -f -n /ubuntu/disks/root.disk
probe --set=diskuuid -u $diskroot
linux /vmlinuz root=UUID=$diskuuid loop=/ubuntu/disks/root.disk ro quiet splash
initrd /initrd.img
boot

Then run (once booted):
sudo update-grub

That will update the grub menu.

Revision history for this message
bcbc (bcbc) said :
#2

Before you enter those commands, make sure the root.disk is loopmounted and set as $root:
echo $root

If that doesn't say (loop0), then first enter this:
search -s -f -n /ubuntu/disks/root.disk
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)

Then continue with the commands above starting with 'search -set=diskroot...'

Revision history for this message
Thor aNDERSEN (thor-t) said :
#3

Thanks for the tip. Copying the grub.cfg from the fresh install over the grub.cfg in my backed disk image did the trick.

Revision history for this message
bcbc (bcbc) said :
#4

That works if you have the same kernel version installed on both.
(but then you miss out on the fun of manually booting from grub ;-)

Don't forget to run 'sudo update-grub' to refresh grub.cfg.

Revision history for this message
Thor aNDERSEN (thor-t) said :
#5

Ah well lucky me. I couldn't figure out how to boot from grub, as the system would hang on boot.

Revision history for this message
Subhranshu Dwivedi (subhranshu) said :
#6

Thanks bcbc,

I worked smooth for me and i just got my ubuntu got moved smoothly to a new machine, with you solution,

and i am more confidant with grub also,

Thanks alot once again

Subhranshu