Difference between revisions of "PCIe TO M.2 (B)"
From Waveshare Wiki
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=== | ||
− | * | + | *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. |
[[file:PCIe TO M.2 (B)_1.png]] | [[file: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. | |
[[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> | ||
− | + | 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]] | ||
− | * | + | *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]] | ||
− | * | + | *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
| ||
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.
- 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.
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\>
- 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
- Copying hard drive content to Raspberry Pi Memory (Write)
sudo dd if=./test_write of=/dev/null count=2000 bs=1024k
- Note: the test result may vary due to different adapters and environments, and the Raspberry Pi is more susceptible.