Btrfs is a powerful new file system, let's look at its features and common operations
Core Features:
Multi-Physical volume support: Btrfs can be composed of multiple underlying physical volumes, RAID support for online "add", "Remove", "modify";
Copy-on-write update mechanism (CoW): Copy, update, and replace pointers instead of "in-place" updates;
Data and meta-data check code: Checksum detection Integrity
Sub-Volume: Sub_volume
Snapshots: snapshots that support snapshots;
Transparent compression: Performs compression operations when stored, and supports no-pressure viewing, saving space
Case process:
Create Btrfs:
Using Mkfs.btrfs
-l ' label ': Specify LABEL to create file system
-D <type>: Indicates the cross-disk storage of data for increased IO efficiency or data security, support for RAID0, RAID1, RAID5, Raid6, RAID10, single
-M <profile>: Indicates the cross-disk storage of metadata for increased IO efficiency or data security, support for RAID0, RAID1, RAID5, Raid6, RAID10, single, DUP
-O <feature>: Indicates that certain file system features are turned on
-O List-all: Lists all supported feature;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5D/wKiom1XhrA-Q6vpVAAEU291AiUY164.jpg "title=" 98.png "alt=" Wkiom1xhra-q6vpvaaeu291aiuy164.jpg "/>
Use of 2.BTRFS file systems
Supports many subcommands to achieve its powerful functions
To create a Btrfs file system:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5B/wKioL1Xhw5Xh85bYAADIGMsc7I4145.jpg "style=" float: none; "title=" 99.png "alt=" Wkiol1xhw5xh85byaadigmsc7i4145.jpg "/>
View:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5E/wKiom1XhwXmxl6wVAAE1YsUdC5Y469.jpg "style=" float: none; "title=" 100.png "alt=" Wkiom1xhwxmxl6wvaae1ysudc5y469.jpg "/>
View label :
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5B/wKioL1Xhw5XTA61CAABbqZYIfWA948.jpg "style=" float: none; "title=" 101.png "alt=" Wkiol1xhw5xta61caabbqzyifwa948.jpg "/>
using blkid to see the SDB1 and SDC1 's UUID ,sub_uuid is different:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5E/wKiom1XhwXmCGVxoAAC-Rcc3qCM342.jpg "style=" float: none; "title=" 102.png "alt=" Wkiom1xhwxmcgvxoaac-rcc3qcm342.jpg "/>
Mount:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5B/wKioL1Xhw5Xx6OVkAABTVXj-y04907.jpg "style=" float: none; "title=" 103.png "alt=" Wkiol1xhw5xx6ovkaabtvxj-y04907.jpg "/>
To create a file in the Mount directory:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5E/wKiom1XhwXmCHcFZAABM4cK-e20079.jpg "style=" float: none; "title=" 104.png "alt=" Wkiom1xhwxmchcfzaabm4ck-e20079.jpg "/>
You can also use the transparent compression mechanism to mount:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5B/wKioL1Xhw5aipeq0AAAfhgKx0Lw291.jpg "style=" float: none; "title=" 105.png "alt=" Wkiol1xhw5aipeq0aaafhgkx0lw291.jpg "/>
Adjust file system size online :
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5E/wKiom1XhwXqR4aG6AAEsgqQSBoM047.jpg "style=" float: none; "title=" 106.png "alt=" Wkiom1xhwxqr4ag6aaesgqqsbom047.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5B/wKioL1Xhw5bRKfn_AAEvgCWPBl0327.jpg "style=" float: none; "title=" 107.png "alt=" Wkiol1xhw5brkfn_aaevgcwpbl0327.jpg "/>
Add, remove, scan devices and more :
Add a device to the currently specified Btrfs file system
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5E/wKiom1XhwXriu_YlAAB4jga0aCI528.jpg "style=" float: none; "title=" 108.png "alt=" Wkiom1xhwxriu_ylaab4jga0aci528.jpg "/>
Balance the previous data on the newly added disk
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5F/wKiom1Xhwq-zr41WAABczNVBWW4892.jpg "title=" 123. PNG "alt=" wkiom1xhwq-zr41waabcznvbww4892.jpg "/>
when the amount of data is particularly large, you can also IO Peak Pause balance operation, cancel pause, interrupt, etc., here is no longer redundant
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5B/wKioL1Xhw5bD3FZxAABMYmMoZwE251.jpg "style=" float: none; "title=" 110.png "alt=" Wkiol1xhw5bd3fzxaabmymmozwe251.jpg "/>
before removing the physical volume,btrfs will automatically move the data above and then remove it, without the need to manually remove the data as LVM does.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5E/wKiom1XhwZ3T2DxXAABgG8Hdyzs594.jpg "style=" float: none; "title=" 111.png "alt=" Wkiom1xhwz3t2dxxaabgg8hdyzs594.jpg "/>
only sdb2 and sdc1 were found ,sdb1 was removed :
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5B/wKioL1Xhw7rxIkAtAACV5Ffy6dQ609.jpg "style=" float: none; "title=" 112.png "alt=" Wkiol1xhw7rxikataacv5ffy6dq609.jpg "/>
view data is still in ;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5F/wKiom1XhwZ6CmoEHAAAsxz57czw951.jpg "style=" float: none; "title=" 113.png "alt=" Wkiom1xhwz6cmoehaaasxz57czw951.jpg "/>
Reproduce organization data across disk storage formats
-M represents meta data
-D represents data
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5F/wKiom1XhwZ6Cgie0AABhfaRp9CA278.jpg "style=" float: none; "title=" 114.png "alt=" Wkiom1xhwz6cgie0aabhfarp9ca278.jpg "/>
Sub-volume Features:
Create a sub-volume and view:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5B/wKioL1Xhw7riuvCfAABj-noHR8E140.jpg "style=" float: none; "title=" 115.png "alt=" Wkiol1xhw7riuvcfaabj-nohr8e140.jpg "/>
Mount a sub-volume:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5F/wKiom1XhwZ6g3iQmAABrRoZZ1yU295.jpg "style=" float: none; "title=" 116.png "alt=" Wkiom1xhwz6g3iqmaabrrozz1yu295.jpg "/>
To view Sub-volume information:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5B/wKioL1Xhw7qghVPwAACcSseQ1bs717.jpg "style=" float: none; "title=" 117.png "alt=" Wkiol1xhw7qghvpwaaccsseq1bs717.jpg "/>
Files in a child volume can be accessed through the parent volume:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5F/wKiom1XhwZ6QA1SoAABBUScNe3A356.jpg "style=" float: none; "title=" 118.png "alt=" Wkiom1xhwz6qa1soaabbuscne3a356.jpg "/>
To delete a sub-volume:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/72/5B/wKioL1Xhxfuh9cOSAAB0v5SN2xM274.jpg "title=" 125. PNG "alt=" wkiol1xhxfuh9cosaab0v5sn2xm274.jpg "/>
Snapshot: Note that a snapshot of a child volume must be in the same parent volume as the child volume
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5B/wKioL1Xhw7vyZFitAAH-x6hUvIc365.jpg "style=" float: none; "title=" 120.png "alt=" Wkiol1xhw7vyzfitaah-x6huvic365.jpg "/>
To delete a snapshot:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5F/wKiom1XhwZ-i78hYAADbaitW1PY981.jpg "style=" float: none; "title=" 121.png "alt=" Wkiom1xhwz-i78hyaadbaitw1py981.jpg "/>
Take a snapshot of a single file and verify that:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5B/wKioL1Xhw7vDXAOjAAEX-OgsQG0755.jpg "style=" float: none; "title=" 122.png "alt=" Wkiol1xhw7vdxaojaaex-ogsqg0755.jpg "/>
Ext Series File system and btrfs file System lossless conversion:
first create a ext4 file system:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5B/wKioL1XhyHfDBZv4AAGMC6gR7zQ764.jpg "style=" float: none; "title=" 126.png "alt=" Wkiol1xhyhfdbzv4aagmc6gr7zq764.jpg "/>
then mount and create the file in the Mount directory, convert to btrfs with Btrfs-convert
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5F/wKiom1Xhxlvy_SsXAAFKzNrFMso013.jpg "style=" float: none; "title=" 127.png "alt=" Wkiom1xhxlvy_ssxaafkznrfmso013.jpg "/>
View:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5B/wKioL1XhyHfjhlNBAAB-ZlXth4Q585.jpg "style=" float: none; "title=" 128.png "alt=" Wkiol1xhyhfjhlnbaab-zlxth4q585.jpg "/>
The file is also:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5F/wKiom1XhxlvCdB_BAAA7Mf8MvRk224.jpg "style=" float: none; "title=" 129.png "alt=" Wkiom1xhxlvcdb_baaa7mf8mvrk224.jpg "/>
Rollback to EXT4 file system: using the- r option
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5B/wKioL1XhyHiQYgyRAABjOdKvVHY074.jpg "style=" float: none; "title=" 130.png "alt=" Wkiol1xhyhiqygyraabjodkvvhy074.jpg "/>
This article is from the "After Tomorrow" blog, please be sure to keep this source http://leeyan.blog.51cto.com/8379003/1689638
Btrfs features and common operations