BIOS hang - Unable to boot after installation

Bug #551965 reported by Mathieu Mitchell on 2010-03-30
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Release Notes for Ubuntu
Undecided
Colin Watson
partman-base (Ubuntu)
High
Colin Watson
Lucid
High
Colin Watson

Bug Description

I am preparing for deployment of Ubuntu 10.04 on servers. We deploy Ubuntu using the netboot image, on a PXE server.
Two particular systems have been troublesome for us. Note that we are using the latest netboot image (dated from this morning).

Steps to reproduce:
-Boot on netboot image
-Install Ubuntu. (we are using a preseed file, attached).
-After installation, the system reboots.
-The BIOS hangs after detecting hard disks, right after:
Ultra DMA Mode-5, S.M.A.R.T. Capable and Status OK

Now, there is nothing we can do. I would normally not file a bug against Ubuntu for this, but I have never seen this before. Installing Ubuntu Karmic or even Hardy works perfectly. Using a disk installed on such a motherboard in a newer one (different model) works 100%. Using Lucid installed in a newer board on this motherboard model does the same thing.

It looks like Ubuntu does something with the disk that 2 different motherboards dislike.

The affected motherboards are:
-Asus P5P800-MX (Intel 865GV chipset)
-Asus P5GZ-MX (Intel 945GZ chipset)

I have tried updating BIOS versions without success.
These 2 boards have very similar BIOS interfaces (AMIBIOS). I have tried modifying SMART detection settings without success.

The same installation works on these much newer motherboard:
Supermicro C2SBM-Q
Asus M4A785-M

We have tested this on multiple affected motherboards (all same model), with the same results all the time.

I think this is pretty important for the final release, as this would be a problem to many people with older hardware.

Mathieu Mitchell (mat128) wrote :
Mathieu Mitchell (mat128) wrote :
Mathieu Mitchell (mat128) wrote :

*update* Installing without preseed, using "guided defaults" and all default settings *works* fine.
Now, what in my preseed file make it fail on older boards and work on newer ones?

Mathieu Mitchell (mat128) wrote :

Switched to ext4 and added these lines before "grub-install/only_debian":
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/make_active boolean true

Still not working.

I can't find what's wrong with my preseed... The weirdest part is that the preseed works with newer boards ?!

Mathieu Mitchell (mat128) wrote :

Manual install with my custom partitions gave me the same thing...
primary /boot 200M
logical swap 2G
logical /tmp 2G
logical / rest

I think this has something to do with the BIOS and the MBR...

Mathieu Mitchell (mat128) wrote :

More updates...

Copying the first 446 bytes (GRUB 2 in the MBR) onto a fresh disk passes the BIOS.
Copying the first 512 bytes (GRUB 2 + partition table) onto a fresh disk makes it hang.

The problem is related to the partition table.
Here's the output for my partition recipe on Ubuntu 8.04 vs 10.04:

8.04:
root@ubuntu:~# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0003990a

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 24 192748+ 83 Linux
/dev/sda2 25 19457 156095572+ 5 Extended
/dev/sda5 25 273 2000061 82 Linux swap / Solaris
/dev/sda6 274 522 2000061 83 Linux
/dev/sda7 523 19457 152095356 83 Linux

10.04:
root@ubuntu:~# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007a9aa

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 194560 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 25 19458 156093441 5 Extended
/dev/sda5 25 274 1998848 82 Linux swap / Solaris
/dev/sda6 274 523 1998848 83 Linux
/dev/sda7 523 19458 152093696 83 Linux

And sfdisk:
8.04:
root@ubuntu:~# sfdisk -l

Disk /dev/sda: 19457 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 23 24- 192748+ 83 Linux
/dev/sda2 24 19456 19433 156095572+ 5 Extended
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 24+ 272 249- 2000061 82 Linux swap / Solaris
/dev/sda6 273+ 521 249- 2000061 83 Linux
/dev/sda7 522+ 19456 18935- 152095356 83 Linux

10.04:
root@ubuntu:~# sfdisk -l

Disk /dev/sda: 19457 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 24- 25- 194560 83 Linux
/dev/sda2 24+ 19457- 19433- 156093441 5 Extended
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 24+ 273- 249- 1998848 82 Linux swap / Solaris
/dev/sda6 273+ 522- 249- 1998848 83 Linux
/dev/sda7 522+ 19457- 18935- 152093696 83 Linux

Mathieu Mitchell (mat128) wrote :

Here's parted "list" command, using stock versions (so 1.7.1 for 8.04 and 2.2 for 10.04):

8.04:
(parted) print

Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
 1 32.3kB 197MB 197MB primary ext3 boot
 2 197MB 160GB 160GB extended
 5 197MB 2246MB 2048MB logical linux-swap
 6 2246MB 4294MB 2048MB logical ext3
 7 4294MB 160GB 156GB logical ext3

10.04:
(parted) print
Model: ATA WDC WD1600AAJS-0 (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
 1 1049kB 200MB 199MB primary ext4 boot
 2 201MB 160GB 160GB extended
 5 201MB 2248MB 2047MB logical linux-swap(v1)
 6 2249MB 4296MB 2047MB logical ext4
 7 4297MB 160GB 156GB logical ext4

I am under the impression that the previous way of handling the partition recipe was to align everything to cylinders, thus making my boot partition 197mb instead of 200mb.

Mathieu Mitchell (mat128) wrote :

Possibly related to #530071 ?

Mathieu Mitchell (mat128) wrote :

Added Colin to subscribers since this is related to a recent update. Don't hesitate to unsubscribe if this is unrelated, but I somehow think it is.

affects: ubuntu → partman-base (Ubuntu)
Mathieu Mitchell (mat128) wrote :

Great read but here my drives are not using 4 KiB sectors. The page says Fedora 13 uses the new libparted, supporting 4KiB sectors. I will install it on this machine to see if it's affected too.

Thanks Marcos

Colin Watson (cjwatson) wrote :

It would be interesting to confirm definitively that the different alignment is what's causing this, and not something else. I've been planning to add a preseedable option for final release that would allow you to select cylinder alignment rather than optimal alignment; while this isn't ideal, it would allow you to test this quite quickly.

The other option is to go back to cylinder alignment by default when the disk doesn't advertise anything in particular, but I'm reluctant to make that change since apparently it can cause compatibility problems with newer versions of Windows.

Changed in partman-base (Ubuntu Lucid):
status: New → Incomplete
importance: Undecided → High
assignee: nobody → Colin Watson (cjwatson)
Mathieu Mitchell (mat128) wrote :

Used Fedora 13 installation's fdisk (from util-linux 2.71.1), switched the DOS compatibility flag to off (as recommended per the prompt) and the units to sectors (again, recommended).

-Booted Fedora 13 installation CD.
-At the disk partitions step, switched to console 1 or 2 and started fdisk.
-Started with a fresh disk, created the following partition:
primary, partition number 1, starting at sector 2048, ending at 391167
extended, partition number 2, starting at 393214, ending at 312580095.
logical, partition number 5, starting at minimum (wanted to start at 393216 like Ubuntu did but minimum was 395xxx), ending at 4390911.
-Wrote changes to disk.
-CTRL+ALT+DEL rebooted the machine. System hung in BIOS like on the screenshot.

I am thinking it's either the end of partition 1 or the space between the partition 1 and the extended one that is causing it.

I can provide hardware through a KVM-IP if that would help, but when the bios hangs we have to physically swap or clean the hard drive.

Mathieu Mitchell (mat128) wrote :

Here's the partition table listing from fdisk using the flags mentioned in the previous post (dos compatibility flag off, units to sectors).
This is from a working 10.04 system installed using the preseed recipe:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007a9aa

   Device Boot Start End Blocks Id System
/dev/sda1 * 2048 391167 194560 83 Linux
/dev/sda2 393214 312580095 156093441 5 Extended
/dev/sda5 393216 4390911 1998848 82 Linux swap / Solaris
/dev/sda6 4392960 8390655 1998848 83 Linux
/dev/sda7 8392704 312580095 152093696 83 Linux

Mathieu Mitchell (mat128) wrote :

I guess that would be the error message on a Gigabyte.
Tomorrow I'll try to see if we have any old pentium 4 gigabyte motherboards laying around to test it!

Colin Watson (cjwatson) on 2010-04-09
Changed in partman-base (Ubuntu Lucid):
milestone: none → ubuntu-10.04
status: Incomplete → Confirmed
Mathieu Mitchell (mat128) wrote :

Next to Marcos' article, I decided to try the Gigabyte 965GM-S2 motherboard and can confirm it is also affected (only when connected to the Intel ICH8 controller). I did not expect this from an Intel AHCI BIOS. See attached screenshot.

Colin Watson (cjwatson) wrote :

With tomorrow's daily build (it's not in today's), could you please try booting the installer with this additional option:

  partman/alignment=cylinder

That should conclusively demonstrate whether it's optimal alignment or some other change in Lucid causing this problem.

Mathieu Mitchell (mat128) wrote :

Sure! Thanks!

Mathieu Mitchell (mat128) wrote :

You said to boot the installer with this option, does that mean I *must* provide this as a kernel boot option or I can provide it in my preseed file like this:
d-i partman/alignment select cylinder

(I guessed "select" by your commit to partman-base at http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/partman-base/lucid/revision/87)

My guess is that either way, this is going to work, but I just want to make sure ;)
Thanks again!

Putting it in a preseed file that way is fine too.

Mathieu Mitchell (mat128) wrote :

Adding the line to my preseed file *WORKED* on my main affected test machine.
I'm going to test all other affected systems tomorrow to make 100%, but I'm pretty sure that fixed the problem!

Colin Watson (cjwatson) wrote :

Thanks for confirming! Opening a release notes task - we'll need to document that alignment requirements may differ between systems, and that partman/alignment=cylinder is a workaround for buggy BIOS implementations or, I think, for co-installation of Windows XP and older.

Changed in partman-base (Ubuntu Lucid):
status: Confirmed → Fix Released
Mathieu Mitchell (mat128) wrote :

I'd like to confirm that this fixes the problem on all symptomatic systems I have used here. Thanks a lot for fixing this in such a short time!

Colin Watson (cjwatson) wrote :

Release note added:

== Partition alignment changes may break some systems ==

By default, Ubuntu 10.04 LTS aligns partitions on disk to 1 MiB (1048576 bytes) boundaries. This ensures maximum performance on many modern disks, particularly solid state drives but also new "Advanced Format" disks with physical sectors larger than the traditional 512 bytes. Very few systems nowadays need the old alignment, used in the days of MS-DOS when it was useful for partitions to start at the beginning of a cylinder.

In some rare cases, optimal alignment may cause problems. Some BIOS implementations (those on Asus P5P800-MX and Asus P5GZ-MX motherboards) have been reported to hang after installation. It may be difficult to install Microsoft Windows XP and older after installing Ubuntu, although more recent versions of Windows should be compatible with optimal alignment and indeed may produce it themselves. If you find that you need to use the old cylinder alignment instead, then add the {{{partman/alignment=cylinder}}} boot parameter when starting the installer.

Changed in ubuntu-release-notes:
assignee: nobody → Colin Watson (cjwatson)
status: New → Fix Released
kkady32 (kkady32) wrote :

nothing in fixed,after install lucid will not start

Dave Efflandt (efflandt) wrote :

I seem to be having the same issue with HP a530n desktop PC, ASUS K8N8X-LA, HP/Compaq motherboard name: Diablo-UL6E with Ami BIOS and early Athlon64 3200+ (2 GHz, 1024K cache) from 2004.

