LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-16-2004, 06:58 PM   #1
Miky
Member
 
Registered: Dec 2002
Location: London / Paris
Distribution: Debian / OpenBsd
Posts: 74

Rep: Reputation: 15
Reinstallling grub


Hi,

I have tryed to install windows (uhuhuhuhuh) but i didn't work but I won't make you bored about that in here.

As you guess windows nuked my mbr.
Since then I installed lilo with my original debian boot cd, but lilo doesn't work for some reason, maybe because i run kernel 2.6.4 and didn't set up the good parameters because it has been done automaticly.

Now i'm trying to re install grub but in all the documentations i read, the explanations are starting from the moment they have the grub prompt ">" and I don't have this prompt as my system now boot directly on my openbsd system instead of having the multiboot.

Under openbsd, i'm able to mount all the linux partition in read only(i think) cause they are mounted as ext2 and not ext3
I'm also able to mount all the partitions with the debian cd install

So does anyone have an idea on how i could stick grub in the mbr ?

Thanxs
 
Old 04-16-2004, 08:57 PM   #2
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Rep: Reputation: 45
Find the linux partition that has your original grub.conf and that grub was orginally on and replace all the x with the right number and remeber that grub starts counting at 0 so subtract 1 off the partition number for grub.
Code:
chroot /dev/hxx /bin/bash
Code:
grub
Code:
root (hdx,x)
Code:
setup (hdx)
Code:
quit
[EDIT]
I guess i should add that when you use the chroot command you are now acting like you are running from that partition.

Last edited by darin3200; 04-16-2004 at 08:58 PM.
 
Old 04-17-2004, 01:28 PM   #3
Miky
Member
 
Registered: Dec 2002
Location: London / Paris
Distribution: Debian / OpenBsd
Posts: 74

Original Poster
Rep: Reputation: 15
Here's my partitions

/dev/hda1 /boot
/dev/hda5 /


I have been able to do
chroot /dev/hda5 /bin/bash


but when i type grub

root@(none):/#grub
Probing devices to guess BIOS drives. This may take a long time.
Error opening terminal: bterm

Any idea about what should i do ?

bye
 
Old 04-17-2004, 02:55 PM   #4
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
when you get to that terminal, i guess you could try the command:

grub-install /dev/hda
 
Old 04-17-2004, 03:45 PM   #5
Miky
Member
 
Registered: Dec 2002
Location: London / Paris
Distribution: Debian / OpenBsd
Posts: 74

Original Poster
Rep: Reputation: 15
Ok
I have mounted the partition with the installer
They are now mounted in /target

Then did
chroot /target /bin/bash

everything is fine until now

but then

#grub-install /dev/hda
Could not find device for /boot: Not found or not a block device.

Any idea ?
 
Old 04-17-2004, 04:12 PM   #6
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
i wasn't sure if that command would work at the recovery command line. can you boot up linux at all? if you made a boot floppy and were able to boot into linux, you could run that grub-install command. short of that, i don't know how you'd go about it at the place your at. it might be easier to just reinstall linux at this point in time since i don't see any other suggestions here on getting grub installed to where you could boot into linux.
 
Old 04-17-2004, 05:18 PM   #7
Miky
Member
 
Registered: Dec 2002
Location: London / Paris
Distribution: Debian / OpenBsd
Posts: 74

Original Poster
Rep: Reputation: 15
No, my laptop doesn't have any floppy disk, but here's the dilema.

I have 3 OSes on the notebook
Debian
Openbsd
Windows

So ok if I reinstall Debian it will be a workaround for this time but I'll have the same problem the next time windows will mess around with the mbr.

I'll proceed the reinstallation if I do not have any other solutions

Thanx
 
Old 04-18-2004, 03:47 AM   #8
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
umm, questions rather than answers are:
1) when you boot does it give you an initial screen of some kind of boot manager? And if you think you see one can you quickly press the escape key or the down arrow to stop the auto boot into BSD?

2) If 1 fails can you get into the partition that you KNOW is a linux partition and see a folder called /boot and this is where you will find grub and the menu.ist file?

3) When you installed BSD did you allow linux "emulation" to allow linux files to be run natively on BSD? And so can you open a terminal in BSD but run a linux command?

4) It may be possible depending on your answers to download grub stick it in the correct partition and re-install grub to MBR.

Unfortunately I know little about BSD having only tried it once so the better long term advice may be to start afresh???

edit my poor spelling

Last edited by aus9; 04-18-2004 at 03:49 AM.
 
Old 04-18-2004, 01:23 PM   #9
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
hmmm.... just saw this. it may help you out since you'd install grub through windows. and just use ntldr.

http://www.geocities.com/lode_leroy/grubinstall/

Last edited by megaspaz; 04-18-2004 at 01:25 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting password on grub, wha to do after changing default values in /boot/grub/menu. sarajevo Linux - Security 1 08-17-2005 08:01 PM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 08:13 PM
Why grub prompt after installing Grub inder Debian woody 3.0r2? velan Debian 1 04-20-2004 04:55 AM
1st HDD = RH9.0 (grub) ... How do I modify grub when adding 2nd hard disk ? Onyx^ Linux - Software 1 09-05-2003 09:16 AM
reinstallling yellowbelly Linux - Software 1 06-27-2003 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration