LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-27-2006, 07:10 AM   #1
LQer928
LQ Newbie
 
Registered: Apr 2005
Location: Australia
Distribution: Slackware 10.1
Posts: 17

Rep: Reputation: 0
GRUB error when Mepis is removed.


Hello.
I was dual-booting Mepis with Windows, after Mepis is removed I can no longer boot into Windows. Since GRUB is the default boot-loader, I get a error message saying : GRUB loading, error 22.
I guess it has something to do with the fact that GRUB has been integrated into Mepis, any solution to this problem?
On a similar note, if distro-independent boot-loader like SmartBootManager was in use, what should I do when the distro(any Linux distro) prompts to install LILO or GRUB, if I want to keep SBM?
Thanks.
 
Old 02-27-2006, 07:17 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
If you use NT/2000/XP: Use your Windows installation CD and enter the recovery console. Use the command fix-mbr and the NT bootloader will be installed in the MBR.

If you use DOS/Windows9x/Me: Boot from a boot floppy or the installation CD and enter fdisk /mbr.

Håkan
 
Old 02-27-2006, 07:59 AM   #3
LQer928
LQ Newbie
 
Registered: Apr 2005
Location: Australia
Distribution: Slackware 10.1
Posts: 17

Original Poster
Rep: Reputation: 0
Even though it is a legitimate copy of XP, I do not have the installation CD since it was installed by the manufacturer.
Is there anything can be done from Linux? I just installed a minimal version of CentOS, that is how I am able to ask the question.
 
Old 02-27-2006, 08:25 AM   #4
smiley_lauf
Member
 
Registered: Jan 2006
Location: NY
Distribution: Fedora 15 x64
Posts: 344

Rep: Reputation: 30
Two quick Qs:

1. Have you tried the MEPIS Live CD and logged in as root, then, install me, then you will be in MEPIS OS center, re-install GRUB????
2. DId CentOS not put a boot loader for you (I think this is LILO by default)?

Smiley
 
Old 02-27-2006, 09:51 AM   #5
LQer928
LQ Newbie
 
Registered: Apr 2005
Location: Australia
Distribution: Slackware 10.1
Posts: 17

Original Poster
Rep: Reputation: 0
Hi, Smiley!
1.For your information, I can just follow what you have mentioned and re-install GRUB without having to re-install the distro, is that correct?
2.I think LILO is, but it is integrated into CentOS as well and was installed in MBR.
What happens now is that I have to keep a distro dual-boot with Windows, otherwise I can boot straight into it. I just want to install Linux whenever I desire and still able to use Windows as a standalone OS.
 
Old 02-27-2006, 10:09 AM   #6
smiley_lauf
Member
 
Registered: Jan 2006
Location: NY
Distribution: Fedora 15 x64
Posts: 344

Rep: Reputation: 30
I am also on alearning curve with matters of GRUB; I personally have dual boot (MEPIS now and WinXP), had Ubuntu before MEPIS. As far as I know, once you install Linux grub, and you remove the distro (I am assuming you reformatted the MEPIS partition???), you get into problems you decribed in your post above.

MEPIS live CD allows you to install grub if grub becomes "corrupt". I have not tried it without actually having a distro installed. You could give it a try. If al fails, you will have to use the WINXP CD and do the fix-mbr, to get to boot straight to WinXP.

Grub seems to be better bootlaoder than LILO IMO, and Ubuntu's grub is quite "intelligent" ac npick up other OS without a sweat.

Sorry, let me get this right: you have installed CentOS with LILO and are having problems booting into Windows? Or do you want to boot and default o windows, and not give you the option of chosing which OS to boot to? Is this is the case, I am afraid, I am not sure how to proceed.

I hope that helps,
Smiley

Last edited by smiley_lauf; 02-27-2006 at 10:26 AM.
 
Old 02-27-2006, 10:41 AM   #7
LQer928
LQ Newbie
 