When I installed 64-bit 10.04 LTS w/grub on a 500 GB USB WD Passport, it would boot fine on 2 laptops, but would not boot on this desktop (error: unknown filesystem). From the grub rescue prompt on that drive, or grub 1.97 on my main drive I could ls other partitions on the drive, but that partition kept coming up with unknown filesystem for the 10.04 partition.

So I installed 10.04 to a 160 GB WD Passport to try to rule out a BIOS issue, since I know that I was able to boot 64-bit 9.10 from that drive, and the PC came with a 200 GB drive. That likewise booted fine on the laptops, but not that PC (error: file not found). Even stranger was that grub rescue from that drive, or grub 1.97 prompt on my main drive, could show directories and files on the root of that partition. But from grub rescue, "ls (hd0,2)/boot" only returned a happy face symbol, and "ls (hd0,2)/boot/grub" returned error: file not found. From grub 1.97 prompt on my main hard drive "ls (hd1,2)/boot" displayed "STX" in a tiny font and then an endless stream of blank lines.

So I tried first recreating the partitions in gparted of 9.10, used the "partman/alignment=cylinder" parameter for the install CD, and used the partitions I had already created. I am now able to boot 64-bit 10.04 LTS from the 160 GB USB drive on the problem PC (and posted this from it).

taka k. (scar) wrote :

is this related/the same as the problem i have described on the ubuntu-server mailing list[1][2]?

i did not have any problems booting a freshly-installed ubuntu-server system around May 1, 2010, but then a couple weeks later, on a second server with identical hardware, the BIOS hung trying to detect the disks. the same thing happened (BIOS hanging) again on a third, identical server. after deleting the partitions on the disks, i tried last week to re-install ubuntu-server but BIOS hung again. today, i tried re-installing with the network cable unplugged since i thought it might have to do with an updated package the installer was downloading. still no luck.

1. https://lists.ubuntu.com/archives/ubuntu-server/2010-May/004204.html
2. https://lists.ubuntu.com/archives/ubuntu-server/2010-June/004274.html

Mathieu Mitchell (mat128) wrote :

Hi Scar,

The "problem"/feature made it into the release installer, but it has been noted in the release notes. Consider yourself lucky to be able to change it to IDE mode and clean the partitions.
To confirm this is the problem you have described, try installing Ubuntu from a preseed file containing the following option:
d-i partman/alignment select cylinder

This should cause the setup to align partitions to the cylinder instead of the optimal behaviour. If everything works then you have encountered this particular bug.

I am having same problem after upgrading from 9.10 to 10.4. BIOS hang on detecting drives. Have to remove drive and clean it using another system to be able to boot the system again. I got first ISO of 10.4 when i got released. Yesterday i tried reinstalling it with live cd and added
"partman/alignment=cylinder" to boot parameter just behind "quiet splash --" but i still have the same problem :-(

Mathieu Mitchell (mat128) wrote :

Dennis,

This problem only appears when partitioning the hard disk drive using the new Ubuntu. If you are upgrading from an earlier version using the supported method (update manager), then the problem is probably somewhere else. However, if you completely reinstalled using the new CD, you could be affected by this.

The partman option is supposed to be in a preseed file or provided as a boot option using the alternate CD/netboot installer. I am not sure you can use it with the live CD installation.

Simply boot the live CD and manually partition your hard disk with a cylinder alignment, then tell the installer to use the partitions you have previously created using another program (such as fdisk).

Hi Mathieu,

Thank you for your quick response. The live CD seems to ignore the "partman/alignment=cylinder" boot parameter.
Also when using partition manager from live CD i'm unable to create partitions that will align cylinders. This evening i will try use GParted Live CD to create partitions manually which allows me to align partitions to cylinder boundaries. I'll let you know if it works.

Kind regards,

Dennis

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers