I am new to linux so I used to use both Windows Xp and Ubuntu.But due to problem in Windows,I re-installed Windows,but While re-starting the system, OS choice menu lost from Boot, Windows automatically opens, and ubuntu lost..,How can I find it..?

Dani AI

Generated

Short summary: reinstalling Windows overwrote the bootloader so the machine jumps straight into Windows — exactly what described. Two useful approaches have already appeared in the thread: using the GRUB prompt from a Live session (as demonstrated and corrected), or mounting the Ubuntu partition from a Live session and reinstalling the bootloader (as reported). The remaining issue — the “Unknown partition” error when you select Ubuntu — means GRUB can’t find the files it expects (wrong partition number, changed device order, or a mismatch between GRUB versions).

Quick diagnostic checklist (from a Live CD/USB):

  • Identify which partition actually holds Ubuntu (look for a Linux filesystem and a /boot directory).
  • Inspect /boot/grub: if you see a grub.cfg file you’re on GRUB2; if you see legacy stage files you’re on GRUB Legacy. The repair steps differ slightly depending on that.
  • Check whether disk ordering changed (two disks can cause what used to be hd0 to become hd1) — that will make GRUB point at the wrong device.

Practical next steps (conceptual):

  • If GRUB is pointing to the wrong partition, set the bootloader’s root to the partition that contains the Ubuntu files and reinstall the bootloader to the first physical disk.
  • If the “find /boot/grub/stage1” method fails, that usually means you have GRUB2; use a Live session, mount the Ubuntu partition and either chroot into it and run the distro’s grub-install/update-grub sequence or use a repair utility built for this purpose.
  • If you hit syntax errors in the terminal, remember shell syntax is literal: commands aren’t function calls. Use the normal form to become root or prefix individual commands with sudo.

If uncertainty remains, note which files you find under /boot/grub and post that listing here — mention the exact partition device (for example the sda/sdb number) and the GRUB files you can see. That information lets others recommend the exact command sequence safely.

Recommended Answers

All 7 Replies

Using the live CD boot Ubuntu and go to desktop. Then open terminal(from accessories) and type following:

// Spaces are crucial be careful about them where they are and where they are not.

sudo grub

find /boot/grub/stage1 ( u'll get something like "(hd0, 11)" )

root (hd0,11) here the number 11 should be different for you

setup (hd0)

When I Type "sudo grub"
Following Output came out,But finally it had given error:

[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]

grub> find /boot/grub/stage1
(hd0,6)

grub> root(hd0,6)

Error 27: Unrecognized command

grub> root(hd0,6)

Error 27: Unrecognized command

grub>

>root(hd0,6)
You need to put a space between 'root' and the parentheses: root (hd0,6)

That stuff works and Ubuntu came to boot.But While I choose Ubuntu from boot,it says ---: Error:Unknown Partition,Please help me to came out of here.

The same problem occured to me also. All I did was boot into the live cd and Opened the console,

changed to super user mode(sudo su) and reinstalled grub.

First u have to mount the ubuntu partition. In my case it is

mount /dev/sda5 /media/

and then

grub-install --root-directory=/media/ hd0

and then I reboot.

First thing happened to me is while I type mode(sudo su) OR mode (sudo su) [including and excluding space between mode and braces] ,It came same output:
ubuntu@ubuntu:~$ mode(sudo su)
bash: syntax error near unexpected token `sudo'

And second Problem is to give directory of the logical drive.In places menu it shows five drives(MUSIC,EMPTY,14.1GB Media( Lost Ubuntu),15.7GB Media(Win Xp),New Volume).You gave directory like /dev/sda5 /media/ I can't understand.What can i do.

Using the live CD boot Ubuntu and go to desktop. Then open terminal(from accessories) and type following:

// Spaces are crucial be careful about them where they are and where they are not.

sudo grub

find /boot/grub/stage1 ( u'll get something like "(hd0, 11)" )

root (hd0,11) here the number 11 should be different for you

setup (hd0)

I also have same problem but the smallest difference is that I'm using vista home basic along with ubuntu.
Now when i tried the above commands "find /boot/grub/stage1" gave an error saying "File not found" ,what can i do next.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.