Jetson TX2 Power loss protection

I want to use a Jetson TX2 for my design which should restart reliable after a power loss. How resistant is the eMMC against power loss? What’s the best way allow power loss without failure, maybe boot from ramdisk?

Hi andik,

Have you observed any issue on current BSP? If no, maybe you can find the answer from elsewhere, e.g.

Here’s what I do to have good robustness to power loss on Ubuntu systems:

  1. Use a file system that has good journaling support, for each of your file systems. EXT4 is alright. NILFS2 is alright. ZFS is alright. I’ve had problems with BTRFS, so I would recommend against that.

  2. Partition your system so that /var lives on one partition, /home (or wherever else you put the bulk of your data) lives on one partition, and the rest of the file system lives on a third partition. Because of systemd, it’s hard to run read-only root file systems these days, but at least this moves the bulk of write data to separate partitions. This also means that log files (that live on /var) and user data (that lives in /home) don’t compete with the main system for space, so uploading too much user data won’t suddenly make logging stop working, etc.

  3. Have a process that calls the sync() system call every so often (every 1-30 seconds, depending on your caching/performance requirements.)

This means that you have three levels of defense:

  • the file system journal should protect against sudden power loss
  • the important system files should be protected from the read/write traffic of bulk data
  • any file system data written before a crash is likely to be properly flushed to disk

Thanks for your answers!

Vickyy thanks for your link, i think overlayroot is what i need.

Snarky thanks for your message, i will use ext4 for my filesystem.

I need to be able to unplug the Jetson TX2 from power at any time without any damage to the operating system, which would stop the Jetson TX2 from booting. So i think overlayroot is the way to go. Userdata(which is not important) will be saved on a eMMC Partition, SD or SATA Drive.

Any recommendations on how to make the Jetson TX2 “unplugable from power at any time” like a DVD Player or a TV?

Auvidea has a carrier board that supports UPS that you might want to check out:

https://auvidea.com/j140-dual-gbe/

I don’t think an UPS would solve the problem for andik.

If you can make sure that the u-boot partitions and the root file system are mounted read-only, and not re-mount them read/write, that will guarantee that the system will always stay bootable. You’d have to mount any subdirectories (temp, logs, user data, settings, and so forth) as read-write, which may require changing the default partition plan around a bit, but for a robust system, this may be worth it.

The draw-back is that system updates become harder. Any networked system these days MUST have a plan for patching security problems, else those systems will become zombie members of botnets that continually scan all of the internet for vulnerable nodes. With a read-only root file system, the best bet for updates is to set aside two partitions, and ping-pong between them during update. This is somewhat involved, but does improve robustness. (And as a benefit, you can always go back to the previous partition if the new partition is bad.)

That being said, even if you mount the root as read-write, as long as frequently changing data (/var, /home) is on their own mutable partitions, the magic of logging file systems (such as ext4) is that the system will boot just fine after power is turned off. Make sure to call sync on the root file system reasonably often, and you should honestly have nothing to really worry about.

Just FYI, flash memory called with sync will protect against power loss corruption, but will shorten the life of that kind of memory.