Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
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?


  Search this Thread
Old 06-17-2008, 08:48 AM   #1
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, 09:06 AM   #2
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
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
Notice sections 3.2 and 3.3

Last edited by johnsfine; 06-17-2008 at 09:09 AM.
Old 06-17-2008, 09:33 AM   #3
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
does grub-install not work in this case ?
Old 06-17-2008, 09:51 AM   #4
Bruce Hill
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,932

Rep: Reputation: 128Reputation: 128
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, 10:21 AM   #5
LQ Guru
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,397

Rep: Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416
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, 01:40 PM   #6
Senior Member
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

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

check the file

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, 05:35 PM   #7
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!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:47 PM
Linux Boot partition - maximum sector on HD VicRic Linux - General 3 10-07-2006 03:47 PM
Windows Overwrites the linux boot sector when i install it yubyub General 6 08-04-2006 10:43 PM
Windows installation erased linux boot sector? xelt Linux - General 5 05-01-2005 02:35 PM
Linux Installation: Boot Sector too big!! dewang Linux - Software 2 01-15-2001 10:34 AM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:42 AM.

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