• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

linux wont boot! MBR problem i think.

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

gsrcrxsi

Member
Joined
Feb 21, 2008
Location
Baltimore, MD
ok so i have 5 HDDs. 1 320GB and 4 500 GBs. the 320 GB has the xubuntu 8.04 installed on it. one 500 GB drive has XP installed on a 20GB partition (rest blank) and the other 3 drives are formatted in xfs for file storage. well normally when i want to switch between OS's, i have to just go into the bios and reset which drive is the first HDD. ie, 320 is #1 if i want to boot linux, and the 500 if i want to boot XP. so i wanted to boot XP and it said boot error. so i popped in my super grub disc and booted XP that way. well that must have messed with the MBR because when i tried to switch back to linux, it would not boot. i can boot linux via the super grub disc but i CANT get grub restored to boot linux by itself. ive tried using the disc to fix the boot, to fix the MBR, to fix anything and so far nothing has worked. i could care less about XP, i just want my linux to boot up without the grub disc forcing it to boot.

someone help!
 
when you boot into linux, what happens when you try to install grub on the MBR. What happens when you don't use the grub cd? Does it not recognize the drive or does it load grub but have a grub error? Also, try running fdisk and type 'p' to display the partition table and make sure that the boot partition is set as bootable.
 
when not using the disc it says "Error Loading Operating System" and i have to restart.

when i tried to install/fix the MBR using the gurb disc it says "Error 15 SGD has not succeded"
 
ok SGD wasnt hacking it to fix this so i manually reinstalled GRUB on the MBR from the grub menu and it seems to have worked. w00t!
 
Ok, the problem comes from approaching dual boot from the wrong angle. You don't want to be switching stuff in the bios, it's asking for trouble, adds complexity, is annoying, and is totally unnecessary.

Set up the bios to work normally, then pop in a livecd (e.g. the ubuntu installer, knoppix, etc.) Load that up, mount linux, chroot, fix your grub.conf, and do a grub-install again to the correct drive, and it will recreate the mbr.
 
The whole purpose of GRUB is to allow multiple boot options. You do not want to be switching anything in the BIOS. Have the BIOS set to boot from the XP drive, set up your grub.conf properly (with entries for both XP and Ubuntu) and install grub to the XP drive (/dev/hda most likely, but make sure you don't select /dev/hda1 or 2 etc., you want it on the MBR, not a partition)
 
Make sure you do not set your bios that it is swapping drive mappings around. I've seen people do that and it never leads to anything good.
 
XP is and was a temporary install. its only purpose is for stability testing. so i threw it on an empty drive. i didnt want to complicate my linux drive at all by having seperate partitions and junk. plus i unplug and rearrange my drive order often so that would require me to change the grub settings every time i did that. and in linux the other drives are mounted via UUID so drive order or name (sda, sdb, etc) doesnt matter and that how i want it. this way all i have to do is select the proper drive to boot from in the bios and it boots up. i prefer it this way, SGD just messed this up, usually i dont have to use it. for what im doing, having 2 MBRs is better IMO.
 
You would not need multiple partitions at all to set up dual boot. You could easily have a linux drive and an xp drive and just run off one mbr with grub.

If you are using the bios to change boot order, you are just asking for trouble.
 
its my way of keeping everything seperate. its a personal preference. i know i dont need seperate partitions on the same drive, but theres no way they can be on the same partition, they use different file systems. this way theres not a single shred of windows on the linux drive and vice versa on the windows drive. and thats how i want it.

this error came from the SGD, like i said i normally dont need to use it. from now on ill just unplug every drive except the one im working on if i need to work with the MBR at all.
 
What MRD is saying is that you can have these different operating systems on different drives, and be able to choose between them from GRUB, without messing with the BIOS. If you install GRUB onto your MBR of the drive with linux, but put an entry in the grub.conf file for windows (it pointing to a different drive), and then just keep the drive with linux as your primary boot drive, then you can pull out the windows drive when needed. It makes no difference to grub.
 
yea and when i remove that drive and put it back maybe in a different SATA port on the MB and it all the sudden gets a different drive assignment, i have to edit the file to properly boot it. this way i just pick the correct drive, which doesnt change no matter what port its plugged into to.
 
If you're switching out drives that often for the fun of it, you may need a better hobby :) What, exactly, is the purpose of physically removing and replacing drives so often?
 
one way that you can use grub with your current setup to boot both linux and windows xp is to add a section to your grub.conf that is similar to this:

Code:
title	Windows
root	(hd1)
map	(hd0)	(hd1)
map	(hd1)	(hd0)
chainloader	+1

with your current setup with so many drives, your hard drive(s) maybe numbered differently. it took a little bit of playing around with it for me to figure out what was correct, but it should work for you.

basically it will just hand off the booting to the bootloader on the drive with windows xp on it. makes it a little easier than having to switch in the bios.
 
I'd just remember which SATA port I plugged the drive into and use the same one each time. =P
 
I'd just remember which SATA port I plugged the drive into and use the same one each time. =P

The problem is, with the latest kernels, sda1 may become sdb1 on the next boot. This is a widespread problem. Using UUID or /dev/disk/by-label are solutions until kernel hackers straighten this mess out.
 
Not really a problem unless you are plugging in and removing external bootable devices all the time. Usually, when I boot a LiveCD or any distro, I have sd[a-c]. sda is my Windows drive, sdb is my Linux drive, and sdc is my files drive. No matter what distro, they come in that order. If I plug in my USB card reader with a card in it before booting, my BIOS tries to boot from it, and fails. It then boots a LiveCD or any other distro I may have installed. The distro/livecd picks up the USB device as /dev/sda, and what I usually expect to be sd[a-c] become sd[b-d]. This is to be expected, as the BIOS, in the process of making the detected USB storage device bootable, and having that before "boot from CD" or "boot from HD", means the USB device, being the first bootable device, obviously is the "first" drive from the BIOS perspective. Not sure how NTLDR handles this, but as far as I'm concerned, it's perfectly understandable that if you are reffering to drives by letters, whether Windows-style [A-Z]: or *nix-style /dev/sdX, adding extra BIOS devices such as USB drives is going to mess with that. Hence the other methods (such as UUID). It's really not a hard change to make to adapt to using a UUID, and once you change your fstab, it's rather transparent, as a drive mounted to / or /home or some such doesn't require you to know the UUID except for mounting. The problem here is not the kernel devs, the problem is the distros refusing to make the definitely-not-huge switch to UUID. SuSE has been using UUID-based mounting by default for several minor versions, now, with the option to switch to other methods if wanted. Blame the distros, not the kernel. Or, write a better BIOS that adds USB devices after other devices regardless of whether they're a boot device or not. Again, I have not seen a single case of this being an issue with drives that are physically plugged in to the motherboard via SATA or IDE.
 
well chalk this up to #1 pettey, because what misfit said is exactly what happens. even without unplugging them, sda can become sdb or sdc, etc between boots for disks plugged into the MB.

its funny how you guys are so adamant to change the way i like to do things. its works for me, and its (IMO) the best solution to keep it all separate. its how i want it. deal with it lol.
 
Back