Is it possible to boot from SD or USB HDD and how? (jetson tk1)

Hello

Apparently, it is possible to install the OS on SD or USB HDD, but how?

For my kayla, i need to install some part (kernel) on first SD partition and rootfs on another one. Is it same on jetson?

Using the Tegra for Linux link from the Jetson Support page, there is a link to the Example File System (a basic Ubuntu 14.04 installation) and a link to the Tegra drivers.

When you decompress and untar the files as shown on the Quick Start Guide linked from the support page, you will get a flash utility and config files, among other things. Do this on another computer using a recent Ubuntu and things should go smoothly.

The flash utility can be used to install the bootloader to look for the OS in a variety of places. This includes the eMMC on the board, possibly to the SD-MMC, certainly to a USB harddrive, allegedly also to NFS,

My approach was to buy an external harddrive, and using fdisk I created three partitions. One is 8Gb ext3 (could be ext2 or ext4), one is 16Gb swap, the remainder of the drive is ext3. Use mke2fs and check for bad blocks, mkswap on the swap drive. Untar the example filesystem and drivers on your other computer, and you will have a directory named “rootfs”. Mount the first partition of the USB drive someplace like /mnt/sda1 and create a directory called “usr” there, and mount the remaining non-swap partition there. For example, mount -t ext3 /dev/sda3 /mnt/sda1/usr. Be sure you have run the files that come along with the flasher utility, to move drivers into place, etc. Now, after that, cp -a /path/to/installdir/rootfs/* /mnt/sda1 will recreate the ready filesystem from your installation computer to the USB harddrive. When done, unmount the harddrive and connect it to the full-size USB connector on the Jetson board. Then follow the instructions for flashing, using the command-line found in the Quick Start Guide, but rather than specifying mmcblk1p1 you should specify sda1. Use the 8G option as shown.

When you are only flashing the bootloader to the Jetson, it takes only maybe 30 seconds rather than 30 minutes. Additionally, if you have problems with the filesystem, you can just unmount the drive, attach it to another linux machine, and repair it from there. This will solve problems such a a hard crash which leaves the USB HDD in a state needing manual repair such as e2fsck -yv. Once repaired just reattach to Jetson and restart.

Additionally, there is an advantage to the external harddrive aside from the usefulness of adding lots of swap space. It Will Be Necessary to write an /etc/fstab for the external drive which will properly mount the second partition on /usr at boot time. Of course this will not matter if you want to limit yourself to an 8G first partition so that development has the same space constraints as a diskless thin-client or embedded system.

I hope this helps,

Thanks very much.

I’ll install OS on USB SSD tomorow…

Bruno

To boot from USB Stick(USB3.0), I did following procedures:

sudo tar xpf Tegra124_Linux_R19.3.0_armhf.tbz2
cd Linux_for_Tegra/rootfs/
sudo tar xpf ../../Tegra_Linux_Sample-Root-Filesystem_R19.3.0_armhf.tbz2
cd ../

Edit jetson-tk1.conf: When I edit this file, L4T failed to launch.

<s>ODMDATA=0x6209C000; #To Enable USB 3.0 support</s>
sudo ./apply_binaries.sh

Format USB_Stick as 13000MiB ext4, then cp rootfs to USB Stick

cp -a ./rootfs/* /PATH/TO/USB_Stick/

Connect USB Stick to Jetson TK1

Flash eMMC

sudo ./flash.sh -S 13GiB jetson-tk1 sda1

After Flashing Press Reset Button on your board.
USB3 is not enabled at this time, This is not usable speed… feels slower than internal eMMC.

Enabling USB 3 implies making it available at boot time. This in turn means having to provide the information at boot…the device tree blob files (dtb) files are for this. You would have to have made the right dtb file available for this particular device.

One tip for those thinking they must install from an Ubuntu host…fedora and others work fine. The snafu is if you use a system with modern udev which dynamically generates /dev files. Fedora and some others do not have /dev/loop0 until it is generated as root via losetup --find. Then /dev/loop0 exists and flashing the whole unit works (not even this is required if flashing only a kernel).

Also, if you choose the option for u-boot, you can install multiple kernels and select them at the boot prompt. Boot prompt timer is very quick, so it takes serial console and a fast eye! Under u-boot /boot contains the kernel zImage, as well as /boot/extlinux.conf. I kept a copy of my original R19.3 kernel as /boot/zImage-3.10.24-gf455cd4 (my new primary kernel has an “_1” appended to the version which is reflected in uname -r). Then edited /boot/extlinux.conf by copying the “LABEL” block after adding a blank line below the original…then edited “LABEL”, “MENU LABEL”, and set the “zImage” to “zImage-3.10.24-gf455cd4”. Now if I’m fast I can pick my newest kernel or this original.

One thing I did not do is to copy the original vmlinux.uimg to vmlinux-gf455cd4. It works anyway…I’m thinking that the instructions may be wrong about requiring vmlinux.uimg in u-boot…vmlinux.uimg is ignored with u-boot. Actually using kernel features which change between my versions correctly follow the zImage and ignore the vmlinux.uimg (e.g., my newest kernel reads cdrom filesystems like ISO9660 and joliet extensions…the original does not). Even so, I’d suggest making a copy of each vmlinux.uimg with the old uname -r in the new name before overwriting it.

Thank you, this should really be on a wiki or something.

How is the speed using a USB drive?

Well, I tried following the instructions as best as I could, but now when I start the board with the usb HDD plugged in it has some kernnel panick and won’t start. I get a bunch of scrolling text and then it stops. I followed the instructions above exactly.

I followed underdogma’s instructions exactly, but I can’t get this to work. I’m using the latest Linux system provided by Nvidia. When I start the board it’s not displaying anything on HDMI. The board is basically useless to me if I’m limited to 8-13GB.

Kevin did you ever get this working?

Hey,
Is it possible to boot from eMMC but have the filesystem on sdcard/hdd/usb?

Yes, just set the kernel’s “root” parameter in /boot/extlinux/extlinux.conf (assuming you are using 21.3 release and u-boot) to point to the correct device. But do add a new entry there instead of modifying the existing so you can always boot using the rootfs on emmc if something goes wrong.

Thank You kulve. That works.