Difference between revisions of "PCIe TO M.2 (B)"

From Waveshare Wiki
Jump to: navigation, search
Line 16: Line 16:
 
*Compatible With M.2 Solid State Drive in different sizes.
 
*Compatible With M.2 Solid State Drive in different sizes.
 
*The LED lights up when power-on, and keeps blinking while reading/writing
 
*The LED lights up when power-on, and keeps blinking while reading/writing
 
<!--
 
 
=User Guide=
 
=User Guide=
 
 
==Mounting a Hard Driver to CM4==
 
==Mounting a Hard Driver to CM4==
 
===Format===
 
===Format===
*将硬盘插入PCI-E转M.2转接卡对应的位置,并用螺丝包里的螺丝进行固定。<br/>
+
*Insert the SSD into the corresponding slot of the PCI-E to M.2 adapter, and secure it with the screws provided in the screw package.
*上电启动之后,执行lspci 检查PCIE设备
+
*After powering up and booting, execute "lspci" to check the PCIE device.
 
  [[file:PCIe TO M.2 (B)_1.png]]
 
  [[file:PCIe TO M.2 (B)_1.png]]
*执行sudo mkfs.ext4 /dev/nvme0n1p1 格式化设备( mkfs.然后按tab 可以看到很多种不同的后缀名,不同的后缀名就是你需要想要格式化的格式) 
+
*Execute "sudo mkfs.ext4 /dev/nvme0n1p1" to format the device. ("Type 'mkfs.' and then press the "tab" key to see various suffixes representing different formats you can use for formatting.) "mkfs.  
  等待片刻,当done都出现完毕后,意味着格式化已经进行完毕。
+
  Wait for a few moments, when "done" appears, it means that the formatting has been carried out.
 
  [[file:PCIe TO M.2 HAT+_W_4.png]]
 
  [[file:PCIe TO M.2 HAT+_W_4.png]]
  
===挂载===
+
===Mount===
  创建挂载目录
+
  Create a mounting directory
 
  sudo mkdir toshiba
 
  sudo mkdir toshiba
  挂载设备
+
  Mount the device
 
  sudo mount /dev/nvme0n1p1 ./toshiba
 
  sudo mount /dev/nvme0n1p1 ./toshiba
  检查磁盘状态
+
  Check the disk status
 
  df -h
 
  df -h
  
===挂载硬盘===
+
===Mount the hard drive===
*新建一个目录作为磁盘挂载点
+
*Create a new directory as the mount point for the disk.
 
<pre>
 
<pre>
 
sudo mkdir /home/pi/toshiba
 
sudo mkdir /home/pi/toshiba
 
</pre>
 
</pre>
*执行以下指令挂载硬盘
+
*Execute the following commands to mount the hard drive: 
 
<pre>
 
<pre>
 
sudo mount /dev/nvme0n1p1  /home/pi/toshiba
 
sudo mount /dev/nvme0n1p1  /home/pi/toshiba
 
</pre>
 
</pre>
再次执行
+
Execute again:
 
<pre>
 
<pre>
 
df -h
 
df -h
 
</pre>
 
</pre>
便可以看到我们插入的硬盘以及相关信息,说明硬盘已经挂载成功<br\>
+
Then you can see the hard drive we inserted and the related information, indicating that it has been mounted successfully.<br\>
 
[[File:pcie-m2-4.png|800px]]
 
[[File:pcie-m2-4.png|800px]]
*对于不同的硬盘,其名字是不同的,我这里是显示nvme0n1p1,请以你插入的硬盘为准。
+
*For different hard drives, their names are different, and here is "nvme0n1p1", please refer to the hard drive you inserted.
  
===读写测试===
+
===Reading/writing Test ===
进入挂载磁盘的目录
+
Enter the directory to mount the hard drive: 
 
<pre>
 
<pre>
 
cd /home/pi/toshiba
 
cd /home/pi/toshiba
 
</pre>
 
</pre>
*释放内存
+
*Release caches:
 
<pre>
 
<pre>
 
sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"
 
sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"
 
</pre>
 
</pre>
*拷贝树莓派内存内容到硬盘 (读)
+
*Copying the contents of the Raspberry Pi's memory to the hard drive (Read):
 
<pre>
 
<pre>
 
sudo dd if=/dev/zero of=./test_write count=2000 bs=1024k
 
sudo dd if=/dev/zero of=./test_write count=2000 bs=1024k
 
</pre>
 
</pre>
 
[[File:pcie-m2-5.png|800px]]
 
[[File:pcie-m2-5.png|800px]]
*拷贝硬盘内容到树莓派内存 (写)
+
*Copying hard drive content to Raspberry Pi Memory (Write)
 
<pre>
 
<pre>
 
  sudo dd if=./test_write of=/dev/null count=2000 bs=1024k
 
  sudo dd if=./test_write of=/dev/null count=2000 bs=1024k
 
</pre>
 
</pre>
 
[[File:pcie-m2-6new.png|800px]]
 
[[File:pcie-m2-6new.png|800px]]
*注意:不同的卡以及环境 测试效果不同  树莓派受到的影响比较大<br/>
+
*Note: the test result may vary due to different adapters and environments, and the Raspberry Pi is more susceptible.<br/>
-->
 

Revision as of 03:09, 22 March 2024

PCIe TO M.2 (B)
PCIe TO M.2 (B).jpg
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

PCIe TO M.2 (B) for Raspberry Pi 5, for upgrading Solid State Drive, supports CM4.

Features

  • Support NVMe protocol M.2 interface Solid State Drive protocol, high-speed write/read, higher working efficiency.
  • Only support CM4 HAT.
  • Supports Raspberry Pi Compute Module 4.
  • Compatible With M.2 Solid State Drive in different sizes.
  • The LED lights up when power-on, and keeps blinking while reading/writing

User Guide

Mounting a Hard Driver to CM4

Format

  • Insert the SSD into the corresponding slot of the PCI-E to M.2 adapter, and secure it with the screws provided in the screw package.
  • After powering up and booting, execute "lspci" to check the PCIE device.
PCIe TO M.2 (B) 1.png
  • Execute "sudo mkfs.ext4 /dev/nvme0n1p1" to format the device. ("Type 'mkfs.' and then press the "tab" key to see various suffixes representing different formats you can use for formatting.) "mkfs.
Wait for a few moments, when "done" appears, it means that the formatting has been carried out. 
PCIe TO M.2 HAT+ W 4.png

Mount

Create a mounting directory
sudo mkdir toshiba
Mount the device
sudo mount /dev/nvme0n1p1 ./toshiba
Check the disk status
df -h

Mount the hard drive

  • Create a new directory as the mount point for the disk.
sudo mkdir /home/pi/toshiba
  • Execute the following commands to mount the hard drive:
sudo mount /dev/nvme0n1p1  /home/pi/toshiba

Execute again:

df -h

Then you can see the hard drive we inserted and the related information, indicating that it has been mounted successfully.<br\> Pcie-m2-4.png

  • For different hard drives, their names are different, and here is "nvme0n1p1", please refer to the hard drive you inserted.

Reading/writing Test

Enter the directory to mount the hard drive:

cd /home/pi/toshiba
  • Release caches:
sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"
  • Copying the contents of the Raspberry Pi's memory to the hard drive (Read):
sudo dd if=/dev/zero of=./test_write count=2000 bs=1024k

Pcie-m2-5.png

  • Copying hard drive content to Raspberry Pi Memory (Write)
 sudo dd if=./test_write of=/dev/null count=2000 bs=1024k

Pcie-m2-6new.png

  • Note: the test result may vary due to different adapters and environments, and the Raspberry Pi is more susceptible.