GRUB trouble - installing to unbootable logic partition / other options
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
GRUB trouble - installing to unbootable logic partition / other options
I have some difficulties with my current boot/partition setup. To avoid any misunderstandings, I'll describe my (somewhat special) setup first:
I have two SATA HDDs, the first (sda) only contains one primary partition with Windows XP on it and an unchanged MBR, i.e. NTLDR on it. The second (sdb) contains one primary partition with Debian Sid's root filesystem (sdb1), a logical partition with Debian's /home (sdb5), a logical swap (sdb6) and a last logical partition with a fresh install of Ubuntu 8.10 64bit (sdb7).
In order to get GRUB starting by default, I changed the boot preference in the BIOS to try the second HDD first, but that also changed GRUB's numbering scheme: sda is now hd1 and sdb is hd0 - at least before booting. If I start a GRUB prompt in Debian, sdb1 is then hd1 (God knows why).
So, in order not to overwrite the MBR of sdb in any way, I chose not to install GRUB during my Ubuntu installation. Only problem being that this leaves me with an unbootable Ubuntu. At first I just wanted to add an entry to my menu.lst (in sdb1) to load the Ubuntu kernel, but that didn't work at all.
I'm really not an expert when it comes to GRUB, but I think that may be because it cannot boot a logical partition directly (don't kill me if I'm mistaken ).
So I looked up some things about GRUB and figured that somehow chainloading might work, which would even allow me to retain Ubuntu's automatic kernel list. But that means I'd need to install GRUB to the Ubuntu partition without affecting anything else. Unfortunately, both grub-install and grub> setup refused to work.
As you might have guessed, I'm pretty clueless on this matter. Can anyone enlighten me? All help is appreciated.
I infer that you are able to boot into Debian (ie that's where you attempted the GRUB install). What I would do is install GRUB on the mbr of the Linux drive, and configure the BIOS to boot from that drive. With GRUB on the Linux drive, you can chainload to the Windows drive. All this allows you to keep the Windows loader in the MBR of the Windows drive.
If you cannot get into any of the installed Linux OSes, you can install GRUB from a live CD.
if GRUB is already installed, then you just need the correct entry for Ubuntu. Assuming that the BIOS has this drive as #1, then the menu.lst entry for Ubuntu will include:
root (hd0,6) ##the location of /boot for Ubuntu
in the kernel line, root=/dev/sda7
If you have to install GRUB from live CD, you need to take into account what the drive numbering WILL BE when the BIOS has the Linux drive as #1. Here's an example: From live CD, the Linux drive is seen as #2 (hd1 to GRUB), but it will be #1 when booted from the BIOS....and the desired /boot is on the first partition.
grub ##opens the GRUB shell
root (hd0,0) ##tells grub that **AFTER REBOOT** it will find /boot on the first partition of the first drive
setup (hd1) ##tells grub to put boot code in the MBR of what is **CURRENTLY** drive #2 (Will be #1 on reboot, but GRUB does not need to know that....)
Regardless of whether you follow all this, you may find the "booting" link--below in my sig--useful.
Thanks for the quick replies guys.
Quite obviously I failed to exactly describe my problem: Booting either Windows or a Debian kernel works absolutely fine (after I adjusted the GRUB settings to account for my special numbering case). I also have no intention to change anything on the Windows HDD, as I like to keep it in its original state, in case I once majorly screw up when experimenting on my Linux disk (which is why I left the Win code in the MBR and only installed GRUB to the Linux disk).
The current problem I have is getting Ubuntu running. As I mentioned, I tried simply putting the following into my menu.lst:
You're on the right track, but if that new (root) system is ext3, the old Debian grub won't talk to it due to the change in inode size.
Best solution is to boot the Ubuntu CD, choose the (Ubuntu) disk and "boot" (i.e. chroot) into that. Do the grub-install from there. It'll need to go in the MBR. Add your Debian (and 'doze if you want to that) entries to that menu.lst - they won't be found automatically because that is a function of the distro installer, not grub itself.
BTW, grub can boot logical partitions fine - that not the problem.
Just had another thought - if you don't mind re-installing Ubuntu.
Do a mkfs on your Ubuntu partition from Debian. Then re-install using that partition without re-formatting. I don't know if you can do that from the normal install CD - I always use the "alternate" CD so I can do things like this.
You'll now have a partition the Debian grub will talk to.
So you're saying that Ubuntu 8.10 is basically too modern for my (older) Debian GRUB to read it properly, because the inode size is (apparently) 256 now and not 128? Pardon my ignorance, but I really don't have a clue about file systems, let alone "inode sizes".
Would there be a way to update my Debian GRUB to read the new format? As I really want to keep Debian as my main system and make use of its handy update-grub scripts, I only installed Ubuntu for the sake of playing around and getting to know it.
If not, would chainloading be an option or does that fail for exactly the same reason?
Ok, thank you very much for clearing this up. You sure are big help.
I think what I'm going to do is install the new Ubuntu GRUB into the MBR and then either chainload Debian or experiment with the configfile method I stumbled upon accidentally.