Simple management and application of Btrfs file system

Source: Internet
Author: User

One, Btrfs's command options

Mkfs.btrfs

-L ' LABEL ' specifies the volume label

-D <type>: Raid0,raid1, RAID5, Raid6, RAID10, single indicates data storage type

-M <profile>: Raid0,raid1, RAID5, Raid6, RAID10, single, DUP indicates the mechanism of the source data storage

-o <feature> specify attributes to use when formatting

-O List-all: Lists all supported feature

Man Btrfs-filesystem See more subcommands


MOUNT-T btrfs/dev/sdbmount_point Mount File system


Mount-o Compress={lzo|zlib} DEVICE mount_point transparent compression mechanism


Btrfs filesystem Resize±value mount_point resizing the disk


Btrfs devices [subcommand] args manages disk devices


Btrfs-balance Subcomand|args Equalization Data


Btrfs Subvolume [Subcommand][args] Creating a sub-volume


Btrfs Snapshot Create a snapshot

The snapshot must be in the same volume group as the original volume, and the snapshot of the child volume must be in the same parent volume as the child volume

Btrfs subvolume Delete snapshot-name Delete a child snapshot


II. Application of Btrfs file system

1. Create and Mount Btrfs file system

Mount file system with Btrfs, here I'm/dev/sdb

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457747293721783.png "title= "1457747293721783.png" alt= "Blob.png"/>

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457747313955510.png "title= "1457747313955510.png" alt= "Blob.png"/>

2. Increased reduction of Btrfs file system

Reduce the size of the/tmp/mydata by 1G

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457748133355610.png "title= "1457748133355610.png" alt= "Blob.png"/>

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457748145678457.png "title= "1457748145678457.png" alt= "Blob.png"/>

Increase the size of the/tmp/mydata by 1G

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457748256677033.png "title= "1457748256677033.png" alt= "Blob.png"/>

3, increase or decrease the disk online, and balance the data

Add a disk/DEV/SDC online to an existing file system

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457751886753829.png "title= "1457751886753829.png" alt= "Blob.png"/>

Balance sync file system data after adding disk

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457752143544696.png "title= "1457752143544696.png" alt= "Blob.png"/>

Delete a mounted disk online

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457752708636303.png "title= "1457752708636303.png" alt= "Blob.png"/>

Because RAID1 needs at least 2 pieces of equipment, it can't be deleted.

So Btrfs has at least two disks after the disk has been added, unable to become a disk, you can first add another disk, and then delete the original disk

To change the raid level:

Btrfs Balance start-mconvert=raid#-dconvert=raid#/mount_point

Change the level of RAID (#为要改变的raid级别,/mount_point is a mounted directory)

4. Create a Delete sub-volume

Create a sub-volume under/tmp/mydata data1

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457748931669023.png "title= "1457748931669023.png" alt= "Blob.png"/>

Delete a sub-volume data1

650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160312/1457753962891838.png "title= "1457753962891838.png" alt= "Blob.png"/>



This article is from the "Wind" blog, please be sure to keep this source http://xsllqs.blog.51cto.com/2308669/1750500

Simple management and application of 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.