[Jetson-TK1] Root Filesystem Booting in Read-Only?

I just had an unfortunate accident where my Jetson-TK1 was unexpectedly shutdown. The ext4 root filesystem, which is on the embedded 16 GB memory, is now corrupted and Ubuntu will not boot.

I need to boot the filesystem in read-only mode so that I can run fsck.ext4 on /dev/mmcblk0p1. I would usually do this with /etc/fstab, but that file is empty.

Is there any way to configure the booting process of the Jetson-TK1 so that the root filesystem is mounted in read only? (Or other suggestions).

Thanks. Any help is appreciated.

Option 1:
Try

sudo mount -o remount,rw /
sudo touch /forcefsck
sudo mount -o remount,ro /

then reboot jetson. Than when filesystem check will end reboot again. It should be ok.

P.S. I have added “touch” line to /etc/rc.local. Boot takes more time but it increases integrity/stability of the root filesystem. But adding this line to cron to run this once a week or month would also be ok.

Option 2: Reboot till auto filesystem check will start (once every 30(in my desktop system number is 30)) mounts.

Cheers!

Sorry i didn’t read that you cannot boot.

Try connecting jetson to Laptop with micro usb cable.
Reboot to recovery

run sudo fsck.ext4 /dev/mmcblk… on laptop

FYI, on the original L4T R19.x, it wasn’t possible to use /forcefsck, as init ignored it. I believe there was also some issue with remount, so on R19.x I ended flashing with u-boot and creating a u-boot entry with a read-only mount option; any time I needed to fsck I could then just use the serial port to boot read-only. R21.x uses u-boot by default, R19.x used fastboot by default.

On all versions with u-boot, it’s a good idea to add a duplicate to the original extlinux.conf which differs only by mounting read-only. One of the problems with anything other than either remount ro or a boot entry to ro is that touching the file system might or might not break repair (or make results of file system repair worse). It isn’t too likely that touching /forcefsck would cause an issue, but on a corrupt file system it is actually possible for this to make things worse…starting out ro is no-risk.

I think this is the most promising option. Is it possible to mount the EMMC disk remotely through the USB interface? How is this done? I put my Jetson-TK1 in recovery and connected it to my host machine (USB), but I can not see any new volumes appearing.

I assume you have to use the provided flasher script or some other binary to initalise some sort of bridge? (I’m just fumbling in the dark here.)

I tried the other suggestions,

touch /forcefsck

didn’t work, as per linuxdev’s comments. Also tried rebooting > 30 times.

Forget my previous post. I have mixed gadget mode with recovery mode.

[url]http://elinux.org/Jetson/Cloning[/url]
I don’t think it is possible to mount root part in recovery. But you can download it and then fsck it and then resend it to jetson. Info how to do that in the link ;).

Hint: You don’t need to mount system.img to fsck it.

Also paste your bootlog (from com port ;)) There might be a situation where fsck can’t help. For ex. some file needed for boot was deleted/destroyed. Bootlog should add some clarification.

Also to enter gadget mode with tegra you need to type in u-boot(through serial console)

ums 0 mmc 0

first 0 - number of the usb host device to use
mmc - device to use as gadget
second 0 - number of the mmc device to use

then you can mount or fsck your jetson root part sd on your laptop

CTRL-C stops user mass storage mode

more info here: http://archlinuxarm.org/forum/viewtopic.php?f=49&t=7493#p40990

P.S. I have checked the steps this time to avoid any other mistakes ;)

Thanks for all the help. I managed to retrieve the system.img partition and run fsck on it, but it didn’t work… I’ll just reflash since at least I got out my files.

But it was great to get to know the “mysterious” nvflash a little more!