Boot from sata drive is really that easy?

The process is the same for both the Jetson TX1 and the Jetson TX2. Refer to the video for specifics.

The process is simple. Install a SSD on a Jetson (make sure the Jetson is powered down). Note: The physical installation is not shown in the video, the first part of this video is an example. Flash the Jetson with JetPack. Format the new SSD disk, setup a partition (it should show up as /dev/sda1). Then simply copy the contents of the eMMC over to the disk, and modify the /boot/extlinux/extlinux.conf file accordingly, so that the root directory points at /dev/sda1. After rebooting the machine, the SSD is now the root directory. There should be plenty of room for developing applications.

This is extracted from

This is actually mounting rootfs from SATA. Not fully booting from it.

Some explanation in Boot from external drive

If you just need a disk space, then mounting rootfs is sufficient for you.

1 Like

Is it actually booting from eMMC but assigning the SSD as root directory?

Correct.

The boot flow will be :

MB1-> MB2 → Cboot → Uboot → load kernel from emmc → kernel check where to assign root from kernel cmdline → set SSD as root.

So actually your emmc still has a whole file system. But bootloader just uses the kernel from it.

Most users don’t realize this so make some common mistake like trying to replace the kernel on the SSD and notice it didn’t work.

1 Like

Thank you.

It means the eMMC is the one and only one “boot drive” for TX2 and when it dies the system will become unusable.

Does the SSD become the default drive hereafter?

After modifying the /boot/extlinux/extlinux.conf, will the eMMC become root drive again when the SSD is not present?

If your module only has emmc but no QSPI flash memory, then that emmc is crucial as all the bootloaders are on it. (All TX2 series do not have QSPI memory)

After modifying the /boot/extlinux/extlinux.conf, will the eMMC become root drive again when the SSD is not present?

Yes, that is possible. But I would suggest you dump the serial console log when deal with such issue.
Serial console log will tell the bootloader log while no other interface would dump such log.

1 Like

I need to get a cable. Is this good for console?

The article says(Develop on SSD), “copy the contents of the eMMC over to the disk…”. Does it mean to copy everything including all the partitions from eMMC to the SSD?

That cable should be fine for serial console.

FYI, Jetsons don’t have a BIOS. If they did, then they’d (A) consume more power, (B) cost more, and (C) be physically larger. This means there are partitions containing the equivalent of the BIOS in them in software. This also means the method a BIOS uses to find a boot partition don’t apply. In an eMMC model all of that content must be on the eMMC, and on SD card models, that content is in QSPI memory (which is on the module itself). When you fully flash you are simultaneously flashing:

  • Equivalent of BIOS.
  • Bootloader.
  • Operating system.

During the flash the specifications of the flash cause that content to “point” to boot content. It is true that the bootloader software might search for other boot devices, but the initial pointer to boot content cannot be on external media.

1 Like

Thank you.

Is only the root directory to be copied?

What about the swap partition? I don’t think it is a part of “Equivalent of BIOS.”

By the way, I read an article about boot sequence(actually root directory sequence) of Jetson tx2/tx1, the order is SD card, eMMC, USB/SATA. Is this correct?

Swap partitions are normally ignored during boot regardless of whether or not there is a BIOS. I think by default you’re more likely to see a swap file which doesn’t enable until Linux is running (this is flexible). Swap partitions, when they exist, are not part of boot content, and so this could be on external media or eMMC (you wouldn’t have access to that for QSPI). If a swap file is on rootfs,

Note: Bootloaders and boot content always uses physical addresses. Swapping is virtual. Thus until Linux itself is running, and the memory controller is set up for virtual addressing, there is no possibility that a swap file or swap partition will matter.

I don’t know what the current sequence is for TX2/1, but it is useful to know that early on U-Boot was in the later part of the boot stages, but as the software evolved, CBoot had U-Boot functionality merged into it; as that occurred, U-Boot was removed. CBoot (and U-Boot when it existed) would never be on any external media. Once CBoot is fully loaded (or U-Boot in earlier software) USB drivers would load. The sequence of searching for content will depend on environment variable setup in CBoot (or U-Boot on earlier software). That content would in turn only succeed in finding media it has drivers for (and thus USB devices could be found; but then there might be an issue of if a filesystem driver is available, e.g., an external USB drive with ext4 I think could be found, but if it had another filesystem type, it wouldn’t be found).

That means the rootfs is pointed to SSD but the swap partition is still in eMMC.

Is it possible to create a swap partition in SSD?

.

It may be possible, but for a SSD you may better use a swapfile:

sudo su
cd /mnt
fallocate -l 8G swapfile
sudo chmod 600 swapfile
sudo mkswap swapfile
sudo swapon swapfile
exit
free -m
1 Like

How many partitions does the system need in this case?

No extra partition is needed. The swapfile will reside into the filesystem where it has been created.

Thank you.

I’d agree with what @Honey_Patouceul mentions. FYI, a swap file is a file “pretending” to be a swap partition. It avoids needing an actual partition.

1 Like

Thank you.

Is it possible to write a batch/script for rootfs or boot drive selection or boot option?

Swap would not need a script, it has methods that are simple and standard. Actual rootfs picking isn’t possible on that generation, at least not without more knowledge than I have. The newer hardware (Xavier, Orin) supports redundant partitions, but this is not independent in the usual way, e.g., you wouldn’t be booting Ubuntu and Fedora (it’d be an automatic rescue of the same partition).

I followed the video from JetsonHacks to setup a sata SSD as boot drive last night. It is pretty straightforward but I only finished the first part (the SSD is set to root drive) but failing to build the kernel due to the differences between jetpack versions.

Anyway, I will try again later on.