Btrfs
Btrfs (b-tree file system, commonly read as Butter Fs,better FS or B-tree FS), a file system that supports write-time replication (COW), can consist of multiple underlying physical volumes. In addition, the file system supports RAID, data and meta-data check code (checksum), sub-volume, snapshot and transparent compression function.
File system creation
Disk partitions are formatted after the partition is created
# mkfs.btrfs/dev/sda5 # mkdir/btrfsdisk # mount-t Btrfs/dev/sda5/btrfsdisk
Such a Btrfs file system was created and mounted in the/btrfsdisk directory
Here are a few common options for Mkfs.btrfs
Mkfs.btrfs
-L ' LABEL ': Specify volume label
-D <type>: Raid0, RAID1, RAID5, Raid6, RAID10, single
Indicates the raid level of the data store
-M <profile>: RAID0, RAID1, RAID5, Raid6, RAID10, single, DUP
Indicates the raid level of the metadata store
-O <feature>: Enable appropriate features
-O List-all: Lists all supported feature;
Properties View:
Btrfs filesystem Show
Create Snapshot
# ls/btrfsdisk test1 Test2 # VI test1 This was a test # btrfsctl–s Snap1/btrfsdisk # vi test1 Test1 is Modi Fied # cd/btrfsdisk/snap1 # cat Test1 This is a test
There are 2 files in the system when you create a snapshot Snap1. After the snapshot is created, modify the contents of the Test1. Then go back to Snap1, open the Test1 file, you can see Test1 content is still the previous content.
Create Subvolume
# mkdir/mnt/test # btrfsctl–s Sub1/btrfsdisk # mount–t Btrfs–o subvol=sub1/dev/sda5/mnt/test
Turn on the compression function
# mount–t Btrfs–o Compress/dev/sda5/btrfsdisk
The management and application of Linux learning Note--btrfs file system