[filesystem][archlinux][disk encryption][btrfs] btrfs
fork from here http://www.cnblogs.com/hugetong/p/6914248.html
boot分区,MBR加密:https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Securing_the_unencrypted_boot_partition
首先,我选择在LUKS上创建btrfs。查看上述文档的btrfs章节。
1. btrfs不支持swap file,必须使用swap分区 https://wiki.archlinux.org/index.php/Btrfs#Swap_file
2. 不建议在裸盘直接使用btrfs文件系统。https://wiki.archlinux.org/index.php/Btrfs#Partitionless_Btrfs_disk
3. btrfs带压缩会提高性能表现。https://wiki.archlinux.org/index.php/Btrfs#Compression
4. 新概念 subvolumes。 https://wiki.archlinux.org/index.php/Btrfs#Subvolumes
这个更详细,讲的更清楚,上边那个讲的很不清楚。。。:https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Subvolumes
btrfs文档:https://wiki.archlinux.org/index.php/Btrfs (跟上边那一堆,明明都是一个。。。)
多个磁盘的情况下可以组成一个pool,Btrfs支持 RAID0,1, 10, 5, 6。https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices
5. 不要使用btrfs 的 RAID5, RAID6模式。
6. 常用命令们
https://btrfs.wiki.kernel.org/index.php/Getting_started#Basic_Filesystem_Commands
7. 最大容量 70% ??
Be aware that for that size, it will report full when reaching about 75%.
-----------------------------------------------------------
1. 初始化一个 btrfs 文件系统
root@archiso ~ # mkfs.btrfs -L vd_root -f /dev/mapper/vd_root :(
btrfs-progs v4.10.2
See http://btrfs.wiki.kernel.org for more information. Label: vd_root
UUID: ba0b8b0b--455b-90f6-422f61d59df1
Node size:
Sector size:
Filesystem size: .00GiB
Block group profiles:
Data: single .00MiB
Metadata: DUP .00GiB
System: DUP .00MiB
SSD detected: no
Incompat features: extref, skinny-metadata
Number of devices:
Devices:
ID SIZE PATH
.00GiB /dev/mapper/vd_root root@archiso ~ #
2. 创建一个 subvolume
root@archiso ~ # btrfs subvolume create mnt/real_root
Create subvolume 'mnt/real_root'
3. 创建快照(很显然从命令来看,快照也是一个subvolume )
root@archiso ~ # btrfs subvolume snapshot mnt/real_root mnt/snapshot_of_real_root
Create a snapshot of 'mnt/real_root' in 'mnt/snapshot_of_real_root'
4. 设置default
root@archiso ~ # btrfs subvolume set-default mnt
root@archiso ~ # btrfs subvolume get-default mnt
ID gen top level path real_root
5. 删除快照或subvolume
root@archiso ~ # btrfs subvolume list /root/mnt
ID gen top level path real_root
ID gen top level path snapshot_of_real_root
ID gen top level path snapshot/snapshot_of_real_root_2
root@archiso ~ # btrfs subvolume create mnt/test
Create subvolume 'mnt/test'
root@archiso ~ # btrfs subvolume list /root/mnt
ID gen top level path real_root
ID gen top level path snapshot_of_real_root
ID gen top level path snapshot/snapshot_of_real_root_2
ID gen top level path test
root@archiso ~ # btrfs subvolume delete mnt/test
Delete subvolume (no-commit): '/root/mnt/test'
root@archiso ~ # btrfs subvolume list /root/mnt
ID gen top level path real_root
ID gen top level path snapshot_of_real_root
ID gen top level path snapshot/snapshot_of_real_root_2
root@archiso ~ #
6. 根据文档里的描述, 选用Flat方式创建subvolume
https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Flat
root@archiso ~ # find mnt
mnt
mnt/real_root
mnt/real_root/root
mnt/real_root/home
mnt/snapshot
root@archiso ~ # btrfs subvolume get-default mnt
ID gen top level path real_root
root@archiso ~ # btrfs subvolume list mnt
ID gen top level path real_root
ID gen top level path real_root/root
ID gen top level path real_root/home
root@archiso ~ #
7. 挂载指定的 subvolume
root@archiso ~ # btrfs subvolume list mnt
ID gen top level path top
ID gen top level path top/root
ID gen top level path top/home
root@archiso ~ # mount -o subvol=top/root /dev/mapper/crypt_root mnt
[filesystem][archlinux][disk encryption][btrfs] btrfs的更多相关文章
- [cipher][archlinux][disk encryption][btrfs] 磁盘分区加密 + btrfs
科普链接:https://wiki.archlinux.org/index.php/Disk_encryption 前面的链接关于硬盘加密,讲了几种,基本上就是选dm-crypt with LUKS ...
- [archlinux] 迁移T7从T460s到T470
这已经不是第一次做OS的迁移了,T7早已经迁移过多台设备了.所以,其实只需要如下三步: 1. rsync 我一直有全系统备份的习惯,T7一直会不定期的全系统rsync到Tstation上面去.所以我 ...
- [archlinux][crypto] 从T450迁移archlinux操作系统至T460s笔记本
从T450笔记本迁移archlinux操作系统之T460s笔记本,同时: 1. 使用cryptsetup做底层块加密. 2. 全新使用btrfs文件系统. 一,硬盘分区. 1T的SSD,使用U ...
- [daily][archlinux][btrfs][mysql] 在btrfs上使用mariadb
在btrfs上使用mariadb的时候,需要注意关闭btrfs的Copy on Write (/var/lib/mysql目录) 如下: ┬─[tong@T7:~/Data/anthropoid]─[ ...
- btrfs文件系统简单学习
1 btrfs文件系统 btrfs文件系统在生产环境应用还不多,因此,本文仅仅简单学习. 1.1 btrfs文件系统核心特性 1)多物理卷支持:btrfs可由多个底层物理卷组成(可以是单块物理磁盘,也 ...
- Linux btrfs文件系统
btrfs,它名字挺多:B-tree fs;Butter fs;Better fs 开源协议是GPL,2007年由Oracle研发 核心特性: 多物理卷支持,btrfs可由多个物理卷组成:支持RAID ...
- Docker存储驱动之Btrfs简介
简介 Btrfs是下一代的copy-on-write文件系统,它支持很多高级特性,使其更加适合Docker.Btrfs合并在内核主线中,并且它的on-disk-format也逐渐稳定了.不过,它的很多 ...
- linux btrfs文件系统管理与应用
btrfs文件系统管理与应用 1.btrfs文件系统 基本介绍 btrfs文件系统在CentOS7.x上属于技术预览版 btrfs文件系统英文名:B-tree FileSystem或者Butter ...
- Btrfs管理及应用
一.btrfs基本概念 btrfs文件系统是2007年Oracle开发,支持GPL协议,为了取代Linux早期的ext系列文件系统. btrfs核心特性: 多物理卷支持:btrfs可由多个底层物理卷组 ...
随机推荐
- 6-11-N皇后问题-树和二叉树-第6章-《数据结构》课本源码-严蔚敏吴伟民版
课本源码部分 第6章 树和二叉树 - N皇后问题 ——<数据结构>-严蔚敏.吴伟民版 源码使用说明 链接☛☛☛ <数据结构-C语言版>(严蔚敏,吴伟民版)课本 ...
- flink 获取上传的Jar源码
package org.apache.flink.runtime.webmonitor.handlers; /** * Handles .jar file uploads. */public clas ...
- ③NuPlayer播放框架之类NuPlayer源码分析
[时间:2016-10] [状态:Open] [关键词:android,nuplayer,开源播放器,播放框架] 0 引言 差不多一个月了,继续分析AOSP的播放框架的源码.这次我们需要深入分析的是N ...
- 执行一条SQL语句,插入多条数据!
insert into blog (bid, aid) values (2,1)(2,2)(2,3)
- Odoo小数精度及货币精度详解
一.小数精度的设置 一般在设置-数据结构-精度设置中就可以对 小数类型的字段进行精度设置: 对于代码中定义为 digits=dp.get_precision('Product Price') 或 di ...
- Unity5 AssetBundle系列——基本流程
Unity5的AssetBundle修改比较大,所以第一条建议是:忘掉以前的用法,重新来!要知道,Unity5已经没办法加载2.x 3.x的bundle包了…体会一下Unity5 AssetBundl ...
- Numpy 定义矩阵的方法
import numpy as np #https://www.cnblogs.com/xzcfightingup/p/7598293.html a = np.zeros((2,3),dtype=in ...
- Excel文档间的数据替换 ---电脑版APP 自动操作魔法师
http://www.won-soft.com/macro/solution/excel-data-replace.htm 介绍: 在我们的日常工作中, 可能经常需要使用同各种数据表格打交道.比如财务 ...
- react-router 4.3 js实现跳转
import React, {Component} from 'react'; import { NavLink,Link } from "react-router-dom"; i ...
- pixmap和label设置图片自适应大小
在label中添加pixmap来显示图片时,当图片过大时图片显示不全. 1.这时可以使用pixmap的scared()方法,来设置图片缩放. QPixmap QPixmap.scaled (self, ...