livecd: initrd: scripts/casper-helpers: fstype returns ext3 on luks container

Bug #910924 reported by debugger
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Trying to boot ubuntu 11.10 from livecd iso image via grub.

menuentry "Ubuntu" {
  iso_path=/ubuntu-11.10-desktop-i386.iso
  export iso_path
  search --set --file $iso_path
  loopback loop $iso_path
  root=(loop)
  configfile /boot/grub/loopback.cfg
}

However, booting fails w/ an initramfs prompt stating that /dev/sda2 could not be mounted.

/dev/sda2 is a luks container.

/dev/sda7 contains ubuntu-11.10-desktop-i386.iso

Cause: in initrd.lz: file casper-helpers calls /bin/fstype. fstype returns FSTYPE=ext3 for /dev/sda2 (which is a luks container).
find_path() in lupin-helpers then fails to mount /dev/sda2 using fstype ext3 dropping to an initramfs prompt.

fstype version:
ba50b66bff0437ff23e6e729de8f5d69 /bin/fstype

Solution: Unpack casper/initrd.lz, disable call to fstype and repack initrd.lz. Boot the iso file using the patched initrd.lz.

Patch:

--- casper-helpers 2012-01-02 18:28:21.000000000 +0100
+++ scripts/casper-helpers 2012-01-02 01:06:41.000000000 +0100
@@ -41,11 +41,11 @@
 get_fstype() {
     local FSTYPE
     local FSSIZE
- eval $(fstype < $1)
- if [ "$FSTYPE" != "unknown" ]; then
- echo $FSTYPE
- return 0
- fi
+ #eval $(fstype < $1)
+ #if [ "$FSTYPE" != "unknown" ]; then
+ # echo $FSTYPE
+ # return 0
+ #fi
     /sbin/blkid -s TYPE -o value $1 2>/dev/null
 }

New grub config:

menuentry "Ubuntu" {
  iso_path=/ubuntu-11.10-desktop-i386.iso
  export iso_path
  search --set --file $iso_path
  loopback loop $iso_path
  root=(loop)
  linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=${iso_path} quiet splash -- lang=de
  initrd (hd0,7)/ubuntu-11.10-desktop-i386-initrd.lz
}

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/910924/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
debugger (b2038753) wrote :

Not sure whether this is the right package. Affected file is scripts/casper-helpers .

affects: ubuntu → casper (Ubuntu)
Revision history for this message
debugger (b2038753) wrote :

Bug #520500 seems to reveal the same symptoms as this one. This one specifying the cause and a fix/patch.

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

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

Changed in casper (Ubuntu):
status: New → Confirmed
Revision history for this message
debugger (b2038753) wrote :

Bug #454456 is in a way related as it seems to have a similar solution (but different cause).

Revision history for this message
debugger (b2038753) wrote :

Initrd extraction/rebuild methods (at the end of https://help.ubuntu.com/community/LiveCDCustomization#Removing_the_.28Casper.29_Autologin):

- Extraction:
<citation>
# cd extract-cd/casper
# mkdir lztempdir
# cd lztempdir
# lzma -dc -S .lz ../initrd.lz | cpio -imvd --no-absolute-filenames
</citation>

- Rebuild:
<citation>
And to re-create the initrd.lz file:

# cp ../initrd.lz ../inird.lz.orig
# find . | cpio --quiet --dereference -o -H newc | lzma -7 > ../initrd.lz
</citation>

Use the following compression cmd for gzipped initrd:
# find . | cpio --quiet --dereference -o -H newc | gzip -9 > ../initrd.gz

NOTE: Linux Mint 11 Lxde 32bit is a gzip compressed initrd featuring a misleading suffix ".lz". It's a plain ".gz", though.

Revision history for this message
debugger (b2038753) wrote :

apt-cache show lupin-casper hints that this is the one.

affects: casper (Ubuntu) → lupin (Ubuntu)
Changed in lupin (Ubuntu):
status: Confirmed → New
Revision history for this message
debugger (b2038753) wrote :

Also affects Linux Mint 11 lxde 32bit.

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

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

Changed in lupin (Ubuntu):
status: New → Confirmed
Revision history for this message
debugger (b2038753) wrote :

--- casper-helpers 2012-01-02 18:28:21.000000000 +0100
+++ scripts/casper-helpers 2012-01-02 01:06:41.000000000 +0100
@@ -41,11 +41,11 @@
 get_fstype() {
     local FSTYPE
     local FSSIZE
- eval $(fstype < $1)
- if [ "$FSTYPE" != "unknown" ]; then
- echo $FSTYPE
- return 0
- fi
+ #eval $(fstype < $1)
+ #if [ "$FSTYPE" != "unknown" ]; then
+ # echo $FSTYPE
+ # return 0
+ #fi
     /sbin/blkid -s TYPE -o value $1 2>/dev/null
 }

Revision history for this message
debugger (b2038753) wrote :
Revision history for this message
debugger (b2038753) wrote :

karmic has a changelog entry suggesting that blkid is used in get_fstype() to get the fs type: https://launchpad.net/ubuntu/+source/casper/1.174https://launchpad.net/ubuntu/+source/casper/1.174

But oneiric (still/again?) features a call to fstype and if that returns a "known" fs type blkid is never called.
The above patch corrects this, it is skipping fstype and immediately calls blkid.

Revision history for this message
debugger (b2038753) wrote :

Why is it impossible to edit my own comments?

Comment #10 should get joined w/ comment #11.

Comment #12 has the url doubled. Needs cleanup.

Revision history for this message
debugger (b2038753) wrote :

According to https://launchpad.net/ubuntu/+archive/primary/+files/casper_1.296.tar.gz it is really "casper" rather than "lupin".

affects: lupin (Ubuntu) → casper (Ubuntu)
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "casper-helpers: use blkid instead of fstype (see bug description)" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in casper (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Stéphane Graber (stgraber) wrote :

This appears to have been fixed in fstype.

stgraber@castiana:~/Desktop/casper/casper/test$ sudo bin/fstype /dev/sda3
FSTYPE=luks
FSSIZE=0

Changed in casper (Ubuntu):
status: Confirmed → Fix Released
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.