8,367
edits
Changes
→Method of burning using dd command
<li><p>Please ensure that the SPI Flash is affixed to the development board. The position of SPI Flash on the development board is shown in the figure below. No other Settings are required before burning</p>
<p>[[File:cm4-img74.png]]</p></li>
<li><p>Burning Linux image to SPIFlash+NVMe SSD requires TF card to complete, so first need to burn Linux image to TF card, and then use the TF card to start the development board into the Linux system. For the method of burning a Linux image to a TF card, see the two sections on [[\lOrange Pi CM4#Method of burning Linux image to TF card based on Windows PC|'''the method of burning a Linux image to a TF card''' '''based on a Windows PC''']] and '''[[\lOrange Pi CM4#Method of burning Linux image to TF card based on Ubuntu PC|the method of burning a Linux image to a TF card based on an Ubuntu PC]].'''</p></li>
<li><p>After starting the Linux system with TF card, we first burn the u-boot image into SPI Flash</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Run '''nand-sata-install'''l first. '''<span style="color:#FF0000">Ordinary users remember to > add sudo permission</span>'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p>|}</li><li><p>Then select '''7 Install/Update ther bootloader on SPI Flash'''</p></li></ol></li></ol>
<div class="figure">
[[File:cm4-img84.png]]
</div></ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Then select '''<Yes>'''</li></ol>
<div class="figure">
[[File:cm4-img85.png]]
</div></ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then please wait patiently for the burning to complete, after the > burning is completed, it will be displayed as follows (a '''Done''' > will be displayed in the lower left corner) :</li></ol>
<div class="figure">
[[File:cm4-img86.png]]
</div></ol></li></ol>
<ol start="6" style="list-style-type: decimal;">
<li><p>Then upload the Linux image file (Debian or Ubuntu image downloaded from the official website) to the TF card. For details about how to upload a Linux image file to the development board, see section [[\lOrange Pi CM4#Method of uploading files to the development board Linux system|'''Uploading Files to the Linux system on the Development Board''']].</p></li>
<li><p>After uploading the image to the Linux system of the development board, we can enter the storage path of the image file in the command line of the Linux system of the development board. For example, I saved the Linux image of the development board in the directory '''/home/orangepi/Desktop'''. Then go to the '''/home/orangepi/Desktop''' directory and you will see the uploaded image file.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''cd /home/orangepi/Desktop'''</p>
<p>orangepi@orangepi:~/Desktop$ '''ls'''</p>
<p>Orangepi3b_x.x.x_debian_bullseye_desktop_xfce_linux5.10.160.img</p>
|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''How to enter the development board Linux system command line?'''</p><p>'''1. For details about how to log in to the terminal through the serial port, see section [[\lOrange Pi CM4#How to use the debugging serial port|Debugging Serial Port]].'''</p><p>'''2. For details about how to remotely log in to the Linux operating system over ssh, see section "[[\lOrange Pi CM4#SSH remote login development board|Logging In to the Development Board over SSH]]".'''</p><p>'''3. If you are connected to a display screen such as HDMI or LCD, you can open a command line terminal on the desktop.'''</p></big>|}</li>
<li><p>Next, let's first make sure that NVMe SSD has been properly recognized by Linux development board. If the NVMe SSD is correctly identified, run the '''sudo fdisk -l''' command to view information about the '''nvme'''</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~/Desktop$ '''sudo fdisk -l | grep "nvme0n1"'''</p>
<p>Disk /dev/nvme0n1: 1.86 TiB, 2048408248320 bytes, 4000797360 sectors</p>
|}
<p>Use the '''lspci''' command to see an NVME-related PCI device</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~/Desktop$ '''lspci'''</p>
<p>00:00.0 PCI bridge: Fuzhou Rockchip Electronics Co., Ltd Device 3566 (rev 01)</p>
<p>01:00.0 Non-Volatile memory controller: Realtek Semiconductor Co., Ltd. Device 5765 (rev 01)</p>|}</li>
<li><p>Then we can use the dd command to empty the NVMe SSD (optional)</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi3b:~/Desktop$ '''sudo dd bs=1M if=/dev/zero of=/dev/nvme0n1 count=2000 status=progress'''</p>
<p>orangepi@orangepi3b:~/Desktop$ '''sudo sync'''</p>|}</li>
<li><p>You can then use the dd command to burn the Linux image of the development board into the NVMe SSD</p>
<ol style="list-style-type: lower-alpha;">
<li><p>if = parameter in the command is to fill in behind the Linux + > Linux mirror image to store the full path name (such > as'''<span class="mark">/home/orangepi/Desktop/Linux image name</span>'''). Since > we have entered the path of the Linux image above, we only > need to fill in the name of the Linux image.</p></li><li><p>Do not copy the Linux image name in the following command. > Replace it with the actual image name (because the version of > the image may be updated).</p>{| class="wikitable" style="width:800px;" |-|
<p>'''sudo dd bs=1M if=Orangepi3b_x.x.x_debian_bullseye_desktop_xfce_linux5.10.160.img of=/dev/nvme0n1 status=progress'''</p>
<p>'''sudo''' '''sync'''</p>
|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''<span style="color:#FF0000">Note that if you are uploading a.7z or.xz or.gz Linux image file, remember to decompress it before burning it with the dd command.</span>'''</p><p>'''A detailed description of all the parameters of the dd command and more usage can be seen by running the man dd command on Linux.'''</p></big>|}</li></ol>
</li>
<li><p>After successfully burning the Linux image of the development board to the NVMe SSD, you can use the '''poweroff''' command to shut down. Then, pull out the TF card, press the power button again, and then start the Linux system in the SPIFlash+NVMe SSD.</p></li>
<ol style="list-style-type: lower-alpha;">
<li><p>128GB NVMe SSD</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''df -h'''</p>
<pspan style="margin-right: 80px;">Filesystem </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 30px;">Used </span><span style="margin-right: 30px;">Avail </span><span style="margin-right: 50px;">Use% Mounted on</pspan><br><pspan style="margin-right: 110px;">udev </span><span style="margin-right: 60px;">3.8G </span><span style="margin-right: 50px;">8.0K </span><span style="margin-right: 70px;">3.8G </span><span style="margin-right: 90px;">1% /dev</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 50px;">769M </span><span style="margin-right: 30px;">1.4M </span><span style="margin-right: 70px;">768M </span><span style="margin-right: 90px;">1% /run</pspan><br><pspan style="margin-right: 25px;color:#FF0000">'''/dev/nvme0n1p2 '''</span><span style="margin-right: 50px;color:#FF0000">'''118G '''</span><span style="margin-right: 35px;color:#FF0000">'''5.8G '''</span><span style="margin-right: 80px;color:#FF0000">'''111G '''</span><span style="margin-right: 90px;color:#FF0000">'''5% /'''</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">3.8G </span><span style="margin-right: 50px;">0 </span><span style="margin-right: 50px;">3.8G </span><span style="margin-right: 90px;">0% /dev/shm</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">5.0M </span><span style="margin-right: 50px;">4.0K </span><span style="margin-right: 50px;">5.0M </span><span style="margin-right: 90px;">1% /run/lock</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">3.8G </span><span style="margin-right: 50px;">16K </span><span style="margin-right: 50px;">3.8G </span><span style="margin-right: 90px;">1% /tmp</pspan><br><pspan style="margin-right: 25px;color:#FF0000">'''/dev/nvme0n1p1 '''</span><span style="margin-right: 50px;color:#FF0000">'''256M '''</span><span style="margin-right: 35px;color:#FF0000">'''90M '''</span><span style="margin-right: 80px;color:#FF0000">'''166M '''</span><span style="margin-right: 90px;color:#FF0000">'''36% /boot'''</pspan><br><pspan style="margin-right: 65px;">/dev/zram1 </span><span style="margin-right: 60px;">194M </span><span style="margin-right: 50px;">9.9M </span><span style="margin-right: 50px;">170M </span><span style="margin-right: 90px;">6% /var/log</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">769M </span><span style="margin-right: 50px;">60K </span><span style="margin-right: 50px;">769M </span><span style="margin-right: 90px;">1% /run/user/1000</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">769M </span><span style="margin-right: 50px;">48K </span><span style="margin-right: 50px;">769M </span><span style="margin-right: 90px;">1% /run/user/0</pspan><br>|}</li>
<li><p>2TB NVMe SSD</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''df -h'''</p>
<pspan style="margin-right: 80px;">Filesystem </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 30px;">Used </span><span style="margin-right: 30px;">Avail </span><span style="margin-right: 50px;">Use% Mounted on</pspan><br><pspan style="margin-right: 110px;">udev </span><span style="margin-right: 60px;">3.8G </span><span style="margin-right: 50px;">8.0K </span><span style="margin-right: 70px;">3.8G </span><span style="margin-right: 90px;">1% /dev</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 50px;">769M </span><span style="margin-right: 30px;">1.4M </span><span style="margin-right: 70px;">768M </span><span style="margin-right: 90px;">1% /run</pspan><br><pspan style="margin-right: 25px;color:#FF0000">'''/dev/nvme0n1p2 '''</span><span style="margin-right: 50px;color:#FF0000">'''1.9T '''</span><span style="margin-right: 35px;color:#FF0000">'''4.1G '''</span><span style="margin-right: 80px;color:#FF0000">'''1.8T '''</span><span style="margin-right: 90px;color:#FF0000">'''1% /'''</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">3.8G </span><span style="margin-right: 50px;">0 </span><span style="margin-right: 50px;">3.8G </span><span style="margin-right: 90px;">0% /dev/shm</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">5.0M </span><span style="margin-right: 50px;">4.0K </span><span style="margin-right: 50px;">5.0M </span><span style="margin-right: 90px;">1% /run/lock</pspan><br><pspan style="margin-right: 65px;">/dev/zram2 </span><span style="margin-right: 60px;">3.7G </span><span style="margin-right: 50px;">76K </span><span style="margin-right: 50px;">3.5G </span><span style="margin-right: 90px;">1% /tmp</pspan><br><pspan style="margin-right: 25px;color:#FF0000">'''/dev/nvme0n1p1 '''</span><span style="margin-right: 50px;color:#FF0000">'''256M '''</span><span style="margin-right: 35px;color:#FF0000">'''90M '''</span><span style="margin-right: 80px;color:#FF0000">'''166M '''</span><span style="margin-right: 90px;color:#FF0000">'''36% /boot'''</pspan><br><pspan style="margin-right: 65px;">/dev/zram1 </span><span style="margin-right: 60px;">194M 15M 165M </span><span style="margin-right: 50px;">9.9M </span><span style="margin-right: 50px;">170M </span><span style="margin-right: 90px;">6% /var/log</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">769M </span><span style="margin-right: 50px;">60K </span><span style="margin-right: 50px;">769M </span><span style="margin-right: 90px;">1% /run/user/1000</pspan><br><pspan style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">769M </span><span style="margin-right: 50px;">48K </span><span style="margin-right: 50px;">769M </span><span style="margin-right: 90px;">1% /run/user/0</pspan><br>|}</li></ol>
</li>
<li><p>When the TF card and NVMe SSD burn exactly the same system, '''if the TF card and NVMe SSD are inserted in the development board, power on the development board at this time, u-boot will give priority to start the system in the TF card.''' However, since the TF card and the NVMe SSD system are identical, the UUID of the /'''boot''' partition and '''rootfs''' partition in the two storage devices are the same, which will cause the TF card may load the NVMe SSD partition when it is started. Run the following script to solve this problem.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo fix_mmc_ssd.sh'''</p>
|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''An identical system means that the mirror name is exactly the same. Even if it is a Debian11 system, the version is different.'''</p></big>|}</li></ol>
<span id="method-of-burning-using-balenaetcher-software"></span>
=== Method of burning using balenaEtcher software ===