2

I am benchmarking EXT4 performance on Compact Flash media.

I have created an ext4 fs with block size of 65536. However I cannot mount it on ubuntu-10.10-netbook-i386 (it is already mounting ext4 fs with 4096 bytes of block sizes)

According to my readings on ext4 it should allow such big block sized fs. I want to hear your comments.

root@ubuntu:~# mkfs.ext4 -b 65536  /dev/sda3
Warning: blocksize 65536 not usable on most systems.
mke2fs 1.41.12 (17-May-2010)
mkfs.ext4: 65536-byte blocks too big for system (max 4096)
Proceed anyway? (y,n) y
Warning: 65536-byte blocks too big for system (max 4096), forced to continue
Filesystem label=
OS type: Linux
Block size=65536 (log=6)
Fragment size=65536 (log=6)
Stride=0 blocks, Stripe width=0 blocks
19968 inodes, 19830 blocks
991 blocks (5.00%) reserved for the super user
First data block=0
1 block group
65528 blocks per group, 65528 fragments per group
19968 inodes per group

Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.



root@ubuntu:~# tune2fs -l /dev/sda3
tune2fs 1.41.12 (17-May-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          4cf3f507-e7b4-463c-be11-5b408097099b
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index
filetype extent flex_bg sparse_super large_file huge_file uninit_bg
dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              19968
Block count:              19830
Reserved block count:     991
Free blocks:              18720
Free inodes:              19957
First block:              0
Block size:               65536
Fragment size:            65536
Blocks per group:         65528
Fragments per group:      65528
Inodes per group:         19968
Inode blocks per group:   78
Flex block group size:    16
Filesystem created:       Sat Feb  5 14:39:55 2011
Last mount time:          n/a
Last write time:          Sat Feb  5 14:40:02 2011
Mount count:              0
Maximum mount count:      37
Last checked:             Sat Feb  5 14:39:55 2011
Check interval:           15552000 (6 months)
Next check after:         Thu Aug  4 14:39:55 2011
Lifetime writes:          70 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      afb5b570-9d47-4786-bad2-4aacb3b73516
Journal backup:           inode blocks


root@ubuntu:~# mount -t ext4 /dev/sda3 /mnt/
mount: wrong fs type, bad option, bad superblock on /dev/sda3,
      missing codepage or helper program, or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so
4

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.

| improve this answer | |
1

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

Unfortunately there's almost no great progress yet. 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

For testing 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

| improve this answer | |
0

I'd say use 4kb blocks for compatibility and use extents and stripe stride-width options on create/mount to get block allocations in accordance with erase block size of your flash media.

Make sure also that partition is aligned to this erase block size too!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy