310 words
2 minutes
Arch_btrfs
- 买了两块
optane m10 16G当做普通硬盘使用
分区
- 在第一块硬盘分区一个
/boot分区和一个/swap分区,剩余的全部做btrfs分区。
fdisk /dev/nvme0n1 # 分三个分区
mkfs.fat -F 32 /dev/nvme0n1p1mkswapon /dev/nvme0n1p2swapon /dev/nvme0n1p22.将第一块硬盘剩余的空间与第二块硬盘合成一个btrfs卷(第二块硬盘可以分区也可以不分)。
mkfs.btrfs -L archbtrfs -d raid0 -m raid1 /dev/nvme0n1p3 /dev/nvm1n1# 使用systemd-boot引导时,用archbtfs的UUID- 创建子卷
mount /dev/nvme1n1 # 无论哪部分挂载,整个archbtrfs都会挂载上去,或者直接用标签挂载
btrfs subvolume create /mnt/@btrfs subvolume create /mnt/@homebtrfs subvolume create /mnt/@varbtrfs subvolume create /mnt/@snapshotsbtrfs subvolume create /mnt/@logbtrfs subvolume create /mnt/@cachebtrfs subvolume create /mnt/@tmpbtrfs subvolume create /mnt/@dockerumount /mnt- 挂载子卷
mount -t btrfs -o subvol=@,compress=zstd,noatime /dev/nvme1n1 /mntmkdir -p /mnt/{home,var,.snapshots,var/log,var/cache,var/tmp,var/lib/docker} # 使用命令后查看一下目录是否创建成功mount -t btrfs -o subvol=@home,compress=zstd,noatime /dev/nvme1n1 /mnt/homemount -t btrfs -o subvol=@var,compress=zstd,noatime /dev/nvme1n1 /mnt/varmount -t btrfs -o subvol=@snapshots,compress=zstd,noatime /dev/nvme1n1 /mnt/.snapshotsmount -t btrfs -o subvol=@log,compress=zstd,noatime,compress=zstd /dev/nvm1n1 /mnt/var/logmount -t btrfs -o subvol=@cache,compress=zstd,noatime,compress=zstd /dev/nvm1n1 /mnt/var/cachemount -t btrfs -o subvol=@tmp,compress=zstd,noatime,compress=zstd /dev/nvm1n1 /mnt/var/tmpmount -t btrfs -o subvol=@docker,nodatacow,noatime /dev/nvme1n1 /mnt/var/lib/dockermount /dev/nmve0n1p1 /mnt/boot
chattr +C /mnt/var/logchattr +C /mnt/var/cachechattr +C /mnt/var/tmp# 禁用这三个目录的cowFinally
- 装完系统后发现,主机散热很垃圾。
M10的温度在60度上下。
Arch_btrfs
https://infini.cv/posts/arch_btrfs/ Some information may be outdated