How to mount ext4 fs with block size of 65536?

AFAIK ext2/3/4 is based on the generic Linux VFS framework which requires block size to be less than or equal to page size

You may experience mounting problems if block size is greater than page size (i.e. 64KiB blocks on a i386 which only has 4KiB memory pages).

https://www.kernel.org/doc/html/latest/filesystems/ext4/overview.html

There were some talks regarding solving the big block issue

  • Large pages, large blocks, and large problems
  • Design for Large Allocation Blocks
  • RFC: CONFIG_PAGE_SHIFT (aka software PAGE_SIZE)

Unfortunately there's almost no great progress yet


However since you just want to test the speed, I suggest to use bigalloc which allocates in big clusters instead of big blocks. For example to create an ext4 partition with 64KB cluster

dd if=/dev/zero of=ext4.bigalloc bs=1M count=256
mkfs.ext4 -C 65535 -O bigalloc ext4.bigalloc
sudo mount -o loop ext4.bigalloc /mnt

This option is new in Linux 3.2 kernel and you must specify that option when calling mkfs.ext4 as seen above

  • -C cluster-size
    • Specify the size of cluster in bytes for filesystems using the bigalloc feature. Valid cluster-size values are from 2048 to 256M bytes per cluster. This can only be specified if the bigalloc feature is enabled. (See the ext4 (5) man page for more details about bigalloc.) The default cluster size if bigalloc is enabled is 16 times the block size.

http://manpages.ubuntu.com/manpages/trusty/man8/mke2fs.8.html

This feature is still in development so use it with care. But since you typically don't care about file corruption while benchmarking, it's probably the best option


That said, the limit is just in the in-kernel driver and you can still mount the partition with the FUSE driver. Some examples:

  • Fuse-ext2

    Fuse-ext2 is an EXT2/EXT3/EXT4 filesystem for FUSE, and is built to work with osxfuse.

    Usage:    fuse-ext2 <device|image_file> <mount_point> [-o option[,...]]
    
    Options:  ro, rw+, force, allow_other
              Please see details in the manual.
    
    Example:  fuse-ext2 /dev/sda1 /mnt/sda1
    

    Just run sudo apt install fuseext2 to install if it's not available. Tested on my system and it works perfectly

  • guestmount. See how to use it in Possible to mount an ext4 partition image via FUSE?

If you just want to copy the data then you can use debugfs but it's not quite useful for benchmarking. Even the performance of FUSE may be not good enough for measuring the device speed


The max ext4 block size is still limited by the page size of the kernel/CPU. Your page size is 4K and so the max ext4 block size is 4K.