Ext2/ext3 problems on FreeBSD

Creating and mounting an ext2/ext3 filesystem shouldn’t be a problem. At least that’s what one should expect. But there can be a problem, as I’ve seen today.

If you create the filesystem with mkfs.ext2 from the ports, than there will be a file system that has a default inode size of 256 Bytes. But the FreeBSD ext2fs kernel module cannot handle them as of now.

If you mount the newly created file system (e.g. at /home), there will be no error message. But if you try to access the filesystem there will be the message

ls: /home: Bad file descriptor

You need to create a filesystem with the old 128 byte sized inodes with

mkfs.ext2 -I 128 /dev/

in order to mount it with FreeBSD. If you want to check how big the inode size on your ext-partition is, then you can use

tune2fs -l /dev/ | grep Inode