资讯动态

rk3568 nvme硬盘分区,格式化,挂载测试

发布时间:2026/10/2 19:36:59 来源:尧图企业网站定制
前言环境介绍1.编译环境Ubuntu 18.04.5 LTS2.SDKrk356x_linux3.单板迅为itop-3568开发板 自制底板一、查看硬盘插上硬盘上电进入系统后通过命令lspci查看nvme硬盘识别情况[rootRK356X:/]# lspci -k21:00.0 Class 0108: 1e4b:1202 nvme20:00.0 Class 0604: 1d87:3566 pcieport[rootRK356X:/]#可以看到能正常识别到nvme设备21:00.0 Class 0108: 1e4b:1202 nvme二、查看分区在/dev下面查看硬盘分区情况[rootRK356X:/]# ls /dev/nvme0nvme0 nvme0n1可以看到nvme硬盘已经分好一个区了nvme0n1要是还想分区可以通过fdisk进行分区。[rootRK356X:/]# fdisk /dev/nvme0n1Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT disklabel Building a new DOS disklabel. Changes will remaininmemory only,untilyou decide towritethem. After that the previous content wont be recoverable. The number of cylinders for this disk is set to 488386. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): m Command Action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partitions systemidu change display/entryunitsvverify the partition table wwritetable to disk andexitx extra functionality(experts only)这里制作测试一个区够用不再进行分区。分好区后可以通过fdisk -l查看分区情况[rootRK356X:/]# fdisk -lFound valid GPT with protective MBR;using GPT Disk /dev/mmcblk0:30547968sectors, 2628M Logical sector size:512Disk identifier(GUID): f4420000-0000-426c-8000-368900004ad5 Partition table holds up to128entries First usable sector is34, last usable sector is30547934Number Start(sector)End(sector)Size Name116384245754096K uboot224576327674096K misc33276816383964.0M boot416384029491164.0M recovery529491236044732.0M backup63604482552627112.0G rootfs72552627225919487192M oem825919488305479032259M userdata Disk /dev/nvme0n1:477GB,512110190592bytes,1000215216sectors488386cylinders,64heads,32sectors/track Units: sectors of1*512512bytes Disk /dev/nvme0n1 doesnt contain a valid partition table[rootRK356X:/]#这是识别到的nvme盘信息就一个分区。Disk /dev/nvme0n1: 477 GB, 512110190592 bytes, 1000215216 sectors488386 cylinders, 64 heads, 32 sectors/trackUnits: sectors of 1 * 512 512 bytes三、格式化硬盘分好区后要格式化才能正常挂载系统自带了格式化工具mkfs.ext4可以直接使用。[rootRK356X:/]# mkfs.ext4 /dev/nvme0n1mke2fs1.46.5(30-Dec-2021)/dev/nvme0n1 contains a ext4filesystem last mounted on Thu Jan108:15:211970Proceed anyway?(y,N)y Discarding device blocks:doneCreating filesystem with1250269024k blocks and31260672inodes Filesystem UUID: 19d88471-cbb2-4cc6-a39f-f5d0c776607e Superblock backups stored on blocks:32768,98304,163840,229376,294912,819200,884736,1605632,2654208,4096000,7962624,11239424,20480000,23887872,71663616,78675968,102400000Allocating group tables:doneWriting inode tables:doneCreating journal(262144blocks):doneWriting superblocks and filesystem accounting information:done[rootRK356X:/]#四、 挂载直接mount就行[rootRK356X:/]# mount /dev/nvme0n1 /mnt[4152.556192]EXT4-fs(nvme0n1): mounted filesystem with ordered data mode. Opts[rootRK356X:/]# : (null)[rootRK356X:/]# ls /mnt/lostfound[rootRK356X:/]#查看系统挂载情况[rootRK356X:/]# df -THFilesystem Type Size Used Avail Use% Mounted on /dev/root ext4 13G 844M 12G7% / devtmpfs devtmpfs1.1G01.1G0% /dev tmpfs tmpfs1.1G01.1G0% /dev/shm tmpfs tmpfs1.1G 263k1.1G1% /tmp tmpfs tmpfs1.1G 300k1.1G1% /run /dev/mmcblk0p7 ext2 193M 13M 170M7% /oem /dev/mmcblk0p8 ext22.4G 26k2.4G1% /userdata /dev/nvme0n1 ext4 503G 29k 478G1% /mnt[rootRK356X:/]#五、速度测试10G 写入测试time-pbash-cdd if/dev/zero of/mnt/dd.log bs1M count10240

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