Hello,
I understand that there are lots of people asking about how to boot from external drive (e.g. usb/NVMe drive). And also lots of methods all around this forum. Thanks for everyone to share their steps to achieve that.
This post is just to give some basic concepts about how jetson platform boots from external drive. And answer some frequently-asked questions.
I believe every method shared on this forum uses the same idea but just in different forms.
1. Jetson is not able to “fully” boot from external drive.
What jetson can do is boot “initrd/kernel” or “mount file system” from your external drive. It means you cannot just format the boot device and leave it empty. There must be bootloader components in your boot device so that the boot process can use the bootloader from it. For sdcard nano or NX, this boot device is QSPI on the module. As for other platforms, it is the emmc on the module.
2. You have to know the difference between “boot kernel from external drive” and “mount rootfs from external drive”
-
Boot initrd/kernel from external drive means the uboot (Nano/TX2 series) or cboot (NX/AGX) will search the kernel and extlinux.conf from your external drive according to the boot order. Once it finds the kernel and extlinux.conf, it will use the info from it to mount the file system.
-
Mount the file system means kernel will mount the file system according to your “root=” in kernel command line.
For example, the most common usage is root=/dev/mmcblk0p1 which will boot from sdcard (nx/nano) and emmc.
→ Thus, if you just want to increase your disk space, you don’t really need to boot kernel from external drive, you just make sure the file system is mounted from external drive.
→ It means there are lots of variety that you can use. For example, you can boot kernel from usb and mount the file system from NVMe.
3. How to do?
We provide steps inside the developer guide link for booting both kernel and mount rootfs from the same drive.
Please be careful that every platform shares different bootloader capability. For example, TX2 uboot does not support usb .
If you just want to mount the file system from external, then you can check this page.
I am sorry that the title of this page is not precise. It is just mounting the rootfs from external. Not booting from anything.
https://elinux.org/Jetson/L4T/Boot_From_External_Device
4. flash.sh will not flash anything to your external drive.
There were some users asking about why “sudo ./flash.sh … sda1” does not flash data to their usb drive. The truth is flash.sh currently only has capability to flash data to native sdcard (nano/nx) and emmc boot device. What this “sudo ./flash.sh … sda1” doing is just adding “root=/dev/sda1/” to the kernel command line. Which means this is only telling kernel to mount the file system from sda1. Nothing else is installed to the sda1 usb drive.
5. Can I create a USB drive that is similar to the sdcard image on Nano/NX?
Theoretically, flashing the sdcard image to a USB drive can work. Just in case the bootloader(uboot/cboot) is able to find your usb first, but not some other external drives. Also, you have to make sure the root device in kernel command line is not setting to something like mmcblk0p1. Otherwise, your file system will not be mounted correctly.
6. Official OTA upgrade does not support boot from external
Your “boot from external” setting would be gone after you try the apt upgrade. Because our OTA debian package by default only supports the boot from default path (emmc/sd).
7. (update: 2022/2/14) SDKM is able to directly flash to NVMe on jetson after jetpack4.6
This is because the initrd flash tool in this link is implemented and it can directly flash the NVMe drive on jetson of TX2-series/Xavier series.
link