When flashing the machine, the reserved partition is not refreshed

Hi ALl:
Can I flash the device without refreshing the following partitions(nav_env)?

robot@tegra:~$ df -h
Filesystem       Size  Used Avail Use% Mounted on
/dev/nvme0n1p1    63G   14G   47G  23% /
none             7.5G     0  7.5G   0% /dev
tmpfs            7.6G  1.9G  5.8G  25% /dev/shm
tmpfs            1.6G  163M  1.4G  11% /run
tmpfs            5.0M  4.0K  5.0M   1% /run/lock
tmpfs            7.6G     0  7.6G   0% /sys/fs/cgroup
/dev/nvme0n1p16  874G  200G  630G  25% /nav_env    <<<<<<<<<<<<
tmpfs            1.6G  8.0K  1.6G   1% /run/user/1000
robot@tegra:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0          7:0    0    16M  1 loop
zram0        251:0    0 968.7M  0 disk
zram1        251:1    0 968.7M  0 disk
zram2        251:2    0 968.7M  0 disk
zram3        251:3    0 968.7M  0 disk
zram4        251:4    0 968.7M  0 disk
zram5        251:5    0 968.7M  0 disk
zram6        251:6    0 968.7M  0 disk
zram7        251:7    0 968.7M  0 disk
nvme0n1      259:0    0 953.9G  0 disk
├─nvme0n1p1  259:1    0    64G  0 part /
├─nvme0n1p2  259:2    0   128M  0 part
├─nvme0n1p3  259:3    0   768K  0 part
├─nvme0n1p4  259:4    0  31.6M  0 part
├─nvme0n1p5  259:5    0   128M  0 part
├─nvme0n1p6  259:6    0   768K  0 part
├─nvme0n1p7  259:7    0  31.6M  0 part
├─nvme0n1p8  259:8    0    80M  0 part
├─nvme0n1p9  259:9    0   512K  0 part
├─nvme0n1p10 259:10   0    64M  0 part
├─nvme0n1p11 259:11   0    80M  0 part
├─nvme0n1p12 259:12   0   512K  0 part
├─nvme0n1p13 259:13   0    64M  0 part
├─nvme0n1p14 259:14   0   400M  0 part
├─nvme0n1p15 259:15   0 479.5M  0 part
└─nvme0n1p16 259:16   0 888.4G  0 part /nav_env    <<<<<<<<<<<<
robot@tegra:~$ cat /proc/partitions
major minor  #blocks  name

 259        0 1000204632 nvme0n1
 259        1   67108864 nvme0n1p1
 259        2     131072 nvme0n1p2
 259        3        768 nvme0n1p3
 259        4      32384 nvme0n1p4
 259        5     131072 nvme0n1p5
 259        6        768 nvme0n1p6
 259        7      32384 nvme0n1p7
 259        8      81920 nvme0n1p8
 259        9        512 nvme0n1p9
 259       10      65536 nvme0n1p10
 259       11      81920 nvme0n1p11
 259       12        512 nvme0n1p12
 259       13      65536 nvme0n1p13
 259       14     409600 nvme0n1p14
 259       15     491008 nvme0n1p15
 259       16  931570724 nvme0n1p16
   7        0      16384 loop0
 251        0     991936 zram0
 251        1     991936 zram1
 251        2     991936 zram2
 251        3     991936 zram3
 251        4     991936 zram4
 251        5     991936 zram5
 251        6     991936 zram6
 251        7     991936 zram7


nav_env :
It is a reserved partition. When flashing the device, there is no need to refresh the partition. The data must be retained.

Hi wxsrite,

May I know what’s your use case for this partition?
Do you just want to use it as storage?

As my understanding, flash script will format the disk and partition it according to layout file so that it will be erased after “reflash”.

But you can perform image-based OTA to update rootfs, it will not touch your custom partition and your data should be preserved after update.

Hi KevinFFF:
Yes, my purpose is to save the storage data of this partition.
The reason is this:
We hope that the data in our customized partition will be kept all the time. If the system is refreshed, only the system partition needs to be refreshed. This can decouple the system from the customized data, and each time the system is refreshed, the redeployment of this data can be reduced.

Please note that flash process will format the disk so that each partitions will be erased.
There’re many partitions in the disk like bootloader, kernel, rootfs, recovery…etc. (please refer to partition layout files for details)
The flash does not just update only rootfs partition.

From your description, it seems you want to keep some data never been touched by flash.
We would suggest you keeping those data in another disk (i.e. 2nd NVMe SSD).
Or you can perform image-based OTA update instead of flashing. In this way, you can update the system and the data in custom partition will be kept.

Hi, KevinFFF:
Other partitions can be refreshed at will. When flashing the machine, is it possible to only keep this one partition?
nvme0n1p16 259:16 0 888.4G 0 part /nav_env

No. I’ve explained above that the disk will be formatted during.
nvme0n1p16 is part of nvme0n1 disk

Hi KevinFFF:
When I OTA the production image, I use the following command:

sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh --external-device nvme0n1 -b jetson-orin-nano-devkit R35-4

This is how you do it when flashing the device, right?

robot@tegra:~$ export WORKDIR=/home/robot
robot@tegra:~$ tar xf ota_tools_R35.4.1_aarch64.tbz2
robot@tegra:~# sudo mkdir /ota
robot@tegra:~# sudo mv ota_payload_package.tar.gz /ota/
robot@tegra:~$ cd ${WORKDIR}/Linux_for_Tegra/tools/ota_tools/version_upgrade
robot@tegra:~/Linux_for_Tegra/tools/ota_tools/version_upgrade$ sudo ./nv_ota_start.sh /ota/ota_payload_package.tar.gz

What’s your Base and Target version for OTA?

Yes, please note to use the OTA update tool of your “Target” version.

It seems another topic relating to OTA update.
You can just open another topic to discuss in details.