固态硬盘选型
目前测试可用的是雷克沙(Lexar) PLAY 1TB SSD 固态硬盘 2230 M.2接口
固态硬盘安装
New NVMe SSDs are not partitioned and will need to be both partitioned and formatted when first connected to the Raspberry Pi before they will be accessed in the Explorer.
树莓派系统配置
Enable the external PCIe port on the Raspberry Pi 5. Edit /boot/firmware/config.txt and add the following at the bottom:
1 2 3 4 5 6 7 8 |
# Add to bottom of /boot/firmware/config.txt dtparam=pciex1 # Note: You could also just add the following (it is an alias to the above line) # dtparam=nvme # Optionally, you can control the PCIe lane speed using this parameter # dtparam=pciex1_gen=3 |
修改后的完整内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# For more options and information see # http://rptl.io/configtxt # Some settings may impact device functionality. See link above for details # Uncomment some or all of these to enable the optional hardware interfaces #dtparam=i2c_arm=on #dtparam=i2s=on #dtparam=spi=on # Enable audio (loads snd_bcm2835) dtparam=audio=on # Additional overlays and parameters are documented # /boot/firmware/overlays/README # Automatically load overlays for detected cameras camera_auto_detect=1 # Automatically load overlays for detected DSI displays display_auto_detect=1 # Automatically load initramfs files, if found auto_initramfs=1 # Enable DRM VC4 V3D driver dtoverlay=vc4-kms-v3d max_framebuffers=2 # Don't have the firmware create an initial video= setting in cmdline.txt. # Use the kernel's default instead. disable_fw_kms_setup=1 # Run in 64-bit mode arm_64bit=1 # Disable compensation for displays with overscan disable_overscan=1 # Run as fast as firmware / board allows arm_boost=1 # Add to bottom of /boot/firmware/config.txt dtparam=pciex1 # Note: You could also just add the following (it is an alias to the above line) # dtparam=nvme # Optionally, you can control the PCIe lane speed using this parameter # dtparam=pciex1_gen=3 [cm4] # Enable host mode on the 2711 built-in XHCI USB controller. # This line should be removed if the legacy DWC2 controller is required # (e.g. for USB device mode) or if USB support is not required. otg_mode=1 [cm5] dtoverlay=dwc2,dr_mode=host [all] |
开机自动挂载
查看磁盘分区:
1 2 3 4 |
$ sudo blkid /dev/nvme0n1: UUID="e44ae3a2-c125-4556-85be-477de8b37b17" UUID_SUB="471348fa-abac-44af-8c1f-fbf6d9bf6dd4" BLOCK_SIZE="4096" TYPE="btrfs" /dev/mmcblk0p1: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="5DC7-F115" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="2a8ca32a-01" /dev/mmcblk0p2: LABEL="rootfs" UUID="a36be96c-66be-4487-a7a6-0481bca99d89" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="2a8ca32a-02" |
增加挂载项:
1 2 3 4 5 6 7 8 |
$ cat /etc/fstab proc /proc proc defaults 0 0 PARTUUID=2a8ca32a-01 /boot/firmware vfat defaults 0 2 PARTUUID=2a8ca32a-02 / ext4 defaults,noatime 0 1 # a swapfile is not a swap partition, no line here # use dphys-swapfile swap[on|off] for that UUID=e44ae3a2-c125-4556-85be-477de8b37b17 /data btrfs defaults,noatime 0 2 |