LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-17-2008, 07:48 AM   #1
Keithj
Member
 
Registered: May 2005
Location: Essex and Norfolk
Distribution: Debian, Fedora 8 and 9, Mandriva 2009, Mepis, Kubuntu, SuSe 10.1, Slackware 12.1 - and Knoppix.
Posts: 155

Rep: Reputation: 30
How to create a boot sector under Linux?


The hard drive that used to be drive C when this was a Windows machine, and then became hda under Linux, died a week or so ago. I replaced it with a new hard drive, and reinstalled all the stuff that was on there - nothing lost.

EXCEPT that it won't boot. Fortunately, I have a GRUB boot floppy so can still work, but NOWHERE can I find how to create a MBR or boot sector in Linux. Various sites suggest using a Windows 3.1 boot floppy and doing an FDISK /MBR - but surely that's a cop-out, and anyway I don't have a Win 3.1 boot floppy any more. The last one I had self-destructed years ago.

Is there really no Linux command that will create an MBR on hda?

Then, how do I get GRUB boot onto it? I have the menu.lst and all the rest. All I have to do once the GRUB floppy has started is type
configfile (hd0,0)/grub/menu.lst and off we go - with all the different distros on the machine available to select.
 
Old 06-17-2008, 08:06 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
You list a few distributions, so even if I knew/remembered the right distribution specific details, I wouldn't know which to provide.

I did a quick google search and the top several hits I found were all just suggestions to get those instructions from man grub-install or info grub-install. I'm not at a Linux system now to check how obvious the answer will be within that man or info output.

You also might try Grub documentation, such as
http://www.gnu.org/software/grub/man...ode/index.html
Notice sections 3.2 and 3.3

Last edited by johnsfine; 06-17-2008 at 08:09 AM.
 
Old 06-17-2008, 08:33 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
does grub-install not work in this case ?
 
Old 06-17-2008, 08:51 AM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
I've never had a problem after issuing "liloconfig". I did have problems
trying to figure out the esoteric GrUB info, which seems to be where
this thread is heading.
 
Old 06-17-2008, 09:21 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
You don't create an mbr you install grub to it. If you have a grub boot floppy, put it in the drive and at the grub prompt (grub>)type:

root (hd0,0)(assuming Linux is on sda1, hit enter)
setup (hd0)(hit enter)
quit(hit enter)
 
Old 06-17-2008, 12:40 PM   #6
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
after you booted using the floppy:

check the file
/boot/grub/menu.lst
or
/boot/grub/grub.conf

if the contents are o.k. - should be the case if you partitioned your new drive the same way as your old one
(...and as you can use it to boot using the floppy)

then issue:

grub-install --no-floppy /dev/_your_device

and you should be good
 
Old 06-17-2008, 04:35 PM   #7
Keithj
Member
 
Registered: May 2005
Location: Essex and Norfolk
Distribution: Debian, Fedora 8 and 9, Mandriva 2009, Mepis, Kubuntu, SuSe 10.1, Slackware 12.1 - and Knoppix.
Posts: 155

Original Poster
Rep: Reputation: 30
Thank you! So easy when you know how. Worked perfectly.

grub> quit brought up an error message "Error 27: Unrecognised command", but the reset button took care of that.

Job done!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up a /boot sector after windows and linux are installed? lifeforce4 Linux - Newbie 11 02-19-2008 04:47 PM
Linux Boot partition - maximum sector on HD VicRic Linux - General 3 10-07-2006 02:47 PM
Windows Overwrites the linux boot sector when i install it yubyub General 6 08-04-2006 09:43 PM
Windows installation erased linux boot sector? xelt Linux - General 5 05-01-2005 01:35 PM
Linux Installation: Boot Sector too big!! dewang Linux - Software 2 01-15-2001 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:07 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