[Bug 979971] Re: grub install to partition fails with 12.04 alternate & LUKS multiboot setup
Chris Evans
chrishold at psyctc.org
Thu May 10 20:51:14 UTC 2012
We obviously use English differently. Your response is unclear to me. What would "no problem without truecrypt be"? What is unclear about the statement:
"That means that I can't let Ubuntu write the grub2 menu to the MBR of /dev/sda as it would destroy the Truecrypt bootloader there."
So, to try to unmeander you. Yes, of course one can install Ubuntu to
the MBR, I don't think Ubuntu would be a much used OS if that weren't
the case.
Yes indeed, because Truecrypt insists on monopolising the MBR (yes, I
know, not your doing etc.) that means that if you want Truecrypt
encrypted windoze and ubuntu to coexist, ubuntu has to install the grub
bootloader to another partition and yes, my account is clear (see my
very clear point #2) that grub/ubuntu/debian-installer seems to have
real difficulties with that. I think that's been confirmed as a grub
bug elsewhere [Bug 997407] as the previous reply notes.
The rest of this bug report is about what happens when I attempt to get
beyond that. I found that I can can override that failure (or apparent
failure) to install grub to the partition by using the ubuntu rescue
disc and appear to be able, with some external assistance and despite an
error message saying you can't, to install a grub boot to a partition
(my #3 to #9 above). However, one utterly clear bug to my mind is that
this reveals that the "quiet splash vt.handoff=7" default in grub
prevents you seeing the LUKS prompt for the passphrase so locks you up
if you have LUKS encrypted your partitions. I don't know why that's not
the case when you install grub to the MBR, someone who understands grub
and the debian-installer can probably see why that is the case.
... But, as you rightly say, even when I remove that and get through to
the LUKS prompt for the passphrase I clearly get LUKS decryption but I
don't get to gnome and I'm baffled by that and don't understand enough
about gnome normally gets launched to go further. I also, as you say,
unflatteringly, seem to have had to meander so far up a set of
workarounds that I decide simply to put it in as a bug, which I'm sure
it is, probably actually a set of bugs.
So hear I am stuck with a lovely machine, with an OS I love and can
encrypt (Linux & LUKS: my first love was Debian but after 15 or so years
together I'm moving to Ubuntu because I thought it would have better
support for newer hardware and exactly this sort of problem) AND I can
in principle have encryption of my unloved OS (windoze) that I need to
retain for some things ... but I can't have the two cohabiting on the
hard disc of my lovely new machine and working for me!
Is that any clearer?
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to debian-installer in Ubuntu.
https://bugs.launchpad.net/bugs/979971
Title:
grub install to partition fails with 12.04 alternate & LUKS multiboot
setup
Status in “debian-installer” package in Ubuntu:
Incomplete
Bug description:
[A lot about this is at
https://answers.launchpad.net/ubuntu/+source/grub2/+question/193122
but I'm now fairly convinced that it's a bug, not something I'm doing
wrong.]
I'm installing 12.04 alternate onto a Toshiba Satellite L750-170. I
want to set things up with a multiboot configuration with a Truecrypt
encrypted Windows 7 installation and a LUKS/LVM installation of
Unbuntu that is also encrypted. That means that I can't let Ubuntu
write the grub2 menu to the MBR of /dev/sda as it would destroy the
Truecrypt bootloader there. It's clear from various pages on the
internet that earlier versions of Ubuntu (and other Linuces I think)
have been fine for this. You installed the grub menu to a separate
/boot partition (that may no longer be necessary as I think grub2 is
LUKS/LVM aware but I haven't risked that), you let Truecrypt load but
don't enter the passphrase to boot to encrypted windoze, just hit Esc
and the Truecrypt bootloader hands off the booting and my
understanding is that it should then find the grub entry on /dev/sda5
(say) and boot fine. At least, it's clear that that worked for
several people with earlier versions of Ubuntu.
What happens now is this:
1) I know that U12.04 installs fine before I Truecrypt encrypted the windoze system partition: grub2 installed the menu to the MBR and windoze and Unbuntu booted fine so I know that Ubuntu is fairly happy on the Toshiba
2) HOWEVER, if I ask the U12.04 installation to ask to a 2Gb small partition on either /dev/sda3 or /dev/sda5 (I've tried both) it simply refuses (*** I think this is bug #1 here as I _think_ it may actually have succeeded in doing the installation but is locking on the warnings, alternatively, it may have failed to use the --force option to override the warnings, either is a bug to my mind ***)
3) IF I use the rescue disc approach and try to force grub to install to /dev/sda5 from a root console I get the warning messages but the grub that gets installed doesn't work (more below)
4) when I say it doesn't work, what I mean is that the Truecrypt hand over just locks the machine saying:
"Error: No bootable partition found". I appreciate that this may be a bug in Truecrypt but there are still bugs in the Ubuntu/grub combination because ...
5) One way that I heard I could rescue things was to use Boot Repair it simply won't show me options to move grub.cfg etc. to any partition but only to rewrite the MBR (which will kill the Truecrypt encrypted windoze)
6) I also found about Super Grub2 Disk (www.supergrubdisk.org) ... this helped me identify a few more things that make me think there are bugs in U12.04/grub since ...
7) it finds the grub.cfg on /dev/sda5 fine showing me three menu lines: linux, linux rescue and windows 7
8) linux rescue boots me into single user root OK after prompting correctly for the LUKS passphrase
9) plain linux just locks with a black screen ... but
10) if I remove "quiet splash vt.handoff=7" from
linux /vmlinuz-3.2.0-20-generic-pae root=/dev/mapper/sda5_crypt-root ro quiet splash vt.handoff=7
I get a nice boot, I get prompted for the passphrase (*** so one definite bug, my bug #2 here, is that "quiet splash vt.handoff=7" is incompatible with LUKS encryption)
11) BUT I end up with a multiuser mode line/curses login prompt and seem to get in fine as chris, the ordinary user I defined when doing the U12.04 installation, but no Gnome (*** is this bug #3? ***)
Here's what cfdisk shows from a rescue root terminal:
Disk drive: /dev/sda
If I go into that cfdisk shows
Disk drive: /dev/sda
Size: 750156374016 bytes, 750.1 GB
Heads: 255 Sectors per track: 63 Cylinders: 91201
Primary Free Space 1.05*
sda1 Primary ntfs [SYSTEM] 418.39*
sda2 Boot Primary HPFS/NTFS/exFAT 191572.74*
Pri/Log Free Space 1.05*
sda5 NC Logical ext2 1998.59*
sda6 NC Logical crypto_LUKS 556163.67*
Pri/Log Free Space 0.91*
(sorry for formatting there).
Here's the whole of grub.cfg from /boot on /dev/sda5
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 3.2.0-20-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root b373189d-0999-47a6-a925-0fe6d2511e49
linux /vmlinuz-3.2.0-20-generic-pae root=/dev/mapper/sda5_crypt-root ro quiet splash vt.handoff=7
initrd /initrd.img-3.2.0-20-generic-pae
}
menuentry 'Ubuntu, with Linux 3.2.0-20-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root b373189d-0999-47a6-a925-0fe6d2511e49
echo 'Loading Linux 3.2.0-20-generic-pae ...'
linux /vmlinuz-3.2.0-20-generic-pae root=/dev/mapper/sda5_crypt-root ro single nomodeset
echo 'Loading initial ramdisk ...'
initrd /initrd.img-3.2.0-20-generic-pae
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 04FC772AFC771560
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
I'm happy to supply any other information and try anything. I'd
really like to get this working and suspect that this multiboot
combination is one quite a lot of people will want.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/979971/+subscriptions
More information about the foundations-bugs
mailing list