Ted:
This is not really a bug in the ext2 filesystem --- *all* of the
filesystems store their magic numbers at different offsets.
Yes, but minix was first, that is why I call it a bug in xiafs and ext[2].
Well, actually, the MS-DOS filesystem was first. And a BSD disk
partition label also predates xiafs and ext[2] as well. I wouldn't call
it a bug so much as a fact of life.
Tradition so far is that 0x83 is Linux (any file system),
0x82 is Linux swap, 0x81 is Minix or old Linux, 0x41 is old Linux
on a disk that also has DRDOS. Such partition IDs do not distinguish
between xiafs and ext2, between msdos, umsdos, vfat, samba etc.
In fact this whole partition ID is a very messy business; nobody
knows what the ID is supposed to mean. OS/2 needs ID 7 before it
believes that it can access an IFS - that is why ext2 has to present
a 7 when read by OS/2.
It's not perfect, but I still think it's useful to the partition ID as a
hint of which filesystem type to check first. This is only as a
hueristic; I am well aware that there times when this hueristic will not
always work. However, a scheme like this would probably reduce the
incidence of the problem significantly:
Partition ID Filesystem to try first
------------------------------------------------
0x83 ext2
0x81 minix
0x01,0x04,0x06 msdos/umsdos
No, it is unfortunate that it is needed, but the only clean solution
is just to tell the kernel what the type of the rootfs is.
And it is no big deal - just one line in lilo.conf.
But that assumes that you are using lilo --- there are many other ways
of booting a kernel, from loadlin to booting straight from a floppy.
I'd rather not assume the presence of LILO.
- Ted