Ubuntu fails to boot from ISO if there's a NTFS partition with Windows hibernated on it.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OEM Priority Project |
Fix Released
|
Medium
|
James M. Leddy | ||
Precise |
Fix Released
|
Medium
|
James M. Leddy | ||
lupin (Ubuntu) |
Fix Released
|
Undecided
|
Stéphane Graber | ||
Precise |
Fix Released
|
Medium
|
Brian Murray |
Bug Description
Package hint: initrd-tools
Greetings!
The Bug:
When booting Ubuntu from a frugal install, or when booting Ubuntu through Grub2 directly from the Ubuntu LiveCD ISO-file, the booting process fails if there's a partition with Windows hibernated on it.
Reportedly such boot also fails if there's an encrypted partition, logically before the partition which holds the Ubuntu files.
In short: If such a partition exists, which...
... is (1) logicly BEFORE the partition which holds filesystem.squashfs
...AND (2) that partition contains a supported file system, ...
...AND (3) that partition is for some reason not able to be mounted, ...
then the booting process panics and fails.
Distros affected:
I encountered the problem with: ubuntu-
The problem likely exists in all distros that use the same Casper startup scripts.
I confirmed the same problem with the downstream linuxmint-
The Problem:
When the OS takes over from the boot loader, it needs to find its "filesystem.
So what the init-scripts currently do, is they start a big search loop through all partitions on all devices, mounting them in a row, looking for the needed path in the file systems of those partitions.
So far so good. But the problem is that if the search encounters a partition that for some reason can't be mounted, instead of silently ignoring that partition and moving on, the init-thing keeps trying to mount that same partition over and over again, for a long time, until it finally throws a tantrum, raises panic, and sets my computer on fire.
On my computer Windows is usually hibernated on the first partition of the first disk. Unfortunately, that is the first partition Ubuntu will encounter in its attempted search through all the partitions. If I remove that hibernation file (which I don't like!), it allows Ubuntu to boot normally.
On closer look, it turns out the culprit is in the file called "lupin-helpers". No mater how I think about it, I find no good reason why it would raise panic from within the loop if a certain partition refuses to mount. What it really needs to do is to just silently ignore it, and move on looking through the rest of the loop.
Posible workaround...
Since Windows installations are most often on the first partition, my first impulse was to simply reverse the device order in which the search loops.
i.e., in "lupin-helpers", change this one line:
---- for dev in $(subdevices "${sysblock}"); do
++++ for dev in $(subdevices "${sysblock}" | tac -s' '); do
That would "fix" the problem for most setups. But that's not really fixing the bug, it's just making the bug less likely to ever manifest itself. A proper solution to the problem is the fix below.
The Fix:
In file "lupin-helpers", change this one line:
---- try_mount "$devname" "$mountpoint" "$mountoptions" || return 1
++++ mount -o $mountoptions $devname $mountpoint || true
I tested that by repackaging the initrd.lz, remastering the iso file, and booting directly from it.
It works flawlesly, as far as I can see.
Even Better:
It was nice when Ubuntu implemented the "iso-scan/
For example, the Grub2 grub.cfg script can do something like this:
# ... ...
set isopath=
probe -u $root -s booted_uuid
# ... ...
menuentry "Ubuntu 10.10" {
set isofile=
loopback loop ${isofile}
linux ${loop}
iso-
initrd (loop)/
}
When the OS takes over, it would find in its "/proc/cmdline" BOTH the device AND the path. So it won't be necessary to start that whole messy search loop through all the partitions on all the block devices. The OS can go straight to mounting that particular partition. The result is a cleaner and faster boot!
Of course, if for some reason that path is not found on that device, only then the init script could go through that same loop as before. But definitely without raising any panic from within the loop! And if, per chance, it goes through the whole loop without finding the needed path, only then it would be the proper time to panic.
Yours,
Purko Balkanski
Related branches
- Steve Langasek: Approve
- Ubuntu branches: Pending requested
-
Diff: 44 lines (+13/-2)3 files modifiedcasper/scripts/lupin-helpers (+1/-1)
debian/changelog (+11/-0)
debian/control (+1/-1)
- Dimitri John Ledkov: Pending requested
- Ubuntu branches: Pending requested
-
Diff: 30 lines (+11/-1)2 files modifiedcasper/scripts/lupin-helpers (+1/-1)
debian/changelog (+10/-0)
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in initrd-tools (Ubuntu): | |
status: | New → Confirmed |
description: | updated |
description: | updated |
description: | updated |
affects: | lupin → oem-priority |
Changed in oem-priority: | |
importance: | Undecided → Medium |
Changed in oem-priority: | |
status: | New → Confirmed |
Changed in lupin (Ubuntu): | |
assignee: | nobody → Brian Murray (brian-murray) |
status: | Confirmed → Triaged |
Changed in oem-priority: | |
status: | Confirmed → Triaged |
Changed in oem-priority: | |
assignee: | nobody → James M. Leddy (jm-leddy) |
Changed in lupin (Ubuntu): | |
status: | Triaged → Confirmed |
Changed in lupin (Ubuntu): | |
assignee: | Brian Murray (brian-murray) → Stéphane Graber (stgraber) |
Changed in lupin (Ubuntu): | |
status: | Confirmed → Triaged |
tags: |
added: verification-done removed: verification-needed |
Changed in oem-priority: | |
status: | Triaged → Fix Released |
There is another case could make mount failed. The mount command will failed if a CD/DVD device does not have any medium.