Read files on Xavier AGX from host computer

Is it possible to read files on my Xavier AGX using “recovery mode” from an host computer, using the USB connector ?

I would like to get some files on it before I overwrite the installation with a new one (the ‘nvidia’ password were maliciously changed :( )

Thanks !

You can clone the root filesystem, and then get content from the clone when at another Linux computer (the clone can be loopback mounted). Individual files though cannot be picked.

Before starting, consider your host PC needs a lot of spare disk space. Clone will produce a “raw” file which is the exact size of the entire partition, plus a smaller file (but still many GB) which is a “sparse” file. Both formats can be flashed, but only the “raw” file can be loopback mounted, examined, so on.

Typically, if the Jetson is connected via the correct USB and is in recovery mode, then from the “Linux_for_Tegra/” subdirectory, you would enter a command like this:
sudo ./flash.sh -r -k APP -G my_backup.img jetson-xavier mmcblk0p1

The above would produce files “my_backup.img.raw” (the raw file) and “my_backup.img” (the sparse file). Do be warned that files this large take a long time to do anything, even copying the file.

An example of using the raw file on loopback from the host PC:

sudo mount -o loop my_backup.img.raw /mnt
cd /mnt
ls
cd -
sudo umount /mnt

You could of course copy files or directory trees. You could even use that exact partition for flash at a later time.

Thank you very much for your swift and complete answer.

There’s one point thought : where can I access or mount the Linux_for_Tegra/ subdirectory ?

I have access to the L4T_Readme drive on host computer when I start the Jetson normally (not in Recovery mode)

But, starting in recovery mode yield nothing. No media appears, no sda1 on sdb1 in /dev.

Thanks again for your support.

Linux_for_Tegra/” is not a mount point. This is a subdirectory of the flash software. The default install location on the host PC would be of this format:
~/nvidia/nvidia_sdk/JetPack...version.../Linux_for_Tegra/

So if you’ve ever run JetPack/SDKM, then the directory will be there. Trivia: Most of that content from the “driver package” (something the GUI front end installs for you), and within this the “Linux_for_Tegra/rootfs/” is the “sample root filesystem” package (possibly with NVIDIA drivers added if the “Linux_for_Tegra/apply_binaries.sh” script was run, and would have run if you’ve flashed once).

All flash and all clone is always performed with the Jetson in recovery mode. Once a flash completes the Jetson self-reboots, and then the user can perform the first boot account setup. Once that is done the optional content (e.g., CUDA, sample programs, so on) are added to the Jetson over ssh (which is why it must be fully booted for optional extra packages to be added, but also why any flash or clone demands recovery mode instead).

A recovery mode Jetson is a custom USB device. It is not a mass storage device (this is not what device mode does, mass storage is a second driver on top of device mode, and Jetsons do not do this). The only way to modify or use a Jetson in device mode (recovery mode version) is through the driver package on the host PC. There will be no mass storage device, but the flash.sh commands (part of the driver package) will know the correct recovery mode device is found. In no case will there ever be a “/dev” entry from a recovery mode Jetson. This is why a clone is needed rather than a simple partition or file copy.

@linuxdev describes a method of reading at Host PC from a snapshot[clone of disk] created at Jetson
However, @user156614 , you may also use USB connector in [LAN] mode to read[write] from running Jetson OS filesystem e.g. with scp, sshfs, etc
Moreover, the Linux for Tegra subfolder is typically at the Host PC created e.g. by sdkmanager in corresponding folder

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.