You are not logged in.

#1 2010-03-23 02:12:38

yoko
Member
From: Southeastern United States
Registered: 2010-01-25
Posts: 6

Adding dmcrypt Arch to Ubuntu grub2

Hi,

I've installed Arch on a second disk and would like to add it the boot menu on the first disk.  I don't have the time to install and configure it in one block so I'd like to keep my Ubuntu installation intact while I work on Arch until I can replace Ubuntu entirely.  I haven't had any success adding Arch to Ubuntu's boot menu, though.  Both installations are dmcrypt.

I have 2 hard disks.  They're laid out like so:

/dev/sda1  Ubuntu /boot
/dev/sda2  Ubuntu dmcrypt /
/dev/sdb1  Arch /boot
/dev/sdb2  Arch dmcrypt /

Ubuntu uses Grub2 and my Arch installation uses Grub.  I've tried several configurations of Ubuntu's Grub2 in attempts to load my Arch instance.  For example, in /etc/grub.d/40_custom I added this

menuentry "Arch Linux" {
set root=(hd1,1)
chainloader +1
boot
}

and then this

menuentry "Arch Linux" {
set root=(hd1,1)
linux /vmlinuz26 root=/dev/disk/by-uuid/af93aaa3-1e81-4a89-9a14-e9557e977543 ro
initrd /kernel26.img
}

Running update-grub doesn't add anything to Ubuntu's boot menu.  The os probe also never finds the Arch boot partition. 

Any advice?  Thanks!

Offline

#2 2010-03-23 04:04:19

droog
Member
Registered: 2004-11-18
Posts: 877

Re: Adding dmcrypt Arch to Ubuntu grub2

What happens when you try to boot the arch entry?

Did you add the encrypt hook to your mkinitcpio.conf?

I don't use grub2 but those entries look right to me after looking at the grub2 wiki.

Offline

#3 2010-03-23 13:04:41

yoko
Member
From: Southeastern United States
Registered: 2010-01-25
Posts: 6

Re: Adding dmcrypt Arch to Ubuntu grub2

Thanks for your response.  When I run update-grub nothing gets added to the Ubuntu boot menu so I've never been able to boot into the Arch installation.  I suppose I should manually edit /etc/grub.d/grub.cfg since adding entries to the /etc/grub.d/40_custom seems to have no effect.  I didn't add encrypt as a hook in mkinitcpio.conf, though it was already done for me by the installer.  I'll try manually adding the Arch entry.  Thanks again.

Offline

#4 2010-03-23 16:09:35

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: Adding dmcrypt Arch to Ubuntu grub2

1) If you hit "Escape" at the grub menu, you can use "tab completion" to see what disks, directories and files grub legacy/grub 2 can find, e.g.

type:

set root (hd

then hit tab.

2) What is the grub legacy line from the Arch /boot/menu.cfg?

3) I don't know if my grub2 entry will help. My sda3 is luks-encrypted. On top of the luks encryption I have LVM2 partitions

menuentry " arch " {
linux /vmlinuz26 root=/dev/mapper/vg-arch cryptdevice=/dev/sda3:vg ro quiet
initrd /kernel26.img
}

Offline

#5 2010-03-24 13:14:06

yoko
Member
From: Southeastern United States
Registered: 2010-01-25
Posts: 6

Re: Adding dmcrypt Arch to Ubuntu grub2

vacant wrote:

1) If you hit "Escape" at the grub menu, you can use "tab completion" to see what disks, directories and files grub legacy/grub 2 can find, e.g.

type:

set root (hd

then hit tab.

2) What is the grub legacy line from the Arch /boot/menu.cfg?

3) I don't know if my grub2 entry will help. My sda3 is luks-encrypted. On top of the luks encryption I have LVM2 partitions

menuentry " arch " {
linux /vmlinuz26 root=/dev/mapper/vg-arch cryptdevice=/dev/sda3:vg ro quiet
initrd /kernel26.img
}

Unfortunately, hitting "Escape" at the grub2 menu has no effect.  I did notice that my grub.cfg file contains an entry for Arch, but that entry is not displayed on the boot menu.

Offline

#6 2010-03-24 13:32:11

Ber
Member
From: Belgium
Registered: 2006-07-05
Posts: 80
Website

Re: Adding dmcrypt Arch to Ubuntu grub2

yoko wrote:

Thanks for your response.  When I run update-grub nothing gets added to the Ubuntu boot menu so I've never been able to boot into the Arch installation.  I suppose I should manually edit /etc/grub.d/grub.cfg since adding entries to the /etc/grub.d/40_custom seems to have no effect.  I didn't add encrypt as a hook in mkinitcpio.conf, though it was already done for me by the installer.  I'll try manually adding the Arch entry.  Thanks again.

This is really weird, because update-grub doesn't do any verification on the content of this file, it justs adds anything that's in it...

Do you still have the "exec tail..." line on top of 40_custom?

EDIT : sorry, didn't read your last post

Last edited by Ber (2010-03-24 13:33:08)


V=RI sweet V=RI

Offline

#7 2010-03-25 03:00:54

yoko
Member
From: Southeastern United States
Registered: 2010-01-25
Posts: 6

Re: Adding dmcrypt Arch to Ubuntu grub2

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Arch Linux" {
set root=(hd1,1)
linux /boot/vmlinuz26 root=/dev/disk/by-uuid/af93aaa3-1e81-4a89-9a14-e9557e977543 ro
initrd /kernel26.img
boot
}

Yes, the exec tail line is intact.

Offline

#8 2010-03-25 08:05:41

Ber
Member
From: Belgium
Registered: 2006-07-05
Posts: 80
Website

Re: Adding dmcrypt Arch to Ubuntu grub2

OK, if you use a separate /boot partition I don't think you need to prepend /boot to your kernel's path, i.e your vmlinuz26 file is actually on the root of your sdb1 partition, not in /boot on your sdb1 partition (like it is correctly written for the initcpio)


V=RI sweet V=RI

Offline

Board footer

Powered by FluxBB