Sunday, January 16, 2011

WUBILDR, WUBILDR.MBR and GRLDR

It's fairly common to see messages such as Try (hd0,0) : FAT16 when booting Wubi. Usually it's innocuous, but sometimes booting fails. You might see it stuck on Try (hd0,0) : Ext2  


Rarely you'll see something like:
Try (hd0,0) : FAT16: No WUBILDR
Try (hd0,1) : NTSF5: No wubildr
Try (hd0,2) : FAT32: No WUBILDR
Try (hd0,3) : invalid or null
Try (fd,0) : invalid or null
ERROR: Cannot find GRLDR in all devices: Press ctrl+alt+delete to restart



So what does this all mean, and what is GRLDR? 


Wubi uses GRUB4DOS combined with Grub2 to boot Ubuntu. GRUB4DOS has two parts: grldr.mbr and grldr. Wubi has renamed these to wubildr.mbr and wubildr (you are free to rename them as long as you insert the new name of grldr in the .mbr file). 


The wubildr.mbr file corresponds to a grub legacy bootloader in the Master Boot Record. It is limited to scanning all partitions to find the rest of itself - the part that doesn't fit in the tiny MBR. These are the messages you see as it scans all partitions - and since it is based on grub legacy it outputs partitions with a zero index (unlike Grub2 which still uses zero based indexing on the drives, but not on partitions) i.e. hd0,0 in wubildr.mbr corresponds to hd0,1 in Grub2.


No matter where wubildr.mbr is, when it is called, it starts scanning the root on ALL partitions in the order dictated by BIOS to find the wubildr file. If it doesn't find it, you get an error that it can't find GRLDR, not WUBILDR. The reason it says GRLDR is likely a hardcoded message - for Wubi it's always WUBILDR that it can't find.


So what are the reasons for failure to find WUBILDR? 
1. The rather obvious, but unlikely - there is no WUBILDR 
2. Excessive fragmentation apparently
3. The wubildr file is > 137GB from the start of the partition
4. You have an ext4 partition that is read prior to the one containing WUBILDR.
WUBILDR.MBR cannot read ext4 partitions. The GRUB4DOS code it uses is from 2007 and it simply hangs when it encounters one of these. If you have an ext4 partition higher up in the BIOS order than your Windows partition, you're out of luck.


Some interesting points: when you install Wubi it installs WUBILDR.MBR and WUBILDR to the windows drive C:. But it also installs it to other partitions, like recovery partitions. If these happen to be physically before the windows partition, WUBILDR.MBR will find this WUBILDR and never use the one on your C: partition (it uses the first one it finds). And this is interesting as Grub2 updates the WUBILDR on your /host partition - not always the one used. Maybe this is a clue as to why Grub2 updates no longer boot on some installs.

23 comments:

  1. I had a problem:
    Error.cannot find GRLDR in all devices. Press ctrl+alt+del to restart

    I solved it quite easily after reading your post.
    I searched the WUBILDR.* files on my Windows 7. They were located on the ubuntu folder. I copied -not moved- the 3 files directly to c:/
    and it worked!!
    Thanks!!!

    ReplyDelete
    Replies
    1. I'd unknowingly deleted the wubildr and wubildr.mbr files from C: and met with the same issue while booting ubuntu.
      But thankfully those files where located in the ubuntu folder.
      Just copied it to C: and it worked...
      Thankyou for the valuable information...

      Delete
  2. For me, the problem arose when I defragmented my C: drive.

    ReplyDelete
  3. Thanks you so much ^_*
    like you say I copied -not moved- the 3 files directly to c:/
    and it worked

    thanks allot it really help me

    ReplyDelete
  4. Murali....
    Thanks a lot.. It worked...............!

    ReplyDelete
  5. Thanks for the clear explanation. I faced this problem (GRLDR not found) after a boot drive defeat of my Win7 system.

    Copying 'wubildr' and 'wubildr.mbr' from
    'C:\ubuntu\winboot\' to. 'C:\' solved the problem.

    Many thanks

    ReplyDelete
  6. Thanks a lot! That really helped a lot... I had some important files in the ubuntu filesystem and was having problems recovering those. But this thing worked like magic!

    ReplyDelete
  7. The files wubildr and wubildr appear to be on my C: drive, but they are still not found. It's a big drive. Any suggestions?

    ReplyDelete
  8. Please post your support request to one of the sites mentioned here
    Thanks

    ReplyDelete
  9. Thank you, moving the files to c: worked like a charm

    ReplyDelete
  10. Update: wubildr.mbr can now read ext4 (and ext3 partitions) since release 11.10. Those on older releases are likely still affected by this problem.

    ReplyDelete
  11. These to files are in folder D:\ubuntu\winboot...where i install ubuntu.But when i am restart my ubuntu it gives same error i.e cannot find grldr.Any suggestion plz..mail me sahiltuteja07@gmail.com

    ReplyDelete
    Replies
    1. The wubildr file should be in the root of C:\ i.e. C:\wubildr while the wubildr.mbr is either in \ubuntu\winboot (Vista or 7) or in C:\ (XP)

      Delete
  12. I had this problem in 2011 and because I had project that was due soon i bought a new computer because i couldn't figure out the resolution to this problem.

    Once i got the new computer the same problem happened. I then reinstalled the new computer including windows. so i ended up losing both ubuntu and windows data.

    The problem has happened again and i have exhausted all i know to do. 1) chkdsk /r 2) multiple defragmenations 3) ensuring the wubildr is in c:\.

    Can someone please help?

    ReplyDelete
  13. copying files to c: drive did not solve my problem, but the last post at http://ubuntuforums.org/showthread.php?p=8989641 solved it.

    ReplyDelete
  14. Thanx A lot its working ........... i feel so happy.....................

    ReplyDelete
  15. Not to sound like a total newb with Ubuntu, but i went thru the installation process. Everything worked fine until i robooted and selected to run Ubuntu. An error msgs pops up instantly saying "try hd 0,0 no wubild, try hd 0,1 NTFS5: 2 try hd 0,2 no wubild found. It also says cannot find grldr in all drives. Press ctr+alt+del to reset."
    Now ive been thru most of the forums and its seemed to me that the problem was i didnt have a wubildr and wubuildr.mbr copied in my C:drive, so that was the first thing i checked. they were both there...
    I was then told to wait on reboot, and after a minute or 2 it would correct itself. sadly it did not.... ive tried this a few time now, but to no prevail.
    Upon closer reading of the forum sayin to copy wubildr files to c: drive, i noticed ppl were sayin to copy and paste "all 3" into c: drive. What is the 3rd one??? cuz all i have i c:drive is wubuildr and wubuilder.mbr.
    Idk what the problem with this is, but Im sure one of u can help. Please note, that i dont understand most of ur lingo, and have a very basic gateway computer to do all this. very good at following step by step instructions. Oh, also i am running ubuntu thru wubi, and not using a cd nor a floppy drive. Any info fast and simple would be a great help. <3

    ReplyDelete
    Replies
    1. Copying /wubildr and /wubildr.mbr is probably only useful if you've removed them (accidentally) and there is no 'third one'. Wubildr.mbr is running (that's what is generating the output: 'Try (hd0,0) etc'. So basically the problem is that it cannot read the NTFS partition (C:) properly. This has happened and it's not always clear why. In some cases it just cannot read the main NTFS partition and copying /wubildr to the hidden boot partition will fix it. It's best to post on ubuntuforums.org for support (or post a link here if you have one).

      Delete
  16. This comment has been removed by the author.

    ReplyDelete
  17. am getting try :hd(0,0): ntfs5

    ReplyDelete
  18. When I install Ubuntu over win 7 i have also problem this type but its cant solve because .mbr file not fount in my system and always give this error grldr not found what is the meant please suggest me what can i do

    ReplyDelete
    Replies
    1. It's looking for the /wubildr file which must be in the root of some partition i.e. c:\wubildr

      The .MBR file exists because it's running (that's what gives the message you see). Your problem may also be caused by grub4dos not being able to read your partitions (encryption, raid, ?).

      Delete
    2. so what can be done. I have searched the entire system but was not able to find the file and I am still getting the error while booting

      Delete