The management and application of Linux learning Note--btrfs file system

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.