Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Recently I have installed Ubuntu 10.10 and selected a wrong option while installing it.

Now the problem is that my machine directly boots Ubuntu and even does not show me grub menu.

How do I install grub menu ?

And how do I add Windows Vista to the grub menu?

This is what I have tried.

sudo grub

> root (hd0,0)

> setup (hd0)

Error 17: Cannot mount selected partition

I don't know what's going wrong here and I am sure that I have not wiped out my windows partition.

Edit :

sudo update-grub

Generating grub.cfg ...  
Found linux image: /boot/vmlinuz-2.6.35-22-generic  
Found initrd image: /boot/initrd.img-2.6.35-22-generic  
Found memtest86+ image: /boot/memtest86+.bin  
ls: cannot access /media/BC54B2C654B282A6/boot  
Boot: No such file or directory  
done 

sudo os-prober

ls: cannot access /media/BC54B2C654B282A6/boot  
Boot: No such file or directory  

Thanks.

share|improve this question
    
thanks for the update - investigating what os-prober should do. Please add what devices have which system installed (e.g. /dev/sda1 Ubuntu; /dev/sda4 Windows). If you are not booting from removable media, (USB drive, etc.) remove it as the /media/BC5... entry seems to be gumming up the works. –  msw Dec 4 '10 at 15:54
    
@msw I am trying to run this command form installed ubuntu and I have removed all removable media. Thanks for your help. –  Searock Dec 4 '10 at 16:10
    
it definitely looks like grub is looking for some external media.Did you mount /boot on a separate partition? –  tinhed Dec 4 '10 at 16:27
    
@tinhed I have used my linux partition as / (root) while formating. –  Searock Dec 6 '10 at 12:24
    
I see that it tries to access /media/BC54B2C654B282A6/boot a directory that no windows have. Please, include all the scripts under /etc/grub.d. –  Braiam Apr 10 at 16:14

2 Answers 2

up vote 3 down vote accepted

I tried using sudo update-grub and sudo os-prober but I had no luck.

So this is what I have done.

sudo gedit /etc/default/grub and placed a comment # in front of the line GRUB_HIDDEN_TIMEOUT=0.

Then I updated my grub so that I don't have to press Left shift for the grub to appear using sudo update-grub .

After updating the grub I opened grub.cfg using sudo gedit /boot/grub/grub.cfg command.

And added

menuentry "Windows Vista" {

set root='(hd0,1)'

chainloader +1

}

between ### BEGIN /etc/grub.d/40_custom ### and ### END /etc/grub.d/40_custom ###

And don't forget to save the file.

I am marking this answer as Community wiki in case someone wants to add or modify this post.


Edit to update:

Meanwhile (2013) we have a GUI tool to repair/reinstall grub: Boot Repair.

To use it, do one of the following:

  • Create a live CD/USB of Ubuntu Secure Remix, which is an Ubuntu live with supplementary rescue tools, boot from that and use Boot Repair.

  • If you already have a regular Ubuntu live iso, create live usb with UNetbootin, live boot from that and install Boot Repair

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update

sudo apt-get install -y boot-repair && boot-repair &

(But apt-get update on a live USB might involve updates that take some time - and are also useless if the live usb is not persistent - so I recommend the first solution.)

Using Boot Repair to fix/reinstall GRUB is simple, just choose default/recommended repair option; more details here.

share|improve this answer

The first part is that the GRUB menu is there it just hides but the left-shift key during boot brings it up (as described in How to get to the GRUB menu at boot-time, on a single-boot system (not dual-boot) ? (obvious, no?)).

The second part is that update-grub should run os-prober and find your Windows boot and chain-load it. The output of update-grub would be helpful in figuring out what isn't happening correctly.

share|improve this answer
    
I have added update-grub output. Please help. –  Searock Dec 4 '10 at 15:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.