Bug in mkfs.ext4 implementation in Tomato?

Discussion in 'Tomato Firmware' started by davygravy, Apr 13, 2019.

  1. davygravy

    davygravy New Member Member

    {a polite, preemptive request to please not just tell me to use ext3 instead of ext4, thank you}

    After repeated attempts to use fdisk, mkfs.ext4 and mount together on FT ARM 19.1, I have come to the conclusion that there is a bug in the implemenation (or a mismatch of versions?) that is causing these errors:

    Code:
    root@AP1:/tmp# mkfs.ext4 /dev/sda1
    mke2fs 1.44.5 (15-Dec-2018)
    /dev/sda1 contains a vfat file system
    Proceed anyway? (y,N) y
    Suggestion: Use Linux kernel >= 3.18 for improved stability of the metadata and journal checksum features.
    Creating filesystem with 1465923 4k blocks and 366480 inodes
    Filesystem UUID: d9f49af2-c4a7-442e-80bf-f96a44e0d164
    Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736
    
    Allocating group tables: done                        
    Writing inode tables: done                        
    Creating journal (16384 blocks): done
    Writing superblocks and filesystem accounting information: done
    
    
    root@AP1:/tmp# mount -t ext4 /dev/sda1 /mnt
    mount: mounting /dev/sda1 on /mnt failed: Invalid argument
    

    The same done with mkfs.ext3 goes off without a hitch.
    Code:
    root@AP1:/tmp# mkfs.ext3 /dev/sda1 -L ENTWARE
    mke2fs 1.44.5 (15-Dec-2018)
    /dev/sda1 contains a ext4 file system
        created on Sat Apr 13 01:46:58 2019
    Proceed anyway? (y,N) y
    Creating filesystem with 1465923 4k blocks and 366480 inodes
    Filesystem UUID: 1cbf8a1d-818b-4f82-9e27-b23e961889e9
    Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736
    
    Allocating group tables: done                        
    Writing inode tables: done                        
    Creating journal (16384 blocks): done
    Writing superblocks and filesystem accounting information: done
    
    root@AP1:/tmp# mount -t ext3 /dev/sda1 /mnt
    root@AP1:/tmp# mount
    rootfs on / type rootfs (rw)
    /dev/root on / type squashfs (ro,relatime)
    devtmpfs on /dev type devtmpfs (rw,relatime,size=127704k,nr_inodes=31926,mode=755)
    proc on /proc type proc (rw,relatime)
    tmpfs on /tmp type tmpfs (rw,relatime)
    devfs on /dev type tmpfs (rw,noatime)
    sysfs on /sys type sysfs (rw,relatime)
    devpts on /dev/pts type devpts (rw,relatime,mode=600)
    usbfs on /proc/bus/usb type usbfs (rw,relatime)
    /dev/sda1 on /tmp/mnt type ext3 (rw,relatime,barrier=1,nodelalloc,data=ordered)
    
    Has anyone else noted this behavior?

    Maybe our version of mke2fs is too new for the kernel?
    Code:
    root@AP1:/tmp# uname -a
    Linux AP1 2.6.36.4brcmarm #1 SMP PREEMPT Sun Feb 24 18:02:44 CET 2019 armv7l Tomato
    
    root@AP1:/tmp# mkfs.ext3 /dev/sda1 -L ENTWARE
    mke2fs 1.44.5 (15-Dec-2018)
    
     
  2. Sean B.

    Sean B. Network Guru Member

    With the USB drive formatted as ext4, run this:

    Code:
    tune2fs -O^metadata_csum /dev/sd1
    And then attempt to mount it.
     
  3. davygravy

    davygravy New Member Member

    We unfortunately done have tune2fs in the firmware... but...
    Code:
     mkfs.ext4 -O^metadata_csum  /dev/sda1 
    worked a treat! I had to look at the man page for mkfs.ext4, and realize that the caret ^ signifies "disable feature".

    So is this indeed a mismatch between the feature set of mkfs.ext4 and the kernel?
     
    Last edited: Apr 14, 2019
  4. Sean B.

    Sean B. Network Guru Member

    The 2.6.36 kernel of the firmware does not ( or was not compiled with ) support ext4 metadata checksums. @pedro311 , @kille72 , may want to look into if it can simply be enabled at build time. Or if a back port is required, whether or not it's possible/feasible to do so.
     
  5. davygravy

    davygravy New Member Member

    Metadata checksumming: Since Linux kernel 3.16 according to wikipedia...
     
  6. Sean B.

    Sean B. Network Guru Member

    Actually 3.3-rc1, coded in this commit and enabled via several surrounding commits.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice