pve 开机自动挂载exfat分区

pve已经内置了exfat支持,直接挂载即可。 其他linux内建支持的分区格式用同样方法挂载即可。nfts格式的话需要先apt install ntfs-3g 先手动挂载

1
2
3
4
5
6
7
8
# 查看分区
fdisk -l
# 目标分区  /dev/nvme0n1p3 
# 挂载
mkdir /nvme
mount /dev/nvme0n1p3  /nvme
# 检查
ls   /nvme

自动挂载

1
nano /etc/fstab

添加一行

1
2
3
# <file system> <mount point> <type> <options> <dump> <pass>

/dev/nvme0n1p3 /nvme exfat defaults 0 2 

/dev/nvme0n1p3 是分区, /nvmek是挂载的文件夹, exfat是磁盘格式, defaults 默认.
第一个数字:0表示开机不检查磁盘,1表示开机检查磁盘;
第二个数字:0表示交换分区,1代表启动分区(Linux),2表示普通分区

重启测试

读写速度测试 读取

1
hdparm -t /dev/nvme0n1p3

Timing buffered disk reads: 3874 MB in 3.00 seconds = 1291.26 MB/sec 写入

1
dd if=/dev/zero of=/nvme/test.for.write  bs=1M count=8000 oflag=direct #写入一个8G的文件

结果

1
2
3
8000+0 records in
8000+0 records out
8388608000 bytes (8.4 GB, 7.8 GiB) copied, 12.7129 s, 660 MB/s

写入速度有点拉跨,不过也还好,马马马虎虎,考虑到兼容性和方便性exfat分区还是值得

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18

root@pve-yanhui ~# dd if=/dev/zero of=/nvme/test.for.write  bs=1M count=8000 oflag=direct
8000+0 records in
8000+0 records out
8388608000 bytes (8.4 GB, 7.8 GiB) copied, 12.7129 s, 660 MB/s
root@pve-yanhui ~# rm -rf /nvme/test.for.write
root@pve-yanhui ~# dd if=/dev/zero of=/nvme/test.for.write  bs=100M count=80 oflag=direct
80+0 records in
80+0 records out
8388608000 bytes (8.4 GB, 7.8 GiB) copied, 16.8002 s, 499 MB/s
root@pve-yanhui ~# dd if=/dev/zero of=/nvme/test.for.write  bs=100M count=80 oflag=direct
80+0 records in
80+0 records out
8388608000 bytes (8.4 GB, 7.8 GiB) copied, 16.7228 s, 502 MB/s
root@pve-yanhui ~# dd if=/dev/zero of=/nvme/test.for.write  bs=10M count=800 oflag=direct
800+0 records in
800+0 records out
8388608000 bytes (8.4 GB, 7.8 GiB) copied, 14.3473 s, 585 MB/s

# 结语

对于nvme 硬盘来说,exfat真的不合适,linux下性能损耗太大了,上面的测试可以看到性能损耗差不多一半!血亏

多系统使用强烈建议 使用brtfs格式。linux肯定没问题 win和winpe 可以使用 本文方法:https://dev.leiyanhui.com/win/winbtrfs/

macos的话,目前好像只有用虚拟机映射分区的方法访问,然后sftp或者其他方式再挂载出来。

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计