佚名 通过本文向大家介绍了linux btrfs,btrfs文件系统,btrfs,btrfs ext4,群晖 btrfs ext4等相关知识,希望对您有所帮助,也希望大家多多支持linkedu.com
什么是btrfs?
Btrfs(B-tree文件系统,通常念成Butter FS,Better FS或B-tree FS),linux文件系统,具有写时复制COW(copy-on-write),改善ext3文件系统单文件大小限制,并加入其他特性,如可写快照,快照的快照,内建RAID,子卷(subvloume),专注于容错,修复和易于管理。单文件可达16EB,最大文件数量2^64,最大卷容量16EB,等。
btrfs功能特性
1,COW:写时复制,每次写入数据时,先将数据写入到新的block,写入成功后,更改旧数据块指针到新数据块,而非更改本身。
2,多物理卷支持,btrfs内建raid,可在线增删磁盘设备,可在线扩展和缩减磁盘空间。
3,数据和元数据校验码,checksum
4,子卷,可单独挂载子卷
5,可写快照,快照的快照,单个文件快照。
6,透明压缩
7,ext3/4和btrfs无痛互转
btrfs 基本用法:
- [root@localhost ~]# btrfs --help #查看帮助可以看到btrfs 有很多子命令,用法也很多,这里只举例常用选项。
- usage: btrfs [--help] [--version] <group> [<group>...] <command> [<args>]
- btrfs subvolume create [-i <qgroupid>] [<dest>/]<name> #创建子卷
- Create a subvolume
- btrfs subvolume delete [options] <subvolume> [<subvolume>...] #删除子卷
- Delete subvolume(s)
- btrfs subvolume list [options] [-G [+|-]value] [-C [+|-]value] [--sort=gen,ogen,rootid,path] <path> #显示子卷列表
- List subvolumes (and snapshots)
- btrfs subvolume snapshot [-r] [-i <qgroupid>] <source> <dest>|[<dest>/]<name> #创建子卷快照
- Create a snapshot of the subvolume
- btrfs subvolume get-default <path> #获取子卷默认的文件系统
- Get the default subvolume of a filesystem
- btrfs subvolume set-default <subvolid> <path> #设置默认系统给子卷
- Set the default subvolume of a filesystem
- btrfs subvolume find-new <path> <lastgen> #列出btrfs文件系统中最近修改的文件,结合find命令
- List the recently modified files in a filesystem
- btrfs subvolume show <subvol-path> #显示更多的子卷信息
- Show more information of the subvolume
- btrfs subvolume sync <path> [<subvol-id>...] #子卷同步,类似mount同步模式,内存数据同步到磁盘,有待查证。
- Wait until given subvolume(s) are completely removed from the filesystem.
- btrfs filesystem df [options] <path> #显示挂载的文件系统详细信息。
- Show space usage information for a mount point
- btrfs filesystem show [options] [<path>|<uuid>|<device>|label] #显示创建文件系统的磁盘信息。
- Show the structure of a filesystem
- btrfs filesystem sync <path> #强制文件系统同步,
- Force a sync on a filesystem
- btrfs filesystem defragment [options] <file>|<dir> [<file>|<dir>...] #碎片整理
- Defragment a file or a directory
- btrfs filesystem resize [devid:][+/-]<newsize>[kKmMgGtTpPeE]|[devid:]max <path> #btrfs文件系统在线扩展和缩减空间
- Resize a filesystem
- btrfs&nb