DIGIT-ARC read-only archive · snapshot: July 23, 2026

Grub Lost!!!

24 posts · originally from https://geek.digit.in/community/threads/grub-lost.66822/

Dark Star
Dark Star Original post #1
Aug 29, 2007 at 4:30 PM
Hi all
I was having Ubuntu only. Now my sis got a new phone and to see its Cd she installed windows now my grub is lost ... :(How can I re install the grub so that I can boot into Ubuntu and Xp both :mad: So plz lemme know soon :cool: If there are easy method then plz lemme know :p

I know this link but easy steps needed :) I press tab key after that I get annoyed :p

*help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
infra_red_dude
Aug 29, 2007 at 4:42 PM
simple steps to recover grub.

boot into the live cd and open a terminal windows. now type:

"sudo grub"

it'll then give you a grub prompt, "grub>"

now type: "find /boot/grub/stage1" at the grub prompt.

it'll give a output like this (hd0,7) 7 is here the example boot partition. note this down.

now type:"root (hd0,7)" (replace hd0,7 wid whatever output u'd got in the prev. step.

then type: "setup (hd0)"
it'll setup grub again.

now type:"quit"

its over! you get the grub menu now :) if at all the windows entry is not there. boot into linux after performing the above mentioned steps and add this line in /boot/grub/menu.lst:

title Microsoft Windows
root (hd0,0)
savedefault
makeactive
chainloader +1

hd0,0 above assumes that you've installed windows in the first partition of the first hard disk. if this is not the case then replace 0,0 wid relevant data to ur system.
Dark Star
Aug 29, 2007 at 5:06 PM
That didn't helped still I am not getting I got (Hd0,2) I did as you told but grub did not appear :( it directly started windows :(
infra_red_dude
Aug 29, 2007 at 5:15 PM
don't use a capital "H" there and try and see if it works.
Dark Star
Aug 29, 2007 at 5:35 PM
No I didn't used H i used h .. but it doesn't showed up :x
mak1012
mak1012 #6
Aug 30, 2007 at 12:52 AM
even i have the same problem.... which au password should i wright i tryed all the password which i had given but non of them worked....
praka123
Aug 30, 2007 at 9:07 AM
How to Grub restore via Live CD

boot from live-cd(ubuntu).then find ur ubuntu partitions.use the o/p of
Code:
sudo fdisk -l
for details.
manually mount ur ubuntu partitions.if u have a separate /boot partition,u have to mount it inside ubuntu / partition's /boot directory.
post ur sudo fdisk -l
and will try to explain what to do.
infra_red_dude
Aug 30, 2007 at 11:08 AM
yeah, thats a longer process. but this should've worked too. dunno whats the problem. @shashwat, when you execute those commands do u get any error msgs?
The_Devil_Himself
Aug 30, 2007 at 7:12 PM
I don't use ubuntu but in mandriva you just boot from the dvd and choose recovery and then install grub\lilo.
desai_amogh
Aug 31, 2007 at 6:45 AM
im facing the same problem..i dont mind reinstalling ubuntu ..
but thr is lot of data in it >> i need to copy it in a diff drive..
but it asks for root permissions for copying >> i know my root password >> but i dont know how to login using root >>
i am using the same cd which i used to install ubuntu ..
kalpik
kalpik #11
Aug 31, 2007 at 7:32 AM
If you are on ubuntu, there IS no root password. Just type gksu nautilus, and use your own password. Then you can copy-paste. Just be very care full with nautilus in super user mode!
desai_amogh
Aug 31, 2007 at 7:39 AM
kalpik said:
If you are on ubuntu, there IS no root password. Just type gksu nautilus, and use your own password. Then you can copy-paste. Just be very care full with nautilus in super user mode!

so du u mean tht .. when i use live cd .. it doesnt need a root password to for user permissions ??
& u have to use the super mode to activate the user permissions ??
infra_red_dude
Aug 31, 2007 at 8:34 AM
desai_amogh said:
im facing the same problem..i dont mind reinstalling ubuntu ..
but thr is lot of data in it >> i need to copy it in a diff drive..
but it asks for root permissions for copying >> i know my root password >> but i dont know how to login using root >>
i am using the same cd which i used to install ubuntu ..
plz try the above method first. why do you wanna go the long way? are you getting any errors or problems while recovering grub?
praka123
praka123 #14
Aug 31, 2007 at 8:41 AM
the soltn in simple words is to boot from livecd,mount ur ubuntu / (/boot partn too if any) manually.then chroot into ur hdd ubuntu / partn.install grub(grub-install /dev/sdx or if the grub is completely gone.use grub> prompt to set grub in the place of MBR)
.i think that is well documented in ubuntu link @OP gave.

btwn if it is ubuntu,u can get root access via "sudo" or if u insist a "#" prompt.then "sudo su -" will gave u root prompt.
desai_amogh
Aug 31, 2007 at 9:05 AM
when i do find /boot/grub/stage1
i get the output as "(hd0,8)"

