Jetson TK1 - Boot from SATA?

Hello =)

a friend of mine and me, are just getting started with the freshly arrived Jetson TK1. We booted, installed the NVidia Stuff, downloaded the CUDA Examples (so yes, ethernet / internet works) and they run fine.

What i am trying to achieve now, is to make the Jetson run from an SATA SSD, to make development as fast as possible, as well as to be “unlimited” in disk space.

I found this thread on how to install the Tegralinux on an USB drive, but since i am not to familiar with linux, i am unsure about some things. https://devtalk.nvidia.com/default/topic/747933/embedded-systems/is-it-possible-to-boot-from-sd-or-usb-hdd-and-how-jetson-tk1-/

1.) does the described way work with the internal SATA port as well?
2.) how would i determine, or change, the boot order (MMC, USB, SATA)?

In my imagination, there should be an easy way to just put an image on the SATA SSD (an exact copy of the mmc, for example) and tell the bootloader (or bios or whatever) “you boot from there, from now on”.

Sorry, for possibly noobish questions, i just don’t want to break things :P Every hint is very much appreciated =)

With the instruction of underdogma, i’ve finally installed Debian Sid on my S-ATA SSD.

thx for your answer :) after i found out that the integrated eMMC 4.51 is not the slowest, i will first try to work with S-ATA as pure space supply. nevertheless it is great to know that the formerly intended way actually works :)

Hey I attempted to do the same with the 19-1 and 19-2 versions of L4T respectively - I get an error when attempting to use flash.sh on the sda device.

./flash.sh -S 8GiB jetson-tk1 sda1
copying dtbfile(/mmc1/Linux_for_Tegra/kernel/dtb/tegra124-pm375.dtb) to tegra124-pm375.dtb... done.
copying bctfile(/mmc1/Linux_for_Tegra/bootloader/ardbeg/BCT/PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.cfg) to bct.cfg... done.
copying cfgfile(/mmc1/Linux_for_Tegra/bootloader/ardbeg/cfg/gnu_linux_fastboot_emmc_full.cfg) to flash.cfg... done.
creating gpt(ppt.img)... ./flash.sh: line 994: ./mkgpt: cannot execute binary file: Exec format error
failed.

FYI /mmc1 is actually an SD card.

I have the mmc0 = native storage, mmc1 = sdcard, sda 1,2,3 which is sata hooked up via the on boad sata connector.

Is /mmc1 an SD card mounted on your PC? Is is mounted with “noexec” (running “mount” might tell the options)? “noexec” means that you can’t execute anything on that mount point.

That may have been the case - will check shortly.

I booted up an Ubuntu VM on a Macbook and connected the Jetson in recovery mode. From what I can tell flashing to sda1 is now kernel panicking because of some missing data or an expectected ext2/3/4 partition - originally I partitioned as per the guide from the forums as sda1,sda2,sda3 but it looks more like the system just needs to have a single or double partition made up of the root and perhaps a swap point.

I compiled the drivers and grabbed the firmware for my 3160 per some other folks on here suggested, and right now am writing to the mmc0 to see if this thing works out with the new drives - also added the zram support since we’re limited to the 2GB.

Working on getting pyrit and a good dictionary file for some Pen Testing examples if the wireless drivers actually work out okay.

Will try the sda1 as soon as I’m done confirming that the kernel modules actually load correctly.

Just my 2 cents : allanmac linked me to the “jetson-tk1.conf” file, which also contains a list of root devices

ROOT_DEV="    mmcblk0p1 ---- internal eMMC.
              mmcblk1p1 ---- external SDCARD.
              sda1 --------- external USB devices. (USB memory stick, HDD)
              eth0 --------- nfsroot via RJ45 Ethernet port.
              eth1 --------- nfsroot via USB Ethernet interface.";

afaics, this list contains no entry for internal sata (?)

sda1 work with internal SATA.
I’m actually running debian sid on sata ssd with sda1…

Could you please clarify the following: are you using your SATA SSD drive via USB or via internal SATA port? You said something about an “USB SATA” in the other thread
https://devtalk.nvidia.com/default/topic/747933/embedded-systems/is-it-possible-to-boot-from-sd-or-usb-hdd-and-how-jetson-tk1-/post/4229625/#4229625

If USB as well as internal SATA are adressed with sda1, how is the boot order determined? And how would the flash tool know where to flash, if just “sda1” is specified?

Apologies again for so much questions, i’m really new to both TK1 and linux, i seem not to understand too well ;)

The flash tool doesn’t see the SATA port. All it can see is the onboard. Mind you, I haven’t tried with usb storage.

The current u-boot version doesn’t support booting a kernel directly from SATA.

You CAN boot a kernel from the eMMC and it will understand SATA and USB and be able to mount the root ( / ) filesystem off of them. Typical detection order in the kernel will be SATA then USB. So if you had SATA and USB, the SATA would most likely be sda while the usb would be sdb.

What does hdparm -t /dev/sda tell you about your sata drive performance ?

Finaly, i’ve installed Debian on Internal Sata.
The kernel is stored on the emmc as say by FayneRogue.

This output is from a Samsung 840 EVO 120G running off of the internal SATA port.

root@tegra-ubuntu:~# hdparm -i /dev/sda

