LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   plz help me to reinstall grub (https://www.linuxquestions.org/questions/linux-newbie-8/plz-help-me-to-reinstall-grub-707017/)

vibinlakshman 02-23-2009 11:40 PM

plz help me to reinstall grub
 
I had reinstalled my windows OS , so i need to change my MBR , but when i tried it in GRUB , its showing some strange errors

i'll show what i've done and the error got

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

grub> root (hd0,5)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 22: No such partition

Please help me , i forgot to take the cd key of windows , now no linux too , help me guys ..

linuxlover.chaitanya 02-24-2009 12:30 AM

Boot from media of the Linux that is installed in your machine and enter the rescue mode.
You will probably need to chroot.
Once that is done just reinstall the grub with

grub-install /dev/sda

Assuming your drive to be sda. Look what is it named.

Drakeo 02-24-2009 01:27 AM

for some reason the file boot is not on (hd0,5) it says there is no such thing as a (hd0,5) are you sure it is there another thing hate to say this but windows restore disk likes to wipe out the whole system and restore everything back to oem just one big partition good luck I pray that did not happen to you. how many partitions does windows see let me guess drive C for the fist partition then what .and look at your partitions. hd0,5 in windows world would be what drive F
Quote:

Error 22: No such partition
get a live cd boot it copy any thing you need and then reinstall.

vibinlakshman 02-24-2009 02:13 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3455249)
Boot from media of the Linux that is installed in your machine and enter the rescue mode.
You will probably need to chroot.
Once that is done just reinstall the grub with

grub-install /dev/sda

Assuming your drive to be sda. Look what is it named.

May i knw , "what is this boot from media of Linux that is installed"?
I just took the first option when CD booted, "Try without installing"
Is this correct .
And when i took terminal nad just checked /boot/grub/menu.list , there is no file like that ..?

Sounds i've made a mistake ,right ? but my contents of ubuntu are still there in my system , only the problem for MBR

While installing i had formatted only C: drive.. is this ok, i can still find my other partition and its content both from windows and Ubuntu

Am I confusing?

linuxlover.chaitanya 02-24-2009 02:48 AM

It is not clear what you are talking about. If you are using a LiveCD then there is no way it will install the grub and you wont find the file.
Boot from the LiveCD, open terminal and type

sudo grub-install /dev/sda

To find what your hdd is named type

sudo fdisk -l

vibinlakshman 02-24-2009 09:21 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3455349)
It is not clear what you are talking about. If you are using a LiveCD then there is no way it will install the grub and you wont find the file.
Boot from the LiveCD, open terminal and type

sudo grub-install /dev/sda

To find what your hdd is named type

sudo fdisk -l

What steps would u take normally to reinstall a grub , the steps that i had done is shown below , is there any mistake let me knw please

1. Inserted Ubuntu cd , and tried first option itself "Try ubuntu without installing in the system"

Do u normally take this option and after take terminal , i dont knw any other way to take terminal

2 . Then i performed operations which i had given in my first thread

And even i tried sudo grub-install and all , but no use , i had provided
my fdisk output below

ubuntu@ubuntu:~$ sudo fdisk -l
omitting empty partition (5)

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

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2611 20971520 c W95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary.
/dev/sda2 2611 5222 20971520 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 5223 9729 36202477+ 5 Extended
Partition 3 does not end on cylinder boundary.
/dev/sda4 9545 9729 1485981 82 Linux swap / Solaris
Partition 4 does not end on cylinder boundary.
/dev/sda5 5223 9544 34716402 83 Linux



please help me to get my ubuntu back , i will be grateful , help

yancek 02-24-2009 07:42 PM

Quote:

grub> root (hd0,5)
Quote:

/dev/sda5 5223 9544 34716402 83 Linux
Your fdisk output shows your partitions go up to 5 (sda5) and you are trying to install Grub to root partition of sda6 (hd0,5) which does not exist.

Try: root (hd0,4)
setup (hd0)
quit

vibinlakshman 02-24-2009 07:54 PM

Quote:

Originally Posted by yancek (Post 3456289)
Your fdisk output shows your partitions go up to 5 (sda5) and you are trying to install Grub to root partition of sda6 (hd0,5) which does not exist.

Try: root (hd0,4)
setup (hd0)
quit



No way dude

grub> root (hd0,4)

grub> setup (hd0)

Error 17: Cannot mount selected partition

Any idea !!

vibinlakshman 02-24-2009 08:06 PM

So no one out there who knws grub editing ..
Oh man this is disgusting , i wonder how do find solutions for these stuffs. I just experimented with grub to make sure every suggestions were true or not ..But failed ..

OK thank u , all who helped me ..

To all new folks , dont try with grub , it will harm u !!!!!!!

louieb 02-24-2009 08:59 PM

root (hd0,5) would be correct. But from what you have posted something has happened to your /boot/grub/menu.lst if that is correct then post #2 by linuxlover.chaitanya should work. Did you try it? What happened?
Code:

sudo grub-install /dev/sda
More that most want to learn about grub can be found here. IDBS GRUB Page

linuxlover.chaitanya 02-25-2009 03:44 AM

What?

grub-install /dev/sda did not work?

Why? I guess that is what you need. Instead of going into live cd mode if you can enter the rescue mode then it will more useful but even if you are booting off live cd and then in terminal type
Code:

sudo grub-install /dev/sda
that should install boot loader in MBR. And that is what you want I guess.

linuxlover.chaitanya 02-25-2009 03:45 AM

Post got double posted though I click reply only once.

vibinlakshman 02-25-2009 07:14 AM

Sorry nothing worked...!!
 
Quote:

Originally Posted by linuxlover.chaitanya (Post 3456623)
Post got double posted though I click reply only once.

Sorry to say nothing had worked , i was learning bit about how to edit grub , unfortunately i had experimented with my own system , so whatever all my friends posted didnt worked , so i need to install two OS once again normally . Neither grub-install worked , nor the former method .

Dont worry i'll definitely come with this solution , nobody had come across this error , right , thats what the problem ..

Thanks for every one ...


All times are GMT -5. The time now is 11:05 PM.