工业网关/路由器中的SD卡的识别、挂载、读写性能是如何检测的

mcg0312
mcg0312 This guy is lazy,Introduction has not been set

0 People liked this article · 4355 views

工业网关和工业路由器中,经常用到SD卡,SD卡的识别、挂载、读写性能是如何检测的呢?有哪些检测命令?一起来学习一下吧:

1.插入SD卡到工业路由器的SD卡槽中,确认SD卡是否被识别。

2.使用命令查看SD卡的分区情况,命令:fdisk -l

如果SD卡已经被分区,会显示SD卡的分区信息。

3.使用命令创建/etc/fstab文件:touch /etc/fstab

/etc/fstab文件是用于存储文件系统挂载信息的文件。

4.使用命令创建/mnt/sdcard目录,命令:mkdir /mnt/sdcard

挂载文件系统时,需要指定一个已经存在的目录作为挂载点。

5.使用命令挂载SD卡,命令:mount /dev/mmcblk0p1 /mnt/sdcard

其中,/dev/mmcblk0p21SD卡的分区设备名,/mnt/sdcard为挂载点。

6.使用命令查看SD卡的挂载情况,命令:df -h

7.使用命令测试SD卡的读写性能,命令:dd if=/dev/zero of=/mnt/sdcard/testfile bs=1M count=100

其中,if为输入文件,of为输出文件,bs为块大小,count为块数,本命令将在SD卡的/mnt/sdcard目录下创建一个大小为100MB的文件。

8.使用命令测试SD卡的读取性能,命令:dd if=/mnt/sdcard/testfile of=/dev/null bs=1M

本命令将从SD卡的/mnt/sdcard目录下读取testfile文件,并将其输出到/dev/null中,测试SD卡的读取性能。

9.使用命令删除测试文件,命令:rm /mnt/sdcard/testfile

10.使用命令卸载SD卡,命令:umount /mnt/sdcard

其中,/mnt/sdcard为SD卡的挂载点。执行该命令后,系统会将SD卡从/mnt/sdcard目录下卸载,此时可以安全地将SD卡从设备中取出。

Published on 2023-07-07 01:46

Disclaimers:

This document is written by mcg0312 Original published on 技术社区 ,The copyright belongs to the author。

Log in,More exciting content waiting for you to find,Contribute wonderful answers,Participate in comment interaction

go Sign in! No accountgoregister