booting iso from stick via grub2 loopback gets stuck on particular crypt-luks partition

Bug #520500 reported by Wolfgang Kufner
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
iso-scan (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: iso-scan

Booting lucid desktop iso 20100210 64 bit from usb-stick via grub2 loopback does not work. It says "mounting /dev/sda5 on /isodevice failed: Invalid argument" and I get dropped to the shell. /dev/sda5 is not where the iso is. It happens to be a crypt-luks partition.
Using Bug #454456 as recipe I was able to continue the boot process by using the following commands:
(initramfs) mount -t ext4 /dev/disk/by-label/verbatim /isodevice
(initramfs) echo "LIVEMEDIA=/isodevice/boot/isostick/ubuntu/lucid-desktop-amd64.iso /" >> /conf/param.conf
(initramfs) echo "LIVEMEDIA_OFFSET=0" >> /conf/param.conf
(initramfs) exit

Booting the iso via loopback from the hard disk works fine, as does booting via loopback from this usb-stick on a different computer with a far simpler partition layout (no crypt-luks partiton among other things).
I have then gone and made a luks partition on the computer with the simpler layout. Booting from the stick still worked.
I have then overwritten the offending luks partition on the first computer with an ext4 filesystem. Now booting from the stick works.

suspicion:
iso-scan/filename=/boot/isostick/ubuntu/lucid-desktop-amd64.iso does give the wrong partition to the boot process, getting stuck on that particular crypt-luks partition.

the first bit of casper.log after boot with manual help:
Begin: Running /scripts/casper-premount ...
Done.
Begin: ...waiting for devs... ...
Done.
stdin: error 0
mount: mounting /dev/sda5 on /isodevice failed: Invalid argument
Cannot mount /dev/sda5 on /isodevice
Done.
Done.
Begin: Creating debconf-communicate fifo mechanism ...
Done.
Begin: Running /scripts/casper-bottom ...
Begin: Moving mount points... ...
Done.
Begin: Adding live session user... ...

The layout:
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 36419292, Id=83, bootable
/dev/sda2 : start= 0, size= 0, Id= 0
/dev/sda3 : start= 36419355, size=276157350, Id= 5
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start=114543513, size= 60998742, Id=83
/dev/sda6 : start=175542318, size= 86879457, Id=83
/dev/sda7 : start= 36419481, size= 5012154, Id=82
/dev/sda8 : start=262421838, size= 20322162, Id=83
/dev/sda9 : start=282744063, size= 19534977, Id=83
/dev/sda10: start= 41431698, size= 45062262, Id=83

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

I also attach a copy of the mbr.

Both layout and mbr remained identical before (with luks partition) and after (with luks partition overwritten).

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

Now I am confused:
I wanted to make that offending partition sda5 a luks partition again with palimpsest to check whether it then would again hang. It refused saying I had to reboot because of the kernel not knowing the new partition table or something like that. I reboot and the partition that I knew as sda5 is gone! Instead there is now a bigger empty space made up of that partition and what was adjacent empty space. All of that now one big empty partition. sda5 is consequently now the name of another partition.
I am at a complete loss as to how to explain why the partition table changed. I had used gparted>Format_to to format to ext4, not change the size. Then a reboot with the stick. Then a normal reboot. Then made a copy of mbr and layout, which I compared with md5 and found unchanged from before. I can not see any reason for the partition layout to change now.

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

I just checked. The mbr has not changed. Just the layout as given by sudo sfdisk -d /dev/sda.

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

Please disregard comment #2 (and #3). My mistake.

Revision history for this message
conrad.newton@gmail.com (conrad-newton) wrote :

I found this bug report by googling. Here is my experience.

/dev/sda7 ext3
/dev/sda8 crypt-luks partition
/dev/sda9 ext3

grub.cfg in MBR pointed to an iso in /dev/sda9. On boot, I got the message

mounting /dev/sda8 on /isodevice failed.

This message disappeared, and boot succeeded once I moved the iso from /dev/sda9 to /dev/sda7 and changed the pointer in grub.cfg. It seems clear that the crypt-luks partition acts as a barrier of some kind. I speculate that it may be impossible to boot an iso in any partition with partition number higher than the crypt-luks partition. Note that I have also booted an iso from /dev/sda3 previously. Only /dev/sda9 was problematic.

In the meantime I have overwritten /dev/sda8, so no further testing is possible.

Revision history for this message
Luis Mondesi (lemsx1) wrote :

in my case /dev/sda is a bad disk with bad sectors that I fixed with spinrite. when the USB disk attempts to boot it goes to /dev/sda1 to attempt to find the iso but this produces nothing since the disk is bad. i can do: mount /dev/sdb1 /isodevice

how do i tell the ubuntu boot process in which device to look for the iso? this is an embeded device so i can't just open it and remove the disk.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in iso-scan (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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