/dev/sda:

 Model=Samsung SSD 840 EVO 120GB, FwRev=EXT0AB0Q, SerialNo=S1D5NEAD806784W
 Config={ Fixed }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234441648
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: unknown:  ATA/ATAPI-2,3,4,5,6,7

 * signifies the current active mode
root@tegra-ubuntu:~# hdparm -t /dev/sda

/dev/sda:
 Timing buffered disk reads: 578 MB in  3.00 seconds = 192.53 MB/sec

Not bad for an embedded controller.

Any interest in writing a little step by step guide on getting tk1 to boot off of sata? I am running out of space doing Dev work on a project.

Doc

I would appreciate that, too! :)
Martin

Perhaps useful to know…the list of bootable devices is very important (someone already mentioned it, e.g., mmcblk0p1 is eMMC, mmcblk1p1 is SD), but none of them will show up unless the micro-B USB is connected and the Jetson is started with the recovery button held down. The Jetson then becomes a USB device for use by the flash.sh program on the host. Unless that occurs, the flash.sh cannot succeed.

Permissions are very important, and not optional. Failure to unpack packages on the host as root (e.g., via sudo) will cause failure. Failure to preserve permissions during unpack may cause bizarre behavior. Failure to have /dev/loop0 will cause failure (can be created if it doesn’t exist via losetup --find as root). Failure to flash as root will cause failure.

Once flash.sh is run, the entire file system is created on the host machine and loopback mounted. The file is bootloader/system.img. There is an option to re-use this instead of creating it each time; creating this is the big time consumer. If you build on sda and tell it to make the partition 100GiB, then you will have to create a file 100 GB in size on your host…and have much time to twiddle thumbs while waiting. Should you choose to boot from sda, you don’t necessarily have to make your partition for boot huge…this could still be 14GiB and then remaining hard drive mounted somewhere like /usr/local/.

The ability to pick boot devices and have a menu requires that (a), one boots using the serial console (any other connection will not have access to boot menus), and also that (b) boot loader chosen is u-boot (I could add the requirement of a fast eye, as you don’t have long after power up to hit a button to stop default boot; if you stop u-boot too soon, run the command line “boot” and the boot device choice appears immediately).

fastboot boots exactly to the -k 6 partition, and is not editable after install; u-boot looks in the /boot/ directory, and allows multiple bootable kernels and edit of the boot menu, plus by default picks boot order of external bootable devices first, internal after (I have not used SATA devices personally). Should you have u-boot installed (requires re-flash with the -L option specifically picking bootloader/u-boot.bin instead of bootloader/fastboot.bin) your boot options on serial console are similar to grub and very flexible.

I suggest upgrading from R19.2 to R19.3, and during the upgrade specifying u-boot.

I am using this to build ubuntu on my data… I am stuck with which kernel version to select:

https://help.ubuntu.com/community/Installation/FromLinux

apt-get install grub2-common linux-image #old grub command was obsolete

root@tegra-ubuntu:/# apt-get install grub2-common linux-image
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package linux-image is a virtual package provided by:
linux-image-3.13.0-5-exynos5 3.13.0-5.6
linux-image-3.13.0-8-keystone 3.13.0-8.12
linux-image-3.13.0-7-keystone 3.13.0-7.11
linux-image-3.13.0-6-keystone 3.13.0-6.9
linux-image-3.13.0-32-generic-lpae 3.13.0-32.57
linux-image-3.13.0-32-generic 3.13.0-32.57
linux-image-3.13.0-30-generic-lpae 3.13.0-30.55
linux-image-3.13.0-30-generic 3.13.0-30.55
linux-image-3.13.0-29-generic-lpae 3.13.0-29.53
linux-image-3.13.0-29-generic 3.13.0-29.53
linux-image-3.13.0-27-generic-lpae 3.13.0-27.50
linux-image-3.13.0-27-generic 3.13.0-27.50
linux-image-3.13.0-24-generic-lpae 3.13.0-24.47
linux-image-3.13.0-24-generic 3.13.0-24.47
linux-image-3.4.0-5-chromebook 3.4.0-5.1
linux-image-3.13.0-3-exynos5 3.13.0-3.3
You should explicitly select one to install.

E: Package ‘linux-image’ has no installation candidate

DO i install one of those or try to get one from nvdiia?

bill

You can’t use grub or linux-image packages usually on ARM devices, they are for the X86 world. Embedded ARM devices often has very specific bootloaders and kernels and you need to follow board specific instructions to flash them.

kulve just mentioned grub is not used on Jetson, as embedded does not use this. Addtional info, if you get the L4T distribution, fastboot replaces grub by default; fastboot has no options during boot, it is hardwired. U-boot is optional with L4T, it allows much like GRUB, although you need the serial console to see and use it. U-boot can be flashed during L4T flash if you specify to use this. I highly recommend R19.3’s u-boot.

Once u-boot is installed, you can add new kernels to /boot without flashing, and copy/edit the default entry in /boot/extlinux.conf. The kernel must be the zImage format…whatever comes with other distributions, you’d want to obtain it as kernel source, built it with that configuration on the Jetson, copy it to /boot, and add/edit an entry in extlinux.conf. I currently have 4 kernels (version names added to file name of zImage), depending on what I do, none of which required flash. For various reasons, I also copy the uncompressed vmlinux image and System.map of each kernel version to /boot, but this is not required.