Regular terminals are always directly connected. Examples: “/dev/tty0
”, “/dev/tty1
” (probably from ALT+F2
and friends). Pseudo terminals are not directly hardware related. This are software emulations. When you run an application in a GUI environment that has an emulation, you get something like “/dev/pty0
”, “/dev/pty1
”. These “softare” emulations of a terminal do pass through key binding events and run the same as a keyboard on something like a USB or some antique connector. When you log in remotely via ssh
, since this is virtual this also is a pseudo terminal/tty. Functionally they are not different. A virtual machine is 100% in software and being hosted. A virtual terminal is hosted by a parent app.
Since you don’t have a running GUI on the system you won’t be able to use any $DISPLAY
.
You’re not using a VM, so don’t worry about that part. We see a lot of USB errors though on these forums, and an enormous number of them are from VM users who do not know that a VM is not the same as a full computer. Parts can be made to behave correctly, but that’s a VM configuration for those people which is out of the control of the Jetson software.
The disk space I refer to is the host PC. If the Jetson has a 28 GB partition, then it will clone both an exact 28 GB bit-for-bit match (raw clone), and it will also produce a “sparse” clone. The sparse clone is almost the same as the raw, but it excludes the content on the partition which is empty. As the content of the partition fills and approaches maximum capacity, then sparse clone size approaches the size of the raw clone. Essentially you can consume twice the space of the partition during a clone (this is also why cloning takes so long). A 28 GB partition, if full, would consume 56 GB on the host PC. Then, if you clone or copy anything else, or install software, this adds to what is consumed. The command “df -H .
” (the “.
” is important, it is an alias for “the current directory”) will tell you what the disk availability is where you are currently located, e.g., in the “Linux_for_Tegra/
” directory (and if that is part of a given partition, then that same answer is true for any location within the partition). You have a large disk, but how much space is free on that partition?
With an external device you probably need to use the scripts from NVIDIA. This gets rather complicated to do in pieces. Backup and restore of just the rootfs partition is simple enough, but it isn’t the whole story. Command line of rootfs backup for a dev kit (keep in mind I don’t know if your AGX Xavier is a dev kit from NVIDIA or if it uses a third party carrier board; also, this runs from the Linux_for_Tegra/
directory):
sudo ./flash.sh -r -k APP -G rootfs_backup.img jetson-agx-xavier-devkit mmcblk0p1
Before you start any restore you really must know what L4T release is being used. See “head -n 1 /etc/nv_tegra_release
”. You can go here to get that exact release and documents:
https://developer.nvidia.com/linux-tegra
There are very good reasons to use that same exact release in the flash software when manually running it. I’ll give hints why later on. L4T itself is what gets flashed, and is just Ubuntu plus NVIDIA drivers.
You could create a log of that backup command like this (useful if you need to get support; can be attached to the forum):
sudo ./flash.sh -r -k APP -G rootfs_backup.img jetson-agx-xavier-devkit mmcblk0p1 2>&1 | tee log_emmc_clone.txt
To restore just that rootfs one would place a copy (this is an enormous file, this takes a lot of time just to copy the file) in “Linux_for_Tegra/bootloader/
”, and rename it “system.img
”. Then you’d flash like this (which also takes a lot longer than normal because it is raw and not sparse):
sudo ./flash.sh -r jetson-agx-xavier-devkit mmcblk0p1
Again, this could be logged for forum support:
sudo ./flash.sh -r jetson-agx-xavier-devkit mmcblk0p1 2>&1 | tee log_restore.txt
These operations take a lot of time due to size of data going over USB. I recommend you just log them in case you need it.
This does not clone or back up the non-rootfs partitions. However, this latter restore operation will restore all of the non-rootfs content. That content does not normally change, and if you had that release before, then there is no need to clone that other content…simply restore with the same content. In your case though there are complications.
The external disk storage requires special boot preparation. This means that restoring the way I mentioned can put non-rootfs content in which does not work with external boot. This is why the backup and restore script exists…to deal with external media. Backing up the eMMC though is not going to hurt anything, and it is rather important content. There are ways to back up the NVMe if you can mount it on the host PC.
If you have the NVMe on an external host (presumably you’ve removed it from the Jetson and put it on the Linux host PC), and if you have enough disk space to copy an entire NVMe, one can use the dd
tool to directly clone individual partitions or entire NVMe disks. The backup script (the backup_and_restore script, not the commands I showed earlier) will do the right thing if they work, so try that for backup before you use the other methods. However, moving the NVMe to the host PC lets you run the command “lsblk -f
” to see which disk it is, and perhaps individual partitions. If you will restore to another disk of the exact same size, just clone the whole disk. I’m going to assume that the NVMe has number “nvme1n1
” instead of “nvme0n1
” (I’m assuming the host PC has an NVMe already; if you get the wrong one you can destroy data on both host and NVMe), and I am assuming the host has enough room:
sudo dd if=/dev/nvme1n1 of=backup_nvme.img bs=100M status=progress
(this might take hours)
So it is possible to manually backup the eMMC. And to also manually back up the NVMe. It is less complicated if the backup script does this. Restore with the script will restore everything correctly. Restoring manually with the eMMC and NVMe individual backups will not be simple (but it will save everything you need and make surviving failure possible). Remember all that content in partitions of eMMC which are not rootfs? That’s where some of the changes go to boot external content. There is also an initrd involved which might be located in different locations and I can’t guarantee you’d get that partition or file correct when manually backing up pieces. You could restore from this, but it would take work and a learning curve. The backup and restore script has all you need in the README file.
Regarding the part where I said you need to know which L4T release was used and to use that same release: If you had JetPack/SDK Manager, then you’d just start it like this to get the correct release:
sdkmanager --archived-versions
However, you can’t use JetPack/SDK Manager (which is just a front end to the command line anyway) since you don’t have a GUI. Here is how you’d install the command line environment if you don’t already have it; go to the URL for your L4T release, and then download:
- The “driver package”.
- The “sample root filesystem” (you might not need this but it should be in place for various reasons).
Then, in an empty location, unpack the driver package as a regular user. Do not use sudo
or root login.
This produces the “Linux_for_Tegra/
” subdirectory. Within that go to the “rootfs/
” subdirectory (“Linux_for_Tegra/rootfs/
”). Unpack the sample root filesystem with sudo
.
Now go back to “Linux_for_Tegra/
”. Run this command:
sudo ./apply_binaries.sh
This location is now ready for any command line flash or restore. You don’t need to repeat that. The “flash.sh
” script and the backup and restore content is part of the driver package.
I must warn you that even if you know what you are doing this might exceed a one day task. You really must start by knowing if you have enough free space after you have the driver package and rootfs installed. You should try the backup and restore script first. If you cannot do that, then you can clone the eMMC as shown above (incidentally, the Jetson must be in recovery mode to clone anything). If the backup script fails and you use the dd
method to back up the NVMe, then back that up and back up eMMC before you ever try to clone anything.