Kubuntu 11.10 with encrypted root upgraded to 12.04 result in unbootable system due to Grub limitations

Bug #997414 reported by bastafidli
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

I have perfectly working Kubuntu 11.10 system. The machine is Dell Precision T5500 with the following disks
/dev/sda 164 GB
- dev/sda1 - primary - Windows XP
/dev/sdb 1TB
- /dev/sdb1 - primary - Windows 7 system partition
- /dev/sdb2 - primary - WIndows 7 OS
- /dev/sdb3 - primary - Kubuntu 11.10 /boot partition
- /dev/sdb4 - extended partition
- /dev/sdb5 - logical LUKS encryption partition mapped to / (root)
- /dev/sdb6 - logical LUKS encrypted partition swap

After online upgrade to 12.04 which went without any issues I rebooted the system. I was presented with GRUB menu which correctly listed
- Ubuntu 12.04 with latest 3.x server
- Previous Kernel versions
- Window 7
- Windows XP

Regardless with option I choose I receive 3 errors
- no such partition
If I drop to Grub console and I try to do ls I receive error
- no such partition

When I reboot to Ubuntu or Kubuntu alternative CD and try to do rescue
It correctly detects all my partitions, asks for passwords for /dev/sdb5 and /dev/sdb6 and unlocks them
If I try to to grub reinstall I receive error it cannot reinstall it
If I try to chroot to /dev/mapper/sdb5_crypt I get a working shell
If I try to do grub-install I get error that is cannot find mapping for /dev/mapper/sdb5_crypt to GRUB DISK
If I try to do grub-probe as suggested by grub-update I get error that it cannot find mapping for /dev/mapper/sdb5_crypt and to check my device.map file
If I try to run grub-devicemap it maps only /dev/sda and /dev/sdb but not /dev/mapper/sdb5_crypt
If I try to modify device.map file manually it doesn't work
If I try to do update-grub I get reference that GRUB doesn't understand LUKS encrypted volumes and look at bug http://bugs.debian.org/491977. It also creates new grub.cfg file which has only entry for Windows XP and WIndows 7 but not to the current Linux installation I am actively using

At the end I am unable to fix the system since grub doesn't allow me to update the boot sector to bootable system. I had to reinstall.

I have also logged it as
https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/997407
since it happened during upgrade but logging it also specifically against GRUB since it seems to be limitation of GRUB in 12.04 resulting in unbootable system

Revision history for this message
Phillip Susi (psusi) wrote :

You need to have your /boot partition mounted to reinstall grub. Please run sudo dpkg-reconfigure grub-pc and make sure it is set to install to /dev/sda and see if this fixes it.

Changed in grub2 (Ubuntu):
status: New → Incomplete
Revision history for this message
bastafidli (ubuntu-bastafidli) wrote :

Sorry, I have already reinstalled the system. The clean install went just fine. It seems that this is problem only with the update then. I will make this a duplicate of the defect logged against update-manager since upgrade resulted in misconfigured grub. I hope your comment help somebody in the same situation. Thank you.

Revision history for this message
Bart Cerneels (stecchino) wrote :

Just experienced the same problem after a 11.10 -> 12.04 update. The 11.10 install was also kubuntu, but don't think it matters.

Disk partitioned as:
(parted) p
Model: ATA HITACHI HTS72323 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
 1 1049kB 256MB 255MB primary ext2
 2 257MB 320GB 320GB extended
 5 257MB 320GB 320GB logical

with 5 being a LUKS encrypted LVM setup:
root@ubuntu:/# lvdisplay
  --- Logical volume ---
  LV Name /dev/cox/root
  VG Name cox
  LV UUID VRCA0x-HQKI-poSW-2i3E-ECBa-HpR7-xiSREw
  LV Write Access read/write
  LV Status available
  # open 0
  LV Size 292.49 GiB
  Current LE 74878
  Segments 1
  Allocation inherit
  Read ahead sectors auto
  - currently set to 256
  Block device 252:1

  --- Logical volume ---
  LV Name /dev/cox/swap_1
  VG Name cox
  LV UUID tRQYQV-Vz8s-gZAF-3M4V-fHtF-aeml-fZhMcj
  LV Write Access read/write
  LV Status NOT available
  LV Size 5.34 GiB
  Current LE 1368
  Segments 1
  Allocation inherit
  Read ahead sectors auto

I'll try the fix from #1

Revision history for this message
Bart Cerneels (stecchino) wrote :

Ran dpkg-reconfigure grub-pc and noticed that only /dev/sda1 was selected. Made sure /dev/sda was selected and removed /dev/sda1(/boot) since it's a partition. I think the bug is here, /dev/sda should have been automatically selected to avoid mistakes. In fact, the user should not even be presented with any of these options while upgrading.

root@ubuntu:/# dpkg-reconfigure grub-pc
Installation finished. No error reported.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-24-generic
Found initrd image: /boot/initrd.img-3.2.0-24-generic
Found linux image: /boot/vmlinuz-3.0.0-19-generic
Found initrd image: /boot/initrd.img-3.0.0-19-generic
Found memtest86+ image: /memtest86+.bin
  /var/lock/lvm: mkdir failed: No such file or directory
  File-based locking initialisation failed.
done

I'll reboot now in the hope that the /var/lock/lvm error is not a problem. But it's apearance certainly is a problem as well.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for grub2 (Ubuntu) because there has been no activity for 60 days.]

Changed in grub2 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.