On 9/7/2021 12:58 AM, Pascal Hambourg wrote:
Hello,
Le 05/09/2021 à 18:47, J. William Campbell a écrit :
AFAIK, the on disk format for ext4 is the same as ext2. If the code
can read an ext2 filesystem, it can read an ext4 filesystem.
I am not sure about that. AFAIK, some ext4 features such as extents
create a different on-disk format than ext2 or ext3. The ext2, ext3
and ext4 Linux drivers refuse to mount an ext4 filesystem as ext2
because of unsupported features.
Actually, there is a 32 bit rev level defined in the superblock.
However, it doesn't distinguish much and isn't the whole story. There
are also feature bits that must be supported by any software attempting
to read the disk. I think you are correct that incompatible features
would cause any software trying to read the disk to fail. ext4 also
supports 48 bit block numbers. It is therefore probable u-boot couldn't
actually read an ext4 file system if the file sizes were such that
extents were used. It doesn't actually matter, because u-boot see
options it doesn't recognize and won't try.
older u-boots didn't know about ext4, so when they check the version
of the filesystem they see a number that they don't understand and
give up.
IIUC, an ext* filesystem does not have a version number. Instead it
has a collection of "features", some of which are supported only by ext4.
But IMO the real point is : if ext2 is mandatory for /boot when
installing with LVM, why then is it not mandatory when installing
without LVM ?
Good question. I think it should be. Making the boot partition as simple
as possible without adding problems accessing it from "normal" software
seems like a good goal. All userspace programs can access ext2 file
systems with ease equal to ext4. IMHO it should be a requirement that
the file system be ext2. For sure, the boot partition doesn't need 48
bit block numbers an "largefile" support. The kernel/initrd is big but
not that big😁.