LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Dual Boot Slackware with CentOS using CentOS GRUB (http://www.linuxquestions.org/questions/slackware-14/dual-boot-slackware-with-centos-using-centos-grub-874480/)

frankbell 04-11-2011 09:29 PM

Dual Boot Slackware with CentOS using CentOS GRUB
 
I would post this in a CentOS forum, but there doesn't seem to be one here at LQ. I know there's a Red Hat forum, but as a long-time Slackware user, I'd rather ask this question here. If I should ask it in the Red Hat forum, please just steer me in the right direction.

Background:

For various reasons, I have to learn my way around CentOS. I have an old computer (P3) with Slackware on it. I threw in a second HDD that I had lying around and installed CentOS to it. I was figuring that I'd just decline installing GRUB or point GRUB to Slackware as the second OS and end up with dual boot.

The CentOS install, though, blew right past that part with offering me any options. It put a small boot partition on the CentOS drive and now the box boots straight into CentOS.

I've spent the better part of the day trying to get GRUB to boot the Slackware drive and had no luck, though I've learned a lot about GRUB error messages.

By the way, CentOS uses GRUB v 0.97.

Question:

I was wondering if someone could point me to a reference that would help.

Here's the output of fdisk -l on that computer (/dev/sda is a 4GB SCSI disk that was originally the boot disk for Windows 2000 server on that computer):

Code:

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1        2432    19535008+  83  Linux
/dev/hda2            2433        4998    20611395    5  Extended
/dev/hda5            2433        4742    18555043+  83  Linux
/dev/hda6            4743        4998    2056288+  82  Linux swap / Solaris

Disk /dev/hdb: 10.0 GB, 10005037056 bytes
255 heads, 63 sectors/track, 1216 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hdb1  *          1          13      104391  83  Linux
/dev/hdb2              14        1216    9663097+  8e  Linux LVM

Disk /dev/sda: 4551 MB, 4551129088 bytes
138 heads, 63 sectors/track, 1022 cylinders
Units = cylinders of 8694 * 512 = 4451328 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        1022    4442602+  83  Linux

Here's the currentGRUB file. I added the section about Slackware. I've also tried pointing it at:

Code:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd1,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=20
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-238.5.1.el5)
        root (hd1,0)
        kernel /vmlinuz-2.6.18-238.5.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-238.5.1.el5.img
title CentOS (2.6.18-194.32.1.el5)
        root (hd1,0)
        kernel /vmlinuz-2.6.18-194.32.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-194.32.1.el5.img
        kernel /vmlinuz-2.6.18-194.32.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-194.32.1.el5.img
title CentOS (2.6.18-194.el5)
        root (hd1,0)
        kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-194.el5.img

title Slackware
        rootnoverify (hd0,0)
        chainloader +1

I've also tried:

Code:

title Slackware
        rootnoverify (hd0,0)
        chainloader +1
        boot

Code:

title Slackware
        root (hd0,0)
        kernel /boot/vmlinuz-huge-smp-2.6.29.6-smp root=/dev/hda1

. . . and several other permutations.

Slackware's LILO:

It's been six months or more since I used this computer. It's my experiment-er "play" computer and I had taken the HDD out to test a computer for one of the members of my LUG, so I can't remember exactly how I configured the LILO install, but, if I did what I usually do, I installed it to the MBR of /dev/hda. I have considered just blowing away LILO, but I'd be happier if I could just use GRUB to call LILO.

bonixavier 04-11-2011 10:28 PM

I'm totally lost around grub. Couldn't you boot a Slack cd and rerun lilo adding CentOS to it?

Richard Cranium 04-11-2011 10:35 PM

So, what error message do you get when you try to use your slackware entry?

Just guessing, I think you'd need to use something like...
Code:

title Slackware
        root (hd0,0)
        kernel /boot/vmlinuz-generic-smp-2.6.29.6-smp ro
        initrd /boot/initrd.gz

The beauty of grub is that you can enter the grub command line and test the root command to see if it is pointing to the correct partition as well as seeing if you have the kernel and initrd lines correct.

hakan56 04-12-2011 01:06 AM

Code:

title Slackware
        root (hd0,0)
        kernel /boot/vmlinuz-huge-smp-2.6.29.6-smp root=/dev/hda1

That looks alright, add "ro" to the "kernel-line", but I think it should boot anyway.

