• CONTEST ALERT - Experience the power of DDR5 memory with Kingston Click for details

Grub Lost!!!

Status
Not open for further replies.

infra_red_dude

Wire muncher!
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.
 
OP
Dark Star

Dark Star

Cyborg Agent
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 :(
 

mak1012

Journeyman
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

left this forum longback
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

Wire muncher!
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?
 

desai_amogh

In the zone
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

In Pursuit of "Happyness"
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

In the zone
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

Wire muncher!
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

left this forum longback
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

In the zone
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
 
Last edited:

infra_red_dude

Wire muncher!
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

Journeyman
when i do give this command in grub> "find/boot/grub/stage1" it gives me this error
"Unrecognized command".
 

desai_amogh

In the zone
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

Journeyman
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

Wire muncher!
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.
 
Last edited:
Status
Not open for further replies.
Top Bottom