..
Btrfs 注意事项
子卷布局
我采用平坦布局,并通过 /etc/fstab
把子卷挂载
mount 参数
一开始就应使用 space_cache=v2
。
不过,若你一开始用的是 space_cache=v1
,
现在想改成 space_cache=v2
,
直接改 fstab 的话可能会出现问题,
建议 mount -oclear_cache,space_cache=v2
清理下 space_cache
。
辅助工具
locate 的额外配置
若你用 mlocate 或 plocate,最好在
/etc/updatedb.conf
添加
PRUNENAMES = ".git .hg .svn .snapshots"
以排除对 .snapshots
索引
回滚 @home 步骤
在这里简单记一下恢复的步骤: 1、先创建当前状态的只读镜像eg.99,以备后用。
btrfs subvolume snapshot -r /mnt/@home /mnt/@home/.snapshots/99
mv /mnt/@home /mnt/@home.old
2、从历史镜像eg.15恢复 /home 。
btrfs subvolume snapshot /mnt/@home.old/15/snapshot /mnt/@home
3、移动子分卷。
mv /mnt/@home.old/.snapshots /mnt/@home/
4、移除旧分卷,更改 /etc/fstab 。
btrfs subvolume delete -c /mnt/@home.old
使用 btrfs subvolume list -p /mnt 找出 @home 子卷的 ID。修改 /etc/fstab 中 /home 挂载参数中 subvolid。
5、完成,尝试重启系统。