You have installed slackware on hda1 without a separate boot-partition...but you have 3 disks and perhaps the "disk-numbers" has changed...try locking for your kernel with the "grub-commands" you see here..
http://www.linuxquestions.org/questi...8/#post4319224
..if you don't know that your initrd.gz is working, try locking for the "huge-kernel"

/Håkan
I think you can only "chainloader +1" if the other "boot-loader" is installed in the rot-partition (/)

frankbell 04-12-2011 06:50 PM

Thank you all for your suggestions.

bonixavier:

I really don't want to be messing with the CentOS install right now or I'd try that; I need CentOS for something I'm studying.

Right now the box is booting directly into GRUB and bypassing LILO completely. (I wonder whether GRUB just blew away LILO; I'll check whether dd can tell me something about that.)

I'm pretty clueless about either GRUB or LILO, since I don't normally have to dual-boot.

I install the distro and the bootloader, reboot, and the distro works. So this is an opportunity for me to learn. The way I learn is by breaking things.

Richard Cranium and hakan56:

I've gotten error messages 13, 15, and an endless hang.

I'll try your suggestions tomorrow and report back.

I did not try adding an initrd entry in the GRUB menu because, when I mount the Slackware drive, there's no initrd in /boot, but, what the hey! the worst that can happen is that it won't work.

Right now I'm watching the Philadelphia Phillies play baseball. I don't get much opportunity to see them on television in this part of the world so I'm not passing this up (grin).

colorpurple21859 04-12-2011 07:00 PM

If lilo is installed to the MBR try
Quote:

root (hd0)
chainloader +1
Quote:

root (hd0,0)
points to the first partition on the disk and not the MBR

Erik_FL 04-12-2011 07:38 PM

OPTION 1:

GRUB 0.97 requires a patch to support 256-byte inodes. Partitions formatted for EXT2, EXT3 or EXT4 by newer versions of Slackware default to 256-byte inodes. The GRUB installed by CentOS won't be able to load Slackware's kernel file if GRUB hasn't been patched. You can either put the Slackware kernel file into a partition formatted with 128-byte inodes or update GRUB using the patched version in Slackware.

OPTION 2:

The usual installation of LILO installs it to the MBR, so installing GRUB most likely left you with no boot sector for LILO. Chaining to LILO will work, but you have to make sure to install LILO to the Slackware Linux partition's boot sector instead of the Master Boot Record. Then have GRUB chain to the Slackware Linux partition's boot sector.

OPTION 3:

If you prefer LILO to start first, install LILO to the MBR and install GRUB to the CentOS Linux partition's boot sector.

OPTION 4:

You can format the Slackware partition using 128-byte inodes. That will allow you to boot using any version of GRUB. It will also allow "Ext2fs" for Windows to read files from the partition.

For example:

mke2fs -j -I 128 /dev/sda2

The uppercase "I" option specifies the inode size.

frankbell 04-14-2011 07:51 PM

Quote:

Originally Posted by Erik_FL (Post 4322774)
OPTION 1:

GRUB 0.97 requires a patch to support 256-byte inodes.

I did some more experimenting (calling it testing would be over-dignifying it) today and I think Erik_FL has nailed it.

When my Slackware subscription CDs arrive, I'll take another look at this.

Thank you everyone for taking the time to offer your ideas.

frankbell 10-26-2011 07:54 AM

I know this is old, but I have solved the problem, though with Fedora, not CentOS because the CentOS box is terminally ill.

I had a working Fedora 15 on /sda3 and /sda4 on a laptop. (Partitions /sda1 and /sda2 were the old C:\ and boot drives from a Win XP load.)

I blew away the first two partitions created a 15 GB partition formatted ext2 and formatted the remainder ext4 for /home. After installing Slackware to the ext2 partition, I did not install LILO, but instead entered the following in the grub menu.lst (Note: Fedora still uses Grub 0.97):

PHP Code:

title Slackware Linux
        root 
(hd0,0)
        
kernel /boot/vmlinuz ro root=/dev/sda1 quiet 

It works just fine without an initrd line. Don't ask me why.

Now I have to get the Broadcom wireless working with Slackware (it works just fine with Fedora--I'm typing this on that computer right now).

dive 10-26-2011 11:04 AM

Quote:

Originally Posted by frankbell (Post 4508824)
It works just fine without an initrd line. Don't ask me why.

Probably because /boot/vmlinuz is a symlink to the huge kernel


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