LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware13.1/ubuntu10.10 dual-boot grub2 question (https://www.linuxquestions.org/questions/slackware-14/slackware13-1-ubuntu10-10-dual-boot-grub2-question-863421/)

ewsmith 02-17-2011 07:38 PM

Slackware13.1/ubuntu10.10 dual-boot grub2 question
 
I have read that installing ubuntu 10.10 will inevitably install grub2 with it(unless you use flash drive workaround). i am wondering how slackware 13.1 reacts to grub2.
Does it go on like nothings changed (if configured correctly)?
Or does it freak out and have a fit?

If slackware doesn't play nice with grub2. i don't think i will use ubuntu 10.10.

tacticalbread 02-17-2011 08:10 PM

I had Ubuntu 10.10 installed with GRUB2, then I installed Slackware, added Slackware to GRUB2's menu, and had no problems.

unrelated question: If you already run Slackware, why install Ubuntu? o:

ewsmith 02-17-2011 08:18 PM

Quote:

Originally Posted by tacticalbread
I had Ubuntu 10.10 installed with GRUB2, then I installed Slackware, added Slackware to GRUB2's menu, and had no problems.

Ok. Thanks for the info. :D
Does grub2 have the same syntax as grub1?

Quote:

Originally Posted by tacticalbread
unrelated question: If you already run Slackware, why install Ubuntu? o:

The very first linux i experienced was ubuntu. i still prefer ubuntu over slackware. however, slackware is my work os and learn how to use linux os.

EDIT:
Is there some way to permenately disable emoticons in my posts?
Rather than the manual way for each post?

Richard Cranium 02-17-2011 08:20 PM

Quote:

Originally Posted by ewsmith (Post 4262237)
Does grub2 have the same syntax as grub1?

Nope.

ewsmith 02-17-2011 08:22 PM

Quote:

Originally Posted by Richard Cranium (Post 4262238)
Nope.

Time to consult the oracle.

tacticalbread 02-17-2011 08:22 PM

Quote:

Originally Posted by ewsmith (Post 4262237)
Ok. Thanks for the info. :D
Does grub2 have the same syntax as grub1?

nope, Grub2 is actually quite a bit different.

https://help.ubuntu.com/community/Grub2

tommcd 02-17-2011 10:19 PM

Quote:

Originally Posted by ewsmith (Post 4262205)
i am wondering how slackware 13.1 reacts to grub2.
Does it go on like nothings changed (if configured correctly)?
Or does it freak out and have a fit?

I have been booting Slackware from Ubuntu's grub2 ever since Ubuntu switched to grub2. Here is my experience:
I install Ubuntu first and let grub2 control the MBR.
When I install Slackware I choose to not install lilo.
Then I boot into Ubuntu and run: "sudo update-grub".
This will create 4 entries in the grub2 menu for booting Slackware. One each for the huge, huge-smp, generic, and generic-smp kernels.
Then when you create an initrd to boot the Slackware generic-smp kernel, running "sudo update-grub" from Ubuntu will for some reason not add the initrd line that you need to boot Slackware's generic-smp kernel.
The solution is to create a custom boot entry for booting Slackware's generic-smp kernel. The details on how to do that are in the link that tacticalbread posted:
https://help.ubuntu.com/community/Gr...Menu%20Entries
For reference, here is my custom boot entry for booting Slackware 13.1 32 bit that I have installed on /dev/sda5:
Code:

echo "Adding Slackware32-13.1 on /dev/sda5" >&2
cat << EOF
menuentry "Slackware32-13.1 on /dev/sda5" {
        set root=(hd0,5)
        linux  /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5 ro
        initrd  /boot/initrd.gz
}
EOF

Note: You don't need the line that starts with echo, or the EOF stuff. That is just there to provide visual feedback when running "sudo update-grub". All that you really need is:
Code:

menuentry "Slackware32-13.1 on /dev/sda5" {
        set root=(hd0,5)
        linux  /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5 ro
        initrd  /boot/initrd.gz
}

Note2: You may need to start your custom boot entry with these 2 lines as in the tutorial I linked to:
Code:

#!/bin/sh
exec tail -n +3 $0

I have never needed those lines at the beginning of my custom boot entries for some reason. However, some people in the Ubuntu forums were not able to boot other linux distros with grub2 without starting their custom boot entries with those lines.
Write back if you need more help. And read that tutorial on grub2. It has all you need to know.

bonixavier 02-17-2011 10:50 PM

Grub2 will boot Slackware just fine. If you're into letting LILO boot Ubuntu, you might run into some problems because Ubuntu's boot process is not clear. I tried to do that and had no success. I have a thread in their forums asking for more information and no one was able to suggest me anything.

piratesmack 02-17-2011 11:27 PM

Yesterday I installed Slackware on GPT partitions (just for fun), and since Grub Legacy doesn't support GPT, I'm using Grub2.

All is working well.

If you're using one of the generic kernels, make sure your initrd is named like "initrd.img-`uname -r`" instead of the usual "initrd.gz". Otherwise, grub2 won't automatically detect it.

ewsmith 02-18-2011 07:42 PM

I got grub2 booting both ubuntu and slackware. i had to wipe my disk to do it, though. the placement sort of screwed saving anything.
but it gave me an excuse to nuke my windows partition, so i'm happy.

I have one problem now. i used some script to make an initrd, but i forgot what it was... :[

EDIT:
i have slackware and ubuntu sharing /home on a separate partition.
thanks to whoever gave me the idea (i forgot who :/).

bgeddy 02-18-2011 08:05 PM

Quote:

I have one problem now. i used some script to make an initrd, but i forgot what it was... :[
In Slackware jut run :
Code:

su -c "$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -r)"
and it will make you an initrd at /boot/initrd.gz to suit your running kernel and filesystem options.

ewsmith 02-18-2011 08:18 PM

Quote:

Originally Posted by bgeddy (Post 4263398)
In Slackware jut run :
Code:

su -c "$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -r)"
and it will make you an initrd at /boot/initrd.gz to suit your running kernel and filesystem options.

That's it! thanks!

tommcd 02-18-2011 09:23 PM

Quote:

Originally Posted by piratesmack (Post 4262359)
If you're using one of the generic kernels, make sure your initrd is named like "initrd.img-`uname -r`" instead of the usual "initrd.gz". Otherwise, grub2 won't automatically detect it.

Thanks a lot for this. So this is why Ubuntu's grub2 never finds the initrd for Slackware's generic-smp kernel.

I just checked my Xubuntu install and, indeed, the Xubuntu 10.10 initrd is named
initrd.img-2.6.35-25-generic instead of just initrd.gz.

ewsmith 02-19-2011 08:27 AM

Quote:

Originally Posted by piratesmack
If you're using one of the generic kernels, make sure your initrd is named like "initrd.img-`uname -r`" instead of the usual "initrd.gz". Otherwise, grub2 won't automatically detect it.

I forgot to mention, i have no problem with the default name for the kernel.
I prefer to edit text files for customizing. so i made a 10_ubuntu and an 11_slackware in /etc/grub.d/ and turned of the executable bit on 10_linux and 30_osprober.


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