Difference between revisions of "APITestPage"

From FriendlyARM WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
Line 1: Line 1:
===Android下使用SSD固态硬盘===
+
===Using SSD on Android===
====第一步:格式化SSD为单分区ext4格式====
+
====Step1: Format SSD as ext4====
'''此操作可以在电脑上进行,也可以在开发板的 linux 系统里进行。'''<br /><br />
+
'''These steps need to be operated under the LINUX system. '''<br /><br />
为了方便操作,请在终端上先用以下命令切换为 root 用户:<br />
+
For the convenience of operation, please switch to the root user with the following command on the terminal:<br />
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
su -
+
Su -
 
</syntaxhighlight>
 
</syntaxhighlight>
root用户的默认密码是fa。
+
The default password for the root user is fa.
  
=====检查是否检测到了SSD=====
+
=====Detection of SSD=====
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
root@FriendlyELEC:~# cat /proc/partitions  
 
root@FriendlyELEC:~# cat /proc/partitions  
Line 15: Line 15:
 
  259        0  125034840 nvme0n1
 
  259        0  125034840 nvme0n1
 
</syntaxhighlight>
 
</syntaxhighlight>
看到有 nvme0n1 设备的节点,说明SSD已经成功被识别到了。
+
If there is a nvme0n1 device node it means an SSD is recognized.
  
=====给SSD重新分区=====
+
=====Partition of SSD=====
为了让 Linux 系统能成功能挂载,我们选择给 SSD 重新分区,下面的命令会自动将 SSD 整个空间分成一个区:
+
To mount an SSD under Linux we re-partition it as one section by running the following command:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
(echo o; echo n; echo p; echo 1; echo ""; echo ""; echo w; echo q) | fdisk /dev/nvme0n1
 
(echo o; echo n; echo p; echo 1; echo ""; echo ""; echo w; echo q) | fdisk /dev/nvme0n1
 
</syntaxhighlight>
 
</syntaxhighlight>
如果要分多个区,可以用 fdisk /dev/nvme0n1 命令,参考 fdisk的文档来操作。
+
If you want to re-partition it to multiple sections you can run "fdisk /dev/nvme0n1". For more detail about this command refer to the fdisk's manual.
  
=====将分区格式化为 ext4 格式=====
+
=====Format partition to EXT4=====
上一个步骤分区完成后,我们再用 cat /proc/partitions 命令看一下当前的分区信息,在下面的结果中,可用于存储数据的分区设备名为 /dev/nvme0n1p1 :
+
After an SSD is successfully partitioned you can check its partitions by running "cat /proc/partitions". The /dev/nvme0n1p1 partition is used to store data:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
root@FriendlyELEC:~# cat /proc/partitions
 
root@FriendlyELEC:~# cat /proc/partitions
Line 35: Line 35:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
<br />
 
<br />
下面的命令将该分区格式化为 ext4 格式,其中-L参数指定SSD分区的名称,这个名称会在Android界面上显示:
+
The following command formats a section to ext4:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
mkfs.ext4 /dev/nvme0n1p1 -L SSD
 
mkfs.ext4 /dev/nvme0n1p1 -L SSD
 
</syntaxhighlight>
 
</syntaxhighlight>
  
====第二步:Android开机自动挂载====
+
====Step2: Auto Mount SSD on Android System Startup====
只要SSD已经被正确地格式化,Android就会自动挂载SSD为外置存储设备,无需额外的设置,打开Android内置的Files应用,可以看到SSD设备已经挂载:<br />
+
Android will automatically mount the SSD as an external storage device. No additional settings are required. Open the built-in Files application of Android and you can see that the SSD device is mounted:<br />
 
[[File:android8-files-ssd.jpg|frameless|600px]]<br />
 
[[File:android8-files-ssd.jpg|frameless|600px]]<br />
第三方的软件可以正常识别SSD,如下图中的迅雷下载软件,可以设置将文件默认下载到SSD上:<br />
+
third-party software can recognize SSDs normally.<br />
[[File:android8-thunder-ssd.png|frameless|500px]]<br />
+

Revision as of 07:44, 21 May 2019

1 Using SSD on Android

1.1 Step1: Format SSD as ext4

These steps need to be operated under the LINUX system.

For the convenience of operation, please switch to the root user with the following command on the terminal:

Su -

The default password for the root user is fa.

1.1.1 Detection of SSD
root@FriendlyELEC:~# cat /proc/partitions 
major minor  #blocks  name
   1        0       4096 ram0
 259        0  125034840 nvme0n1

If there is a nvme0n1 device node it means an SSD is recognized.

1.1.2 Partition of SSD

To mount an SSD under Linux we re-partition it as one section by running the following command:

(echo o; echo n; echo p; echo 1; echo ""; echo ""; echo w; echo q) | fdisk /dev/nvme0n1

If you want to re-partition it to multiple sections you can run "fdisk /dev/nvme0n1". For more detail about this command refer to the fdisk's manual.

1.1.3 Format partition to EXT4

After an SSD is successfully partitioned you can check its partitions by running "cat /proc/partitions". The /dev/nvme0n1p1 partition is used to store data:

root@FriendlyELEC:~# cat /proc/partitions
major minor  #blocks  name
 
   1        0       4096 ram0
 259        0  125034840 nvme0n1
 259        2  125033816 nvme0n1p1


The following command formats a section to ext4:

mkfs.ext4 /dev/nvme0n1p1 -L SSD

1.2 Step2: Auto Mount SSD on Android System Startup

Android will automatically mount the SSD as an external storage device. No additional settings are required. Open the built-in Files application of Android and you can see that the SSD device is mounted:
Android8-files-ssd.jpg
third-party software can recognize SSDs normally.