Increase SD cards' life-span

Hello!
What could be done for increasing SD cards’ life-span (used as OS boot drive) on Nano?
Like turning off logging or similar, are there any examples out there for that?

Many thanks!

You can use a RAM disk for volatile logs and inter process communication data.

1 Like

My application/processes are not a concern, they are in my control and writings will be very rare (if any).

I’m worried about OS related writings, how to disable them as much as possible, are there any practical examples?
Furthermore, less OS related writings means less chance for corruption on unexpected power-loss , right?
Thanks!

Simply don’t use SD-cards. The production modules are equipped with EMMC modules, which are much faster (8 data lines instead of 4, higher clock rate since no socket degrades signal quality).

You need kernel and bootloader on EMMC/SD, but the rest of the system can be anywhere (NVMe SSD, NFS server,…).

fchk

1 Like

For any solid state memory you can increase life if you do not enable swap. The command “swapon -s” will display a summary of swap. By default most Jetsons will not set up any swap and no change would be needed.

Others have mentioned that logs are otherwise the most written content.

I don’t know if this is practical, but you can use Magic Sysrq to remount read-only via the correct echo to “/proc/sysrq-trigger” (the sysrq combinations work either via a key combination or echo to that file). You may find that this breaks a number of scenarios, e.g., some applications may require temp files, and this would break them. If you were to test this, then I’d recommend making sure every application you want to use is running, and then calling sync through sysrq, followed by remounting read-only. I have no way of predicting what applications might break from this.

1 Like

Thanks for the comprehensive answer!
Anyway I do not see any result displaying for swapon -s comand.
I have disabled swap, but doesn’t free -h gives the reliable current status of swap setting?
My Jetson Nano had a swap of 2 GB by default according this command (and according some web sources too)

Thanks! Are there any differences in installation/configuration of JetPack when using EMMC compared to SD card ?

It does. There is more than one way to do the same thing. An advantage of “swapon -s” is that it will also tell you which file or partition is acting as swap, while “free” will only tell you the total.

The Nano, when it is a microSD variant, is flash target “jetson-nano-qspi-sd”, and the eMMC variant is flash target “jetson-nano-emmc”. The different argument, when passed to the flash.sh driver package, will result in some different configuration (for example, device tree or boot configuration naming SD card versus naming eMMC).

Note: Jetson has zram now by default. It will show up as swap because of how it’s implemented, but it’s ram backed.

Never realized it would show as swap unless actually enabled as such. Makes sense though.

Thanks!
I have SD image initially created with Etcher and later cloned with Clonezilla (stripped down OS - JetPack 4.4 image that exactly suits my needs e.g. without “bloatware”).
Then restoring this image back to eMMC would probably not be possible ?
I should make a new image with other Nvidia’s tool ?

The SD card content is not directly compatible with the eMMC model (at least for booting…firmware like device tree would need to change). You would need to use the NVIDIA tools running on Linux (Ubuntu for the GUI) to flash the eMMC version. This does not mean your current SD image is useless, as you can copy parts of the content which are useful (for example, the “/home” directory, ssh keys, the CUDA and related in “/usr/local” if using the same release version, network settings in “/etc”…but it would take some trial and error testing).

Thanks for info!