Jetson Can't e2fsck mmc0blk1

I’ve worked on some kernel debugging which has at times forced hard reset via the power button. I also found that this kernel version has a serious NFS server bug which is only logged if some debugging options are enabled…

exportfs: section 2 reloc 7 sym '_raw_spin_lock': relocation 28 out of range (0xbe80c158 -> 0xc080e580)

…possibly this only happens for modules, or perhaps only on shutdown, but looks like a direct branch is too far from the code it wants to branch to. Unknown effect.

Between NFSD and hard power resets I’ve ended up with some unknown file system corruption:

EXT4-fs (mmcblk0p1): warning: mounting fs with errors, running e2fsck is recommended

I can’t really see any particular system issue, but want to run e2fsck on mmcblk0p1 to fix this before I do something which might actually do serious harm to the file system. Only it seems L4T on Jetson has had e2fsck rendered incapable of doing a file system check.

Method 1 would be to run shutdown with -F option, but this does not exist on Jetson/L4T, and trying to do so has no effect.

Method 2 would be to place a file named “forcefsck” in “/”…reboot does remove this after boot, so I know at least the part checking for “/forcefsck” still exists…but it never runs e2fsck. “The lights are on, but nobody is home.”

Method 3 is easy to test because I’m using u-boot…simply add a command line to the kernel. It seems that different flavors of linux use a different kernel command line to force fsck, and I’ve tried them all, including “forcefsck” and “fsck.mode=force”.

I’m about to attempt a kernel command line to force boot to read-only mode and then manually e2fsck on a mounted file system, but it seems absurd to have something in place which actually removes /forcefsck but does not trigger e2fsck…this is very likely a bug. Does anyone here know how one is supposed to e2fsck mmcblk0p1 on Jetson/L4T?? I don’t feel like I should mess with the file system until I solve this, and am asking here before I ask the nVidia support.

Hello,
I have the same problem. I tried adding an fstab entry and /forcefsck did work for my external hdd.
But the internal fs keeps being dirty.

Cheers

One workaround for fsck is to create an alternate root partition to boot to, and boot to that…then mmcblk0p1 won’t be mounted and you can “sudo fsck.ext4 /dev/mmcblk0p1”. Is the hdd you mention ext4, and is it a root partition or a different mount point?

I have not verified this yet, but it may be possible in the extlinux.conf to add an alternate entry where “root=/dev/mmcblk0p1 rw” is set to “root=/dev/mmcblk0p1 ro” to boot read-only (which would make manual fsck possible).

Previously I had had an issue with NFS not allowing a proper shutdown, so it was always corrupted. Some of this was related to limitations in ARMv7 total module memory limits.

Thanks for the reply. I think I will create a small initrd with a busybox and boot manually to it for fsck.
The hdd is ext4 and no root partition but only for data on a different mount point.

I just create a partition of 16GB on the first partition of a SATA drive, format it ext4, and as root unpack the sample rootfs to this. You can use the driver package “apply_binaries.sh” with the “-r ” option to finalize the nVidia-specific files to this alternate location (e.g., if you mounted your partition on “/mnt”, then “sudo ./apply_binaries.sh -r /mnt”).

When connected to a Jetson, it becomes “/dev/sda1”. You can add a new entry to “/boot/extlinux/extlinux.conf” to point at this, then select that during boot via serial console (technically you could just aim the default entry there, but this is risky and inconvenient if something goes wrong…you’d have to edit the entry to put default back where it was…if you couldn’t do that you’d have to flash).

I have created a initrd https://www.aziraphale.net/data/initrd.img that contains busybox-1.25 and fsck.ext4 and spawns a shell at the serial console and added a second label to extlinux.conf

LABEL busybox
      MENU LABEL busybox
      LINUX /boot/zImage
      FDT /boot/tegra124-jetson_tk1-pm375-000-c00-00.dtb
      INITRD /boot/initrd.img
      APPEND console=ttyS0,115200n8 console=tty1 no_console_suspend=1 lp0_vec=2064@0xf46ff000 mem=2015M@2048M memtype=255 ddr_die=2048M@2048M section=256M pmuboard=0x0177:0x0000:0x02:0x43:0x00 tsec=32M@3913M otf_key=c75e5bb91eb3bd947560357b64422f85 usbcore.old_scheme_first=1 core_edp_mv=1150 core_edp_ma=4000 tegraid=40.1.1.0.0 debug_uartport=lsport,3 power_supply=Adapter audio_codec=rt5640 modem_id=0 android.kerneltype=normal fbcon=map:1 commchip_id=0 usb_port_owner_info=0 lane_owner_info=6 emc_max_dvfs=0 touch_id=0@0 board_info=0x0177:0x0000:0x02:0x43:0x00 rw rootwait init=/sbin/init initrd=/boot/initrd.img root=/dev/ram coherent_pool=4M rootfstype=ext2 debug

If you put the initrd at /boot/ you can interrupt booting on serial console and boot into the busybox initrd and fsck.ext4 the corrupt filesystem. That might come in handy if broke your rootfs aswell.

great thanks