View previous topic :: View next topic |
Author |
Message |
ivdok n00b
Joined: 11 Oct 2013 Posts: 6
|
Posted: Fri Oct 11, 2013 7:49 pm Post subject: [SOLVED] Booting gentoo from... Non-gentoo GRUB2? |
|
|
Guys, I'm sorry once again, but I want to make somethink unorthodox with the bootin' process.
Here's the deal - I have already-installed GRUB2 on /dev/sda by Arch Linux - it's my main OS atm. I want to not to overwrite it - it's already installed.
I added these lines into /etc/grub.d/40_custom (on hd0,0):
Code: | #!/bin/sh
exec tail -n +3 $0
menuentry "GENTOO" {
title Gentoo Linux
root (hd0,1)
kernel /boot/gentoo-kernel root=/dev/sda2 ro
} |
It seems like it's okay, as for me, but in the end it shows only already existing partitions:
Code: | [root@localhost ~]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
done
|
Where did I make an error, and is there a way to not to install & replace existing GRUB2?
Last edited by ivdok on Sat Oct 12, 2013 4:54 pm; edited 1 time in total |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Sat Oct 12, 2013 5:19 am Post subject: |
|
|
assuming grub2 is on the first partition of BIOS's first hard drive to boot: (hd0,1)
assuming the kernel is at and named: /boot/gentoo-kernel in partition /dev/sda2
#!/bin/sh
exec tail -n +3 $0
menuentry "GENTOO" {
set root=(hd0,1)
linux /boot/gentoo-kernel root=/dev/sda2
boot
}
see https://help.ubuntu.com/community/Grub2/CustomMenus
and https://wiki.archlinux.org/index.php/GRUB _________________ Defund the FCC. |
|
Back to top |
|
|
creaker l33t
Joined: 14 Jul 2012 Posts: 651
|
Posted: Sat Oct 12, 2013 5:34 am Post subject: |
|
|
Why wouldn't to boot into Arch and just run grub-mkconfig without 40_custom editing?
It will add new menu entry for your Gentoo to grub menu. Of course, you have to have os-prober installed. |
|
Back to top |
|
|
ivdok n00b
Joined: 11 Oct 2013 Posts: 6
|
Posted: Sat Oct 12, 2013 4:53 pm Post subject: |
|
|
Thanks for reply, everybody!
This was solved by os-prober + genkernel via chroot from liveusb. It works, so I will mark it as Solved. |
|
Back to top |
|
|
|