jetson tx1 上安装固态硬盘,并设置从硬盘启动方法

Background

SATA drives are used in many desktop and laptop computers. While this article describes installing aSolid State Disk, this information can be used to install other types of SATA drives. SATA drives are probably the fastest external storage interface to the Jetson TX1, they can be more than twice as fast as USB drives. Also, SATA drives are relatively inexpensive for the amount of storage they hold.

You can simply use the SATA drive as supplemental storage, or choose to use the drive as the root directory of the operating system. This basically means that the system runs from the SATA drive instead of the internal flash (eMMC) memory. The video describes the process to copy the root over from the internal eMMC over to the SATA drive, and then modify the boot process to use the SATA drive as root directory.

This method is a mostly GUI solution, there are command line equivalents that others may use and are more sophisticated. Just be forewarned that if you ask for help, others may speak in ‘CLI‘ language.

An embedded system like the Jetson TX1 uses a different boot sequence than a PC. A PC uses system firmware called a BIOS which is able to easily assign different devices to be the boot device. Embedded systems tend to be simpler and more direct. While there are several different strategies used, the Jetson TX1 uses the extlinux boot loader. By modifying the file extlinux.conf in /boot/extlinux, we can directly control which device and partition are set to be the root directory for Linux.

Installation

Note: The installation on the video was done on a Jetson TX1 running L4T 24.2.1, which was flashed from JetPack 2.3.1.

Because the installation demonstration is using mostly GUI tools, please refer to the video for the walk through. Here are the basic steps:

Make sure that the Jetson is powered down, and attach the SATA drive to the Jetson using a SATA extension cable. Some SSD drives will fit on the Jetson TX1 SATA connector directly. However, this can be rather precarious as the SSD can act as a big lever which when bumped may break off the connector from the TX1 carrier board. Adding a cable minimizes this risk.

With the SATA drive installed, start up the machine.

Format the SATA drive by adding at least one partition with a ext4 format. The partition size must be at least 16GB. There are a couple of ways of doing this, an easy way is to use the Disks application which provides a GUI for formatting disks.

Next, mount the SATA drive. Double clicking the SATA drive icon in the sidebar will mount the SATA drive and open a file browser.

If you are only looking to add external storage to the Jetson, then you are finished.

SATA Drive as Root Directory

On the other hand, if you want to use the SSD as your root directory you copy the contents from the root directory of the internal flash memory to the SATA drive. In the video example:

$ sudo cp -ax / ‘/media/ubuntu/JetsonSSD-256’

copies the root directory to the mounted SSD Drive named ‘JetsonSSD-256’. For a nearly full internal flash memory, this will take about 3 minutes depending on the speed of the SATA drive.

The last setup step is to modify the file extlinux.conf file on the eMMC. The system will boot from the internal eMMC, then the kernel will set the root directory to point to the SATA drive.

First, switch to the extlinux directory:

$ cd /boot/extlinux

Next, make a backup of the existing extlinux configuration:

$ sudo cp extlinux.conf extlinux.conf.original

Now edit the configuration to set up the USB drive:

$ sudo gedit /boot/extlinux/extlinux.conf

An editor will open on the configuration file. Duplicate the eMMC entry (usually named primary), and change the entries as shown in the video. One of the major changes indicates the device and partition, which is:

Internal eMMC

root=/dev/mmcblk0p1

SSD Drive:

root=/dev/sda1

Sample extlinux.conf File

The completed example file shown in the video is:

TIMEOUT 30
DEFAULT satassd

MENU TITLE p2371-2180 eMMC boot options

LABEL satassd
MENU LABEL primary SATA SSD
LINUX /boot/Image
INITRD /boot/initrd
FDT /boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0 root=/dev/sda1 rw rootwait

LABEL emmc
MENU LABEL Internal eMMC
LINUX /boot/Image
INITRD /boot/initrd
FDT /boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait

Make sure to save the file.

Now restart the machine and it will boot to the SATA drive.

Note: If the machine does not boot, hook up a serial console to a host and examine the boot sequence. The entries that you have changed should show up in the boot options.

Once the machine boots, you should run some typical programs or compiles to make sure everything works and is installed correctly. There are some things to watch out for, such as checking to make sure that system level settings for things such as swap files are correct. In general, it is a copy of the internal eMMC, so it should all pretty much behave itself.

Things to Watch Out For

Lions, Tigers, and Bears for starters. Badgers are really mean, be careful of those.

Once past the usual suspects, one thing that you need to be aware of is that if the Jetson can’t see the SATA drive, it will not boot. You may see error messages on the screen or console that it is looking for a boot drive.

If the root SATA drive is not available for some reason, you can use the serial console to select the internal eMMC as the boot device. That will allow you to edit the extlinux.conf file to boot from a different device.

I would advise keeping a bootable SD card around in case something really goes wrong.

If you have changed file system settings (such as those in /etc/fstab, automount, swap files, etc) you will need to revisit the changes to make sure that they are compatible with the new root system.

The SATA drive will usually mount at /dev/sda, which means that USB drives will move up one, i.e. /dev/sda becomes /dev/sdb. The number following the sda (e.g. /dev/sda1) represents the partition.

你可能感兴趣的:(工作经验记录)