but when i do root "(hd0,8)"
it says something like the disk is not reconized .. i dont remember the exact error ..

it was hd0,8 but it was replaced to a smiley
infra_red_dude
Aug 31, 2007 at 10:20 AM
hey remove the quotes from that line. type:
Code:
root (hd0,8)
and then
Code:
setup (hd0)
widout quotes everywhere.

@shashwat
is ur problem solved?
mak1012
mak1012 #17
Aug 31, 2007 at 12:16 PM
when i do give this command in grub> "find/boot/grub/stage1" it gives me this error
"Unrecognized command".
desai_amogh
Aug 31, 2007 at 12:23 PM
infra_red_dude said:
hey remove the quotes from that line. type:
Code:
root (hd0,8)
and then
Code:
setup (hd0)
widout quotes everywhere.


hey im not using the quotes .. tht was just a copy paste business..

@mak1012
u r using the same mistake we r talking abt..
dont use the '' doublequotes
instead type it this way grub> find/boot/grub/stage1

and it 'should' work for u.
mak1012
mak1012 #19
Aug 31, 2007 at 12:41 PM
desai_amogh said:
hey im not using the quotes .. tht was just a copy paste business..

@mak1012
u r using the same mistake we r talking abt..
dont use the '' doublequotes
instead type it this way grub> find/boot/grub/stage1

and it 'should' work for u.

no its not working i'm not using any quotes.....

Device Boot Start End Blocks Id sytem
/dev/sda1 * 1 2611 7 HPFS/NTFS

like that i have in sda3 System is Linux and in sda6 System is Linux swap /Solaris
infra_red_dude
Aug 31, 2007 at 1:35 PM
there's a space between "find" and "/boot...."

here's the alternative (but a longer) proces, which prakash was talking about. you'll need a live cd wid rescue option (ubuntu 6.1,7.04 won't do). get something like a knoppix cd etc...

boot from the live cd. at the prompt where it asks you to boot, enter
Code:
linux rescue
if this doesn't work then simply enter
Code:
rescue

after you get the shell type this:

Code:
mkdir /mnt/linux
(this is to create a folder to use as a mount point)

then type:
Code:
mount /dev/hda6 /mnt/linux
here hda6 is the partition where linux is installed. for others it maybe hda5,hda7,hda9 or sda6,sda7 etc. or whatever...

Code:
chroot /mnt/linux
this command will change the root FS to ur installed linux system.

then type:
Code:
mount /proc
this is to mount the proc file system.

now type this to install grub:
Code:
grub-install /dev/hda

or type:
Code:
update-grub

if you are using grub-install then replace hda wid sda if thats relevant to ur installation.
vish786
vish786 #21
Aug 31, 2007 at 11:22 PM
do u hav mandriva dvd try it, sometimes it works best for recovery of grub, when most distro's fail to rescue grub/or reinstall grub.
Dark Star
Dark Star #22
Sep 1, 2007 at 8:35 AM
I'll post the output soon damn busy these days;)
Dark Star
Dark Star #23
Sep 3, 2007 at 10:00 PM
Code:
ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1275    10241406    7  HPFS/NTFS
/dev/sda2            1276        6949    45576405    f  W95 Ext'd (LBA)
/dev/sda3            6950        9728    22322317+  83  Linux
/dev/sda5            1276        3825    20482843+   b  W95 FAT32
/dev/sda6            3826        6757    23551258+   7  HPFS/NTFS
/dev/sda7            6758        6949     1542208+  82  Linux swap / Solaris

infra_red_dude said:
simple steps to recover grub.

boot into the live cd and open a terminal windows. now type:

"sudo grub"

it'll then give you a grub prompt, "grub>"

now type: "find /boot/grub/stage1" at the grub prompt.

it'll give a output like this (hd0,7) 7 is here the example boot partition. note this down.

now type:"root (hd0,7)" (replace hd0,7 wid whatever output u'd got in the prev. step.

then type: "setup (hd0)"
it'll setup grub again.

now type:"quit"

its over! you get the grub menu now :) if at all the windows entry is not there. boot into linux after performing the above mentioned steps and add this line in /boot/grub/menu.lst:

title Microsoft Windows
root (hd0,0)
savedefault
makeactive
chainloader +1

hd0,0 above assumes that you've installed windows in the first partition of the first hard disk. if this is not the case then replace 0,0 wid relevant data to ur system.

This 1 did not help :( Well I did everything right but damn it :mad:
infra_red_dude
Sep 3, 2007 at 11:07 PM
i dunno whats wrong.. its NOT possible that all the methods fail!!! i'd say get hold of a knoppix cd or similar which has a s rescue mode and then install grub the way mentioned before in this thread. it'll hafta work.

and from the fdisk -l output linux root sure is hd0,2. it shudn't give you any probs!!!! i fail to understand what is being done wrong and where!

ok wait.. ur partition structure looks a bit quirky to me!! sda2 is an extended partition. how come you haf one more extended partition on which linux is installed? (sda3)??? i think there has been some mess up while installing!!! and thats why all the above methods are failing...