Registered: Apr 2005
Location: Australia
Distribution: Slackware 10.1
Posts: 17

Original Poster
Rep: Reputation: 0
Hi, Smiley!
That is exactly what I did, I booted into MEPIS and re-format those partitions previously occupied by MEPIS. Then when I reboot, I run into that problem.
So, if I follow your instruction to re-install GRUB somewhere else, then the corrupt one will be obscured by the new one, is that correct?
It works fine after I installed CentOS, but what I want is to be able to boot into Windows with or without Linux present.(not that I like Windows, but I share the machine with family members.)
I have people from other forums suggesting that the reason behind the problem is because when the distro is removed by whatever means, the bootloader (in my case, GRUB) no longer has any configuration file. Sadly, they did not provide any solutions.
Thanks again.
 
Old 02-27-2006, 10:58 AM   #8
smiley_lauf
Member
 
Registered: Jan 2006
Location: NY
Distribution: Fedora 15 x64
Posts: 344

Rep: Reputation: 30
Did CentOS not provide with boot options to boot into Windows? I am not familiar with LILO, but you should see something like this when you boo tup (in text mode)

LILO boat loader <title>

CentOS on /dev/hda6

Other OS
Windows XP professional on /dev/hda1

MEMTEST (whatever...)

I am afraid, multibooting, means having to get a boatlaoder installed in MBR to allow to access the bootable partitions. I have seens threads where GRUB gets installed on the root partion linux installtion. I tried this, but las, my friend, I got royally screwed, and could nto boot at all. Perhaps someone with expertise can chip in right now... iam running out of ideas.

MEPIS Grub will not work with CEntOS LILO, it will not see CentOS (my experience here, I may be wrong).

ta,
Smiley
 
Old 02-27-2006, 02:09 PM   #9
victorh
Member
 
Registered: Jul 2005
Location: La Paz, Bolivia
Distribution: Debian Sarge - Sid, Slackware, Gentoo, openSuse, Fedora, Ubuntu, Mandriva
Posts: 241

Rep: Reputation: 30
This is the procedure at booting if you have GRUB installed at the MBR:

Stage 1 of GRUB is recorded in the MBR, this is because of the limited space you have in the MBR, the Stage 1 simply loads Stage 1.5 or 2 normally from a local disk, and is stored in the /boot/grub directory. So there you go, if you wipe out Mepis. GRUB starts from the MBR but when it tries to point the filesystem where Stage 1.5 or 2 is located if finds nothing. So if you want to use GRUB in CentOS you have to install it again, overwriting the MBR and seting up the /boot/grub directory.

The same goes for LILO, but with other characteristics. I suggest you to use GRUB since it's the bootloader that you'll find in almost all the new releases.
 
Old 02-27-2006, 04:29 PM   #10
smiley_lauf
Member
 
Registered: Jan 2006
Location: NY
Distribution: Fedora 15 x64
Posts: 344

Rep: Reputation: 30
this recent thread http://www.linuxquestions.org/questi...ghlight=Saikee

and wiki http://en.wikipedia.org/wiki/MBR were very helpful, if it makes any difference.
Good luck.
 
Old 02-27-2006, 07:34 PM   #11
LQer928
LQ Newbie
 
Registered: Apr 2005
Location: Australia
Distribution: Slackware 10.1
Posts: 17

Original Poster
Rep: Reputation: 0
Alright,guys! Now I have a better understanding of what is happening with the bootloader:
1.without the Windows installation CD, I cannot clear the MBR;
2.if I wanted to dual-boot, then a bootloader has to be installed in the MBR;
3.if the bootloader was not installed in the MBR but in the /boot partition of Linux, then a boot floopy has to be created during installation;
Thanks so much, Smiley and Victorh!
 
Old 02-27-2006, 07:41 PM   #12
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
You could download the "Ultimate Boot CD" which contains all the tools to restore the MBR.

