LILO's infamous "inconsistent partition table" failure

Last modified: Thu Jul 26 20:42:28 EDT 2018

Warning: Device 0x0840: Inconsistent partition table, 2nd entry
  CHS address in PT:  21:25:5  -->  LBA (338944)
  LBA address in PT:  16789504  -->  CHS (1045:25:5)
Fatal: Either FIX-TABLE or IGNORE-TABLE must be specified
If not sure, first try IGNORE-TABLE (-P ignore)

This nasty-looking error tends to crop up whenever you have a bootable DOS or Windows partition on a drive with more than one partition.

LILO is complaining that the start of the partition according to the old CHS fields is different than its LBA start sector.  If you have a partition that starts at sector 16450560 (= 8032.5 MiB) or beyond, this is guaranteed to be the case.  The maximum CHS sector is 1023/254/63; (1023*255 + 254)*63 + (63-1) = 16450559.

If the start cylinder field is set to 1023, LILO will not raise the error.  Clearly, it assumes that a sane partitioner will stick the CHS at its maximum value for sectors that are beyond the limit.  Unfortunately, both Windows 98 SE's FDISK and Linux's fdisk thought it was a good idea to wrap the cylinder on overflow.  For example, when W98SE FDISK is asked to create an 8192 MB partition at the start of the disk, it sets the ending sector number to 16787924 and the ending CHS to 20/254/63.  The wrong ending cylinder 20 is the result of wrapping 1044 at 10 bits (1024).  But LILO doesn't even check the ending CHS, so the first sign of trouble is when you create the second partition.

With default options, Linux fdisk will align the next partition to a 1 MiB boundary and wrap the cylinder field.  But with the command line option -c=dos, it will just set the CHS address of any sector past the limit to the maximum value 1023/254/63, thus satisfying LILO and perhaps limiting the damage that a rogue old version of DOS would cause.

Start LBA1678950416787925
End LBA 3356671933565141
Start CHS21/25/5 1023/254/63
End CHS 41/110/51023/254/63

(Note that fdisk reports CHS addresses with the heads and sectors fields reversed.  This has been fixed in the above example.)

In summary, the way to get W98SE and FreeDOS partitions on a disk without triggering LILO's ugly error is:

  1. Prepare a Windows 98 SE boot floppy (or floppy image) containing the patched-up IO.SYS from kb311561 and this unofficial hack of FDISK (kb263044) and FORMAT.
  2. Boot that floppy (or floppy image) and follow the procedures here to create the partition table and the first partition.  (How to boot a floppy image if you have no floppy drive)
  3. Later, use Linux fdisk -c=dos to create the second DOS partition and any additional partitions.