Native boot from M.2 NVME SSD

Hi there, Could someone help me to configure my Nvidia Jetson NX board to boot from M.2 NVME SSD without attached microSD? Thanks for you help in advance!

This is jetson agx forum. Not NX. Let me move your topic there.

For the NVMe SSD boot, please refer to

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/flashing.html#wwpID0E0QN0HA

Thanks man for you support, is that possible to get more simplified version of procedure?Bcoz i really dont get it, particularly the purpose of using eMMC and other terminologies like Secure boot also unclear to me.

Another user just shared this. Maybe you can try.

2 Likes

And some basic concepts of how things work.

1 Like

Wayne, thanks for your help in this matter!I really appreciate it. Let me test it. I will return to that subject in a moment.

Just some minor clarification here. This approach still needs the SD card to be present, it’s just it’s only used for a fraction of a single then it boots fully further from the SSH leaving the running system operating off the SSD. To completely eliminate the SD card from needing to be on the system doesn’t work with this method. But maybe you don’t need that, it adds extra complexity.

Also, the approach that I take here overcomes two problems that are present at the time of writing.

  1. The init= flag on the current jetpack 4.6 is not honored. My approach bypasses this by changing the symlink of /etc/init to my script and my script then later executes what was originally being pointed to after pivoting the root.

  2. On the Xavier AGX, unlike the NX or the Nano, the root= flag is not honoured. However, the root is abled to be mounted by the running kernel, again my script that is first executed instead of /etc/init does this mount. This approach again eliminates the next to do some extra flashing steps, reducing complexity. Also reduces the next for flashing, which I like to avoid if necessary.

If really comes down to your motivation for need with respect to eliminating the SD card. If it’s simply to get a nice fast boot and a fast system afterwards then my approach will work for you.

If it’s to stop the use for modifying anything or to productionize the box for sale whereby the user afterwards is not able to modify the system, then you need something else, although my solution may possibly help overcome the two problems mentioned further above.

Cheers,
Kim

1 Like

Sorry, I think I’m a bit dyslexic, I mean “then it boots fully from SSD leaving…”

1 Like

Hi, thanks for your detailed and informative response. I’ve just have one question, what is the difference here with the method provided by JetsonHacks to switch the rootfs to a NVMe SSD every time when Jetson NX boots up by leaving SD card to be present?

1 Like

My small posts in previous comment has some explanation about how this things do.

Switching rootfs means you can put the file system on the SSD. But the kernel could be somewhere else. For example, the kernel is on the sdcard or on another usb drive.

And Another method is even the kernel is on the NVMe side.

That’s what jetson can do: Jetson needs another boot device here to put some bootloader software on it.
For jetson Nano and NX sd module, they are the QSPI-NOR inside the module itself. Which means sdcard is never the boot device at all.

I mentioned Nano/NX “sd” module here because we do have other modules that don’t have sdcard slot and that kind of module is using internal storage emmc to boot.

The bootloader software will search the kernel and the kernel will mount the file system.
If the kernel is also on the NVMe ssd, then the sdcard can be removed.

But, the support to find kernel on NVMe ssd starts at jetpack4.6. Thus, any previous release has no ability to do this.

1 Like

I started off using the Jetson hacks approach. But I have an additional need and that is to be able to run the system with the OS mounted read-only having any writes to the OS happen to a memory overlay filesystem. To be able to do this I need the init= flag in extlinux.conf to be honored, I found that on Jetpack 4.6 this is not honored correctly.

Second to that, found that on jetpack 4.6 and only for the Xavier AGX platform the flag root= on extlinux.conf is also not honored. This led me to using the approach whereby I pivot the root and mount the SSD from the script for Xavier AGX to get around this. This approach also works for the NX and the Nano, so for consistency I now use this approach for all three platforms.

I personally don’t need to fully eliminate the SD card so this works for me. I notice that the raspberrypi 4 with the latest firm can also fully eliminate the need for the SD card to be present, but I find that having this present in the boot process can be convenient.

Kim Hendrikse

Also, this fix that I provide was just because I could do it quickly as I was working on similar things for another project. That provide both boots from SSD as well as running the OS on top of a read-only mount with a memory overlay file system and additionally as a read-write large partition for data and a small read-only but read-write re-mountable partition for writing configuration data to. This allows my application to be very resilient to power cuts. Particularly also because it doesn’t mount the extra partitons automatically but executes a forced fsck repair first which means you don’t get left in a state whereby the shutdown wasn’t clean and the disk needs repairing but the OS wants you to interact with it in order to do this. This of course means that you have to have both a monitor and keyboard connected, if you don’t you are left with a box that is hung and doesn’t boot.

If you want to achieve the above goals then the Jetson hacks approach is simply not sufficient because you are missing the extra partitions. I have scripts the entire approach as well as creating the extra partitions needed for this extra resilient. I then use this base project as the base for another project. Both of those projects are not yet formally released.

In my experience over the years SD cards on any platform get corrupted very easily by non-clean shutdowns meaning boot from SSD is more than just a speed convience. Also, wanting to interact with the user for the fsck step if any repair is required is a standard unix thing but as I mount the OS read-only during operation this is mostly just extra carefulness that unfrotunately means you need the connected keyboard and monitor which is a major disadvantage.

Once I’ve made YouTube videos and documentation I’ll release and explain the other projects I’m working on :-)

Kim Hendrikse

ehm
are there exact steps from first step to the last step that define in unambigious but redundant/clear way how to flash to nvme without use of sdcard using NX? that could be posted to the forum thread so they could be executed like script until completed? without need to discuss terminology? but just by executing?

1 Like

I put it here.

You can try to use

# Put device in recovery mode
sudo ./nvsdkmanager_flash.sh --storage nvme0n1p1 

to flash a jetson xavier nx sd + NVMe without the sd card

1 Like

@lhoang Reading through the nvsdkmanager_flash script, on the Xavier NX this only seems to flash the QSPI memory. This does not appear to take into account building/flashing the NVMe SSD as described in the full document. Did I miss something?

it also has this parameter " --external-device …" so it will also flash nvme

@lhoang Thank you, this seems to do the trick.

@lhoang Hi, Thank you for your inputs.
Would you mind to share what is the complete command line to flash nvme without sdcard if it got sorted out already?
not this one below?

# Put device in recovery mode
sudo ./nvsdkmanager_flash.sh --storage nvme0n1p1 --external-device