LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2008, 01:16 PM   #1
KOTAPAKA
LQ Newbie
 
Registered: Feb 2008
Location: UK
Distribution: Debian
Posts: 21

Rep: Reputation: 15
Clean MBR


OK the MBR is the first half a kilobyte sector in the HD. So when you install a new system does it delete the MBR and write data on again or just add data and hence data from previous installs might be left there? I am asking as I have the following problem:
2 weeks ago I installed and reinstalled debian (about 5 times). Now I have 1 Debian on sda3 and Scientific on sda2. I installed scientific after debian, didn't like its grub and so I reinstalled grub from Debian. Now what I get when I reboot is my current Debian and then I det previous debians as well. This happened when I reinstalled the Debians as well - after every install I got one more Debian booting option even though I installed them on the same partition (formating it first). Of course previus versions cannot be booted but why are they still there? This must mean some data has been left in the MBR? I know how to remove them from the menu but how do I remove that data from the MBR?

Last edited by KOTAPAKA; 03-28-2008 at 01:17 PM.
 
Old 03-28-2008, 01:29 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,549
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

When you write to the 'MBR' you are writing to the 'Master Boot Record'. You do not concatenate to the 'MBR' but write the bytes period.
 
Old 03-28-2008, 02:06 PM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by KOTAPAKA View Post
OK the MBR is the first half a kilobyte sector in the HD.
Less than that. The MBR and the primary partition table are both in the first 512 bytes.

Quote:
So when you install a new system does it delete the MBR and write data on again or just add data
An install either rewrites the whole MBR or none of it. It does NOT add data.

Quote:
after every install I got one more Debian booting option
That is in the /boot/grub/menu.lst file, not in the MBR.

Some Linux installers look around, including in the prior copy of /boot/grub/menu.lst and look at anything that looks like a Windows install and use all that information to construct the new menu.lst file. So anything that could have been booted before the new install still can be.

It sounds like that process is going overboard and including in the new menu.lst file kernel(s) that the same install is deleting.

That's more convenient than missing things it should have preserved.

Edit the /boot/grub/menu.lst and remove all the obsolete entries.
 
  


Reply


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
How to clean MBR since Windows XP Bob_Esponja Linux - Newbie 3 12-12-2006 06:26 AM
Restoring MBR :partitions are detected only after the reboot after MBR restoration? sharathksin Linux - Newbie 2 04-14-2006 08:48 AM
How can I wipe the MBR clean and remove GRUB stevod333 Linux - General 7 04-03-2006 10:51 AM
HD won't boot after clean OS installs. Unfixable MBR? Guivre Linux - Hardware 1 04-22-2005 09:24 PM
How to clean super block and MBR under Linux preswang Linux - General 5 10-30-2003 06:31 AM


All times are GMT -5. The time now is 08:16 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration