TX1给eMMc扩容教程(未实践)

2022-02-09 10:15:36 浏览数 (1)

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:

代码语言:javascript复制
$ 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:

代码语言:javascript复制
$ cd /boot/extlinux

Next, make a backup of the existing extlinux configuration:

代码语言:javascript复制
$ sudo cp extlinux.conf extlinux.conf.original

Now edit the configuration to set up the USB drive:

代码语言:javascript复制
$ 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:

代码语言:javascript复制
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.

相关的关键词是这个

背景

许多台式机和笔记本电脑都使用 SATA 驱动器。虽然本文介绍了安装固态硬盘,但此信息可用于安装其他类型的 SATA 驱动器。SATA 驱动器可能是 Jetson TX1 最快的外部存储接口,它们的速度是 USB 驱动器的两倍多。此外,SATA 驱动器的存储容量相对较低。

您可以简单地使用 SATA 驱动器作为补充存储,或者选择使用该驱动器作为操作系统的根目录。这基本上意味着系统从 SATA 驱动器而不是内部闪存 (eMMC) 内存运行。该视频描述了将根目录从内部 eMMC 复制到 SATA 驱动器的过程,然后修改引导过程以使用 SATA 驱动器作为根目录。

这种方法主要是 GUI 解决方案,有其他人可能使用的命令行等价物,并且更复杂。请预先警告,如果您寻求帮助,其他人可能会说“CLI”语言。

Jetson TX1 等嵌入式系统使用的启动顺序与 PC 不同。PC 使用称为 BIOS 的系统固件,它能够轻松地将不同的设备分配为引导设备。嵌入式系统往往更简单、更直接。虽然使用了几种不同的策略,但 Jetson TX1 使用 extlinux 引导加载程序。通过修改/boot/extlinux中的extlinux.conf文件,我们可以直接控制将哪个设备和分区设置为Linux的根目录。

安装

注意:视频中的安装是在运行 L4T 24.2.1 的 Jetson TX1 上完成的,它是从 JetPack 2.3.1 刷新的。

由于安装演示主要使用 GUI 工具,请参阅视频进行演练。以下是基本步骤:

确保 Jetson 已关闭电源,并使用 SATA 延长线将 SATA 驱动器连接到 Jetson。某些 SSD 驱动器将直接安装在 Jetson TX1 SATA 连接器上。然而,这可能相当不稳定,因为 SSD 可以充当一个大杠杆,当它受到撞击时,可能会从 TX1 载板上断开连接器。添加电缆可将这种风险降至最低。

安装 SATA 驱动器后,启动机器。

通过添加至少一个 ext4 格式的分区来格式化 SATA 驱动器。分区大小必须至少为 16GB。有几种方法可以做到这一点,一个简单的方法是使用磁盘应用程序,它提供了一个用于格式化磁盘的 GUI。

接下来,安装 SATA 驱动器。双击侧栏中的 SATA 驱动器图标将挂载 SATA 驱动器并打开文件浏览器。

如果您只想为 Jetson 添加外部存储,那么您就完成了。

SATA 驱动器作为根目录

另一方面,如果您想将 SSD 用作根目录,请将内容从内部闪存的根目录复制到 SATA 驱动器。在视频示例中:

代码语言:javascript复制
$ sudo cp -ax / ‘/media/ubuntu/JetsonSSD-256’

将根目录复制到名为“JetsonSSD-256”的挂载的 SSD 驱动器。对于几乎满的内部闪存,这将需要大约 3 分钟,具体取决于 SATA 驱动器的速度。

最后一个设置步骤是修改 eMMC 上的文件 extlinux.conf 文件。系统会从内部的 eMMC 启动,然后内核会设置根目录指向 SATA 驱动器。

首先切换到extlinux目录:

代码语言:javascript复制
$ cd /boot/extlinux

接下来,备份现有的 extlinux 配置:

代码语言:javascript复制
$ sudo cp extlinux.conf extlinux.conf.original

现在编辑配置以设置 USB 驱动器:

代码语言:javascript复制
$ sudo gedit /boot/extlinux/extlinux.conf

将在配置文件上打开一个编辑器。复制 eMMC 条目(通常命名为主条目),并如视频所示更改条目。主要变化之一表示设备和分区,即:

确保保存文件。

现在重新启动机器,它将启动到 SATA 驱动器。

注意:如果机器没有启动,将串行控制台连接到主机并检查启动顺序。您更改的条目应显示在引导选项中。

一旦机器启动,您应该运行一些典型的程序或编译以确保一切正常并正确安装。有一些事情需要注意,例如检查以确保交换文件等内容的系统级设置是正确的。一般来说,它是内部 eMMC 的副本,所以它应该几乎都表现得很好。

需要注意的事项

首先是狮子,老虎和熊。獾真的很卑鄙,小心那些。

一旦排除了常见的嫌疑,您需要注意的一件事是,如果 Jetson 看不到 SATA 驱动器,它将无法启动。您可能会在屏幕或控制台上看到它正在寻找引导驱动器的错误消息。

如果根SATA驱动器由于某种原因不可用,您可以使用串行控制台选择内部eMMC作为启动设备。这将允许您编辑 extlinux.conf 文件以从不同的设备启动。

我建议保留一张可启动的 SD 卡,以防万一真的出现问题。

如果您更改了文件系统设置(例如 /etc/fstab、自动挂载、交换文件等中的设置),您将需要重新访问这些更改以确保它们与新的根系统兼容。

SATA 驱动器通常会挂载在 /dev/sda,这意味着 USB 驱动器会向上移动一个,即 /dev/sda 变为 /dev/sdb。sda 后面的数字(例如 /dev/sda1)代表分区。

0 人点赞