I'm not sure about Smart Boot Manager, but most bootloaders, if you want them to exist after you nuke the OS require a separate (usually really small) partition for their config files. For example, if you install your next linux with a separate /boot partition, you should be able to just delete the linux partition and grub will still have it's boot loader config files on /boot.

I personally use XOSL and only need a 14MB partition to hold all the info. Then when I install linux, I just tell it to install the bootloader to the root partition instead of to the MBR.

From windows, I've heard there's a bootloader you could install called "GRUB for NT". My understanding is that it'll keep your grub config files on your XP partition...
 
Old 02-27-2006, 07:56 PM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,050

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
Quote:
Originally Posted by LQer928
Alright,guys! Now I have a better understanding of what is happening with the bootloader:
1.without the Windows installation CD, I cannot clear the MBR;
2.if I wanted to dual-boot, then a bootloader has to be installed in the MBR;
3.if the bootloader was not installed in the MBR but in the /boot partition of Linux, then a boot floopy has to be created during installation;
Better maybe, incomplete still.
1. Wrong. Any reasonably recent DOS boot disk will allow you to fix it using "fdisk /mbr". Floppy images can be downloaded from the web in need. If you have a mate with a Win2k/XP CD, I suspect that will work o.k. as well using fixmbr. Doesn't appear to be a license requirement involved.

2. If you want to boot at all you need loader code in the MBR - e.g. applies to a windows only disk. The BIOS boot code enforces this requirement.

3. A floppy is one (poor) option. Multiboot aware loaders (basically anything except Windows default loader) can chainload to these installs. The SBM you mentioned is one such.

Installing to a separate partition is a good way around your issue - even for grub (or lilo). I do so with grub, and continually trash Linux installs without repercussion.
 
Old 02-27-2006, 08:12 PM   #14
Franklin
Senior Member
 
Registered: Oct 2002
Distribution: Slackware, Windows 7
Posts: 1,253

Rep: Reputation: 55
This scenario is one of the reasons I stick with lilo.

Lilo gets installed to the MBR and the config file is located in /etc. However, when you run lilo after setting up lilo.conf, it reads the config file and keeps this info until you edit the cofig file again and re-run lilo. This means I can remove linux completely and lilo will still work because it does not need to read the config file with every boot.

Grub on the other hand reads the config files with every boot and so when one removes the OS (and the /boot directory with it) you are left with a crippled bootloader. Not cool.
 
Old 02-27-2006, 09:50 PM   #15
LQer928
LQ Newbie
 
Registered: Apr 2005
Location: Australia
Distribution: Slackware 10.1
Posts: 17

Original Poster
Rep: Reputation: 0
Hello! Thank you for replying, great help!
Now, let me state all of the solutions provided by you guys:
1.making use of those tools on Ultimate Boot CD to restore MBR;
2.using fdisk /mbr from any recent DOS boot disk;
3.making use of a multiboot-aware loader, eg. SBM;
4.installing the bootloader on a separate partition "/boot" and is
it just a LILO thing or applies to GRUB as well that I should
ensure that the /boot is within the 1024 cylinders limit, unless I
am using a very recent version of LILO with lba32 support and a
recent lba32 BIOS.

Once again, I really appreciate your help.
 
  


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
Booting with GRUB WInXP,FreeBSD 6,Mepis 3.1 Tha1 MEPIS 4 01-09-2006 04:47 AM
Mepis, GRUB and XP boot loading problems eccentric4 MEPIS 9 09-25-2005 07:32 PM
Grub "error 18" on Mepis cottonmouth Linux - Newbie 3 02-25-2005 07:36 AM
xp won't boot with mepis and grub chiklit Linux - Newbie 3 01-04-2005 02:48 AM
Removed Second HD with Dual-Boot RH9/XP Box; Now Grub Won't Load MadFunk Linux - General 1 01-05-2004 07:29 PM


All times are GMT -5. The time now is 01:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration