On a Raspberry Pi 1B (using the community kernel, mkfs segfaults consistently for me.
Debugging this through breakglass+busybox, I found the mke2fs
binary shipped with mkfs doesn't work:
/tmp # wget https://raw.githubusercontent.com/gokrazy/mkfs/main/third_party/e2fsprogs-1.46.5/mke2fs.arm
Connecting to raw.githubusercontent.com (185.199.110.133:443)
wget: note: TLS certificate validation not implemented
saving to 'mke2fs.arm'
mke2fs.arm 100% |**********************| 1271k 0:00:00 ETA
'mke2fs.arm' saved
/tmp # chmod +x mke2fs.arm
/tmp # ./mke2fs.arm
Segmentation fault
Trying another pre-built mke2fs binary for arm, this is the result:
/tmp # wget https://raw.githubusercontent.com/FerryAr/e2fsprogs-arm/master/system/bin/mke2fs
Connecting to raw.githubusercontent.com (185.199.108.133:443)
wget: note: TLS certificate validation not implemented
saving to 'mke2fs'
mke2fs 100% |************************| 1805k 0:00:00 ETA
'mke2fs' saved
/tmp # chmod +x mke2fs
/tmp # ./mke2fs
Usage: mke2fs [-c|-l filename] [-b block-size] [-C cluster-size]
[-i bytes-per-inode] [-I inode-size] [-J journal-options]
[-G flex-group-size] [-N number-of-inodes] [-d root-directory]
[-m reserved-blocks-percentage] [-o creator-os]
[-g blocks-per-group] [-L volume-label] [-M last-mounted-directory]
[-O feature[,...]] [-r fs-revision] [-E extended-option[,...]]
[-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file]
[-jnqvDFSV] device [blocks-count]
This is the diff that file
shows:
[/tmp] $ file mke2fs.arm
mke2fs.arm: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), statically linked, BuildID[sha1]=2630dddab326a63955b5b612f5d43a489a29faee, for GNU/Linux 3.2.0, with debug_info, not stripped
[/tmp] $ file mke2fs
mke2fs: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
I tried switching from armhf
to armel
and it now works for me (notice how it changed to SYSV, when I switched to armel):
third_party/e2fsprogs-1.46.5/mke2fs.arm: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, BuildID[sha1]=0849a1ec38b458bc0897662aa55d3a9e710861ba, for GNU/Linux 3.2.0, with debug_info, not stripped