<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.manjaro.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Andreas85</id>
	<title>Manjaro - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.manjaro.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Andreas85"/>
	<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Special:Contributions/Andreas85"/>
	<updated>2026-05-21T22:20:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=55068</id>
		<title>File Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=55068"/>
		<updated>2025-11-18T16:10:30Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: changed default filesystem for manjaro&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This page provides information on some of the filesystems commonly used in Manjaro. It also shows where and how they are used. Further information on these and other filesystems can be found in the ARCH Wiki.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
A filesystem manages the space on a storage medium (hard disk, SSD ...). It makes this memory available to the operating system so that files can be saved and read again. Each of the following filesystems has advantages and disadvantages. They are mostly developed for a special purpose and are therefore used in a certain environment.&lt;br /&gt;
&lt;br /&gt;
== Linux == &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
filesystems that are mostly used under Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Note that many filesystem drivers are already included in the Linux kernel. You may not need anything else to mount, read, or write these filesystems. But there are packages with additional tools. You may need them to format, check, repair, modify, or optimize such filesystems. So if you regularly use a filesystem, it is a good idea to install the appropriate tools.&lt;br /&gt;
&lt;br /&gt;
=== Ext2 → Ext3 → Ext4 === &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Ext4 was previously the default file system in Manjaro. It is the successor to the most widely used Linux file systems (Ext3, Ext2) and promises improved design, higher performance, reliability, and more features compared to its predecessors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
If you are using Ext2 or Ext3, you can convert the partition to Ext4. Ext4 uses journaling, checksums and write barriers and is therefore more robust against damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Currently Ext4 is fully supported in Win10 and OsX. Support for ext4 has been built in since WSL is included in Win10 (2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
see [https://ext4.wiki.kernel.org/ Ext4@kernel.org], [https://wiki.archlinux.org/title/Ext4 Ext4@ARCH-wiki], [https://de.wikipedia.org/wiki/Ext4 Ext4@wikipedia] &lt;br /&gt;
&amp;lt;br&amp;gt;For advanced optimizations see  [https://wiki.archlinux.org/index.php/Ext4#Improving_performance Improving Ext4 performance@Archwiki].&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
In Manjaro, e2fsprogs is already installed&lt;br /&gt;
&lt;br /&gt;
===[[Btrfs]]=== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite filesystem for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. [[Btrfs]] not only is a filesystem, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[[Btrfs]] is now the default file system in Manjaro. Because [[Btrfs]] works differently, some things may seem unfamiliar and strange. The [[Btrfs]] page is therefore a good starting point for finding answers and gaining a better understanding of [[Btrfs]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Self-healing&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruptions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
see [[Btrfs]], [https://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs@kernel.org], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARCH-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia]&lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|Maintenance|When using snapshots, you must be particularly careful not to use up all the space on the file system -&amp;gt; [[Btrfs#Out_of_space]]}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd0&amp;gt;{{UserCmd|command=pamac install btrfs-progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReiserFS → reiser4 === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
ReiserFS was the first journaling filesystem to be included in the standard kernel. It was actively used by some distros some time ago, but is not currently widely used. Reiser4 is the successor to ReiserFS(3). However, Reiser4 seems not to be integrated in the kernel yet. &lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|As of kernel 6.13|reiserFS will no longer be supported.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/Reiser4 Reiser4@ARCH-wiki], [https://en.wikipedia.org/wiki/ReiserFS ReiserFS@wikipedia], [https://en.wikipedia.org/wiki/Reiser4 Reiser4@wikipedia], [https://reiser4.wiki.kernel.org/ Reiser4@kernel.org]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd2&amp;gt;{{UserCmd|command=pamac install reiserfsprogs reiser4progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Windows == &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
filesystems mostly used in windows&lt;br /&gt;
&lt;br /&gt;
=== NTFS === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
It is the most widely used filesystem on windows these days. It does exist in different versions, but unlike FAT32, all of them offer the following points:&lt;br /&gt;
* Large files&amp;gt; 4GB&lt;br /&gt;
* Long file names with UTF16 up to 255 characters&lt;br /&gt;
* Rights management, ACL&lt;br /&gt;
* Journaling of metadata&lt;br /&gt;
* Compression, encryption, ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Currently there are some restrictions when using NTFS with Linux. If windows is suddenly switched off or goes into hibernating, the NTFS filesystem is left in a &amp;quot;dirty-state&amp;quot;. When Windows starts again, NTFS is the first to be cleaned. This operation is currently not supported by the Linux driver. Then Linux shows the NTFS filesystem as read-only to be on the safe side. The same thing may happen, when NTFS becomes damaged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/NTFS NTFS@ARCH-wiki], [https://en.wikipedia.org/wiki/NTFS NTFS@wikipedia]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
{{BoxWarning|If you regularly switch between Windows and Linux|You should switch off &amp;quot;hibernation&amp;quot;, &amp;quot;Hybrid Boot&amp;quot;, &amp;quot;Fast Boot&amp;quot; in Windows. Then Linux has always full (read / write) access to NTFS drives.&lt;br /&gt;
* [https://forum.manjaro.org/t/all-of-my-files-are-in-read-only-mode/83777/7 all-of-my-files-are-in-read-only-mode@forum]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{BoxDanger|If your NTFS file system becomes corrupted|It is strongly recommended that you only repair the file system using the original Windows tools. Anything else is highly risky.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd3&amp;gt;{{UserCmd|command=pamac install ntfs-3g}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DOS == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
filesystems under DOS and early windows on a lot of floppydisks and USB-sticks&lt;br /&gt;
&lt;br /&gt;
=== FAT16 → FAT32 (+VFAT) === &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
This is a traditional filesystem under DOS and early Windows versions. Even today it can be found on many floppy disks, USB sticks and hard drives. It is supported by all types of operating systems and is therefore often used to exchange files, to pass them on, or to keep them accessible to both operating systems in the case of dualboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
Even with FAT32, this comes not without its disadvantages.&lt;br /&gt;
* no support for user rights or xattr&lt;br /&gt;
* severely restricted file names (8.3 or LFN for VFAT, no distinction between lowercase and uppercase)&lt;br /&gt;
* no files over 2GB (FAT16) 4GB (FAT32)&lt;br /&gt;
* no journaling&lt;br /&gt;
* not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
{{warning | FAT Filesystems do not use journaling. Data on such filesystems is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/FAT FAT@ARCH-wiki], [https://en.wikipedia.org/wiki/File_Allocation_Table FAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd4&amp;gt;{{UserCmd|command=pamac install dosfstools}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== exFAT === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Microsoft developed the exFAT (Extended File Allocation Table) in 2006 and optimized it for flash memories such as USB sticks and SD cards. It can store large files and large numbers of files, and it can manage very large partitions. It is supported by Linux, Windows, macOS and many other devices and is one of the most compatible filesystems. ExFAT is included in Linux 5.4 and higher.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
* Flash friendly&lt;br /&gt;
* No support for user rights or xattr&lt;br /&gt;
* Files over 4 GB&lt;br /&gt;
* Checksums for metadata&lt;br /&gt;
* No journal&lt;br /&gt;
* Not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning | exFAT FS does not use journaling. Data on such a filesystem is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/ExFAT ExFAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd5&amp;gt;{{UserCmd|command=pamac install exfatprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== macOS == &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
Filesystems mostly used in macOS&lt;br /&gt;
&lt;br /&gt;
=== HFS → HFS+ === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/HFS_Plus HFSPlus@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install from AUR==== &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd6&amp;gt;{{UserCmd|command=pamac install hfsprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Others == &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XFS === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/XFS XFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
===ZFS=== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/ZFS ZFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
==Comparisions== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt; Possible usage of Filesystems&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Filesystem!!Manjaro!!Win10!!OSX!!Win9x, DOS&lt;br /&gt;
|-&lt;br /&gt;
|btrfs||● btrfs-progs||▷ ExtFS, WinBtrfs||-||-&lt;br /&gt;
|-&lt;br /&gt;
|ext2||●||▷ ExtFS||●||&lt;br /&gt;
|-&lt;br /&gt;
|ext3/4||●||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|reiser3||● reiser4progs||▷ RFSTool||?||-&lt;br /&gt;
|-&lt;br /&gt;
|NTFS||○ ntfs-3g&amp;lt;br&amp;gt;▶ 5.15?? ntfs3||●||?||&lt;br /&gt;
|-&lt;br /&gt;
|FAT32||● dosfstools||●||●||●&lt;br /&gt;
|-&lt;br /&gt;
|exFAT||▶ 5.4 exfatprogs||●||?||?&lt;br /&gt;
|-&lt;br /&gt;
|HFS||○ hfsprogs (AUR)||?||●||&lt;br /&gt;
|-&lt;br /&gt;
|XFS||?||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|ZFS||?||?||?||&lt;br /&gt;
|-&lt;br /&gt;
|F2FS||?||?||?||&lt;br /&gt;
|-&lt;br /&gt;
|JFS||?||?||?||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
● = fully supported, additional tools to install&lt;br /&gt;
 ▶ = included since kernel x.x.x &lt;br /&gt;
 ○ = partially supported&lt;br /&gt;
 ▷ = possible via external tools&lt;br /&gt;
 ? = feel free to extend ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Some important properties&lt;br /&gt;
|-&lt;br /&gt;
! Properties ||btrfs||ext4||ext3||ext2||XFS||ZFS||F2FS||JFS&lt;br /&gt;
|-&lt;br /&gt;
|journaling ||● full||● ordered||● ordered||-||●&lt;br /&gt;
|-&lt;br /&gt;
|barriers ||●||●||?||-&lt;br /&gt;
|-&lt;br /&gt;
|checksum ||● full||◎ metadata||-||-&lt;br /&gt;
|-&lt;br /&gt;
|kompression||●,&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;zstd ▶ 4.14/5.1&amp;lt;/small&amp;gt;||-||-||-||&lt;br /&gt;
|-&lt;br /&gt;
|encryption||-||▶ 4.13||-||-&lt;br /&gt;
|-&lt;br /&gt;
|snapshots||●||-||-||-||&lt;br /&gt;
|-&lt;br /&gt;
|TRIM possible||▶ 4.3||▶ 2.6.33||-||-&lt;br /&gt;
|-&lt;br /&gt;
|xattr, ACL||ACL||ACL||?||◎||ACL&lt;br /&gt;
|-&lt;br /&gt;
|small repair||● auto||● fsck||● fsck||● fsck&lt;br /&gt;
|-&lt;br /&gt;
|journal repair||● auto 3.2||● fsck||● fsck||● fsck||&lt;br /&gt;
|-&lt;br /&gt;
|repair after power loss||● auto, scrub||● tune2fs, fsck||?||-||&lt;br /&gt;
|-&lt;br /&gt;
|RAID||0, 1, 10||-||-||-||&lt;br /&gt;
|-&lt;br /&gt;
|since||2009||2008||2001||1993||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=See also= &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/ExFAT Wikipedia:exFAT]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/Comparison_of_file_systems Wikipedia:Comparison of filesystems]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://wiki.archlinux.org/index.php/Filesystems Archwiki:filesystems]&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:filesystems{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=55067</id>
		<title>File Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=55067"/>
		<updated>2025-11-18T15:33:21Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: changed default filesystem for manjaro&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This page provides information on some of the filesystems commonly used in Manjaro. It also shows where and how they are used. Further information on these and other filesystems can be found in the ARCH Wiki.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
A filesystem manages the space on a storage medium (hard disk, SSD ...). It makes this memory available to the operating system so that files can be saved and read again. Each of the following filesystems has advantages and disadvantages. They are mostly developed for a special purpose and are therefore used in a certain environment.&lt;br /&gt;
&lt;br /&gt;
== Linux == &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
filesystems that are mostly used under Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Note that many filesystem drivers are already included in the Linux kernel. You may not need anything else to mount, read, or write these filesystems. But there are packages with additional tools. You may need them to format, check, repair, modify, or optimize such filesystems. So if you regularly use a filesystem, it is a good idea to install the appropriate tools.&lt;br /&gt;
&lt;br /&gt;
=== Ext2 → Ext3 → Ext4 === &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Ext4 was previously the default file system in Manjaro. It is the successor to the most widely used Linux file systems (Ext3, Ext2) and promises improved design, higher performance, reliability, and more features compared to its predecessors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
If you are using Ext2 or Ext3, you can convert the partition to Ext4. Ext4 uses journaling, checksums and write barriers and is therefore more robust against damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Currently Ext4 is fully supported in Win10 and OsX. Support for ext4 has been built in since WSL is included in Win10 (2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
see [https://ext4.wiki.kernel.org/ Ext4@kernel.org], [https://wiki.archlinux.org/title/Ext4 Ext4@ARCH-wiki], [https://de.wikipedia.org/wiki/Ext4 Ext4@wikipedia] &lt;br /&gt;
&amp;lt;br&amp;gt;For advanced optimizations see  [https://wiki.archlinux.org/index.php/Ext4#Improving_performance Improving Ext4 performance@Archwiki].&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
In Manjaro, e2fsprogs is already installed&lt;br /&gt;
&lt;br /&gt;
===[[Btrfs]]=== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite filesystem for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. [[Btrfs]] not only is a filesystem, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[[Btrfs]] is now the default file system in Manjaro. Because [[Btrfs]] works differently, some things may seem unfamiliar and strange. The [[Btrfs]] page is therefore a good starting point for finding answers and gaining a better understanding of [[Btrfs]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Self-healing&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruptions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
see [[Btrfs]], [https://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs@kernel.org], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARCH-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia]&lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|Maintenance|When using snapshots, you must be particularly careful not to use up all the space on the file system -&amp;gt; [[Btrfs#Out_of_space]]}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd0&amp;gt;{{UserCmd|command=pamac install btrfs-progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReiserFS → reiser4 === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
ReiserFS was the first journaling filesystem to be included in the standard kernel. It was actively used by some distros some time ago, but is not currently widely used. Reiser4 is the successor to ReiserFS(3). However, Reiser4 seems not to be integrated in the kernel yet. &lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|As of kernel 6.13|reiserFS will no longer be supported.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/Reiser4 Reiser4@ARCH-wiki], [https://en.wikipedia.org/wiki/ReiserFS ReiserFS@wikipedia], [https://en.wikipedia.org/wiki/Reiser4 Reiser4@wikipedia], [https://reiser4.wiki.kernel.org/ Reiser4@kernel.org]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd2&amp;gt;{{UserCmd|command=pamac install reiserfsprogs reiser4progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Windows == &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
filesystems mostly used in windows&lt;br /&gt;
&lt;br /&gt;
=== NTFS === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
It is the most widely used filesystem on windows these days. It does exist in different versions, but unlike FAT32, all of them offer the following points:&lt;br /&gt;
* Large files&amp;gt; 4GB&lt;br /&gt;
* Long file names with UTF16 up to 255 characters&lt;br /&gt;
* Rights management, ACL&lt;br /&gt;
* Journaling of metadata&lt;br /&gt;
* Compression, encryption, ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Currently there are some restrictions when using NTFS with Linux. If windows is suddenly switched off or goes into hibernating, the NTFS filesystem is left in a &amp;quot;dirty-state&amp;quot;. When Windows starts again, NTFS is the first to be cleaned. This operation is currently not supported by the Linux driver. Then Linux shows the NTFS filesystem as read-only to be on the safe side. The same thing may happen, when NTFS becomes damaged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/NTFS NTFS@ARCH-wiki], [https://en.wikipedia.org/wiki/NTFS NTFS@wikipedia]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
{{BoxWarning|If you regularly switch between Windows and Linux|You should switch off &amp;quot;hibernation&amp;quot;, &amp;quot;Hybrid Boot&amp;quot;, &amp;quot;Fast Boot&amp;quot; in Windows. Then Linux has always full (read / write) access to NTFS drives.&lt;br /&gt;
* [https://forum.manjaro.org/t/all-of-my-files-are-in-read-only-mode/83777/7 all-of-my-files-are-in-read-only-mode@forum]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{BoxDanger|If your NTFS file system becomes corrupted|It is strongly recommended that you only repair the file system using the original Windows tools. Anything else is highly risky.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd3&amp;gt;{{UserCmd|command=pamac install ntfs-3g}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DOS == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
filesystems under DOS and early windows on a lot of floppydisks and USB-sticks&lt;br /&gt;
&lt;br /&gt;
=== FAT16 → FAT32 (+VFAT) === &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
This is a traditional filesystem under DOS and early Windows versions. Even today it can be found on many floppy disks, USB sticks and hard drives. It is supported by all types of operating systems and is therefore often used to exchange files, to pass them on, or to keep them accessible to both operating systems in the case of dualboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
Even with FAT32, this comes not without its disadvantages.&lt;br /&gt;
* no support for user rights or xattr&lt;br /&gt;
* severely restricted file names (8.3 or LFN for VFAT, no distinction between lowercase and uppercase)&lt;br /&gt;
* no files over 2GB (FAT16) 4GB (FAT32)&lt;br /&gt;
* no journaling&lt;br /&gt;
* not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
{{warning | FAT Filesystems do not use journaling. Data on such filesystems is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/FAT FAT@ARCH-wiki], [https://en.wikipedia.org/wiki/File_Allocation_Table FAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd4&amp;gt;{{UserCmd|command=pamac install dosfstools}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== exFAT === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Microsoft developed the exFAT (Extended File Allocation Table) in 2006 and optimized it for flash memories such as USB sticks and SD cards. It can store large files and large numbers of files, and it can manage very large partitions. It is supported by Linux, Windows, macOS and many other devices and is one of the most compatible filesystems. ExFAT is included in Linux 5.4 and higher.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
* Flash friendly&lt;br /&gt;
* No support for user rights or xattr&lt;br /&gt;
* Files over 4 GB&lt;br /&gt;
* Checksums for metadata&lt;br /&gt;
* No journal&lt;br /&gt;
* Not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning | exFAT FS does not use journaling. Data on such a filesystem is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/ExFAT ExFAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd5&amp;gt;{{UserCmd|command=pamac install exfatprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== macOS == &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
Filesystems mostly used in macOS&lt;br /&gt;
&lt;br /&gt;
=== HFS → HFS+ === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/HFS_Plus HFSPlus@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install from AUR==== &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd6&amp;gt;{{UserCmd|command=pamac install hfsprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Others == &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XFS === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/XFS XFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
===ZFS=== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/ZFS ZFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
==Comparisions== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt; Possible usage of Filesystems&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Filesystem!!Manjaro!!Win10!!OSX!!Win9x, DOS&lt;br /&gt;
|-&lt;br /&gt;
|ext2||●||▷ ExtFS||●||&lt;br /&gt;
|-&lt;br /&gt;
|ext3/4||●||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|btrfs||● btrfs-progs||▷ ExtFS, WinBtrfs||-||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser3||● reiser4progs||▷ RFSTool||?||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser4||○ reiserfs||?||?||-&lt;br /&gt;
|-&lt;br /&gt;
|NTFS||○ ntfs-3g&amp;lt;br&amp;gt;▶ 5.15?? ntfs3||●||?||&lt;br /&gt;
|-&lt;br /&gt;
|FAT32||● dosfstools||●||●||●&lt;br /&gt;
|-&lt;br /&gt;
|exFAT||▶ 5.4 exfatprogs||●||?||?&lt;br /&gt;
|-&lt;br /&gt;
|HFS||○ hfsprogs (AUR)||?||●||&lt;br /&gt;
|-&lt;br /&gt;
|XFS||?||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|ZFS||?||?||?||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
● = fully supported, additional tools to install&lt;br /&gt;
 ▶ = included since kernel x.x.x &lt;br /&gt;
 ○ = partially supported&lt;br /&gt;
 ▷ = possible via external tools&lt;br /&gt;
 ? = feel free to extend ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Some important properties&lt;br /&gt;
|-&lt;br /&gt;
! Properties !!ext2!!ext3!!ext4!!btrfs||reiserfs(3)||XFS&lt;br /&gt;
|-&lt;br /&gt;
|journaling ||-||● ordered||● ordered||● full||▶ 2.6||●&lt;br /&gt;
|-&lt;br /&gt;
|barriers ||-||||●||●&lt;br /&gt;
|-&lt;br /&gt;
|checksum ||-||-||◎ metadata||● full||●&lt;br /&gt;
|-&lt;br /&gt;
|kompression||-||-||-||●,&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;zstd ▶ 4.14/5.1&amp;lt;/small&amp;gt;||&lt;br /&gt;
|-&lt;br /&gt;
|encryption||-||-||▶ 4.13||-&lt;br /&gt;
|-&lt;br /&gt;
|snapshots||-||-||-||●||-&lt;br /&gt;
|-&lt;br /&gt;
|TRIM possible||-||-||▶ 2.6.33||▶ 4.3&lt;br /&gt;
|-&lt;br /&gt;
|xattr, ACL||◎||?||ACL||ACL||ACL&lt;br /&gt;
|-&lt;br /&gt;
|small repair||● fsck||● fsck||● fsck||● auto||reiserfsck&lt;br /&gt;
|-&lt;br /&gt;
|journal repair||● fsck||● fsck||● fsck||● auto 3.2||&lt;br /&gt;
|-&lt;br /&gt;
|repair after power loss||-||?||● tune2fs, fsck||● auto, scrub||&lt;br /&gt;
|-&lt;br /&gt;
|since||1993||2001||2008||2009||2001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=See also= &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/ExFAT Wikipedia:exFAT]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/Comparison_of_file_systems Wikipedia:Comparison of filesystems]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://wiki.archlinux.org/index.php/Filesystems Archwiki:filesystems]&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:filesystems{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=55066</id>
		<title>File Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=55066"/>
		<updated>2025-11-18T15:31:02Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: changed default filesystem for manjaro&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This page provides information on some of the filesystems commonly used in Manjaro. It also shows where and how they are used. Further information on these and other filesystems can be found in the ARCH Wiki.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
A filesystem manages the space on a storage medium (hard disk, SSD ...). It makes this memory available to the operating system so that files can be saved and read again. Each of the following filesystems has advantages and disadvantages. They are mostly developed for a special purpose and are therefore used in a certain environment.&lt;br /&gt;
&lt;br /&gt;
== Linux == &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
filesystems that are mostly used under Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Note that many filesystem drivers are already included in the Linux kernel. You may not need anything else to mount, read, or write these filesystems. But there are packages with additional tools. You may need them to format, check, repair, modify, or optimize such filesystems. So if you regularly use a filesystem, it is a good idea to install the appropriate tools.&lt;br /&gt;
&lt;br /&gt;
=== Ext2 → Ext3 → Ext4 === &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Ext4 is the default filesystem in Manjaro at the moment. It is the evolution of the most used Linux filesystems (Ext3, Ext2) and promises improved design, better performance, reliability, and features over its predecessors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
If you are using Ext2 or Ext3, you can convert the partition to Ext4. Ext4 uses journaling, checksums and write barriers and is therefore more robust against damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Currently Ext4 is fully supported in Win10 and OsX. Support for ext4 has been built in since WSL is included in Win10 (2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
see [https://ext4.wiki.kernel.org/ Ext4@kernel.org], [https://wiki.archlinux.org/title/Ext4 Ext4@ARCH-wiki], [https://de.wikipedia.org/wiki/Ext4 Ext4@wikipedia] &lt;br /&gt;
&amp;lt;br&amp;gt;For advanced optimizations see  [https://wiki.archlinux.org/index.php/Ext4#Improving_performance Improving Ext4 performance@Archwiki].&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
In Manjaro, e2fsprogs is already installed&lt;br /&gt;
&lt;br /&gt;
===[[Btrfs]]=== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite filesystem for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. [[Btrfs]] not only is a filesystem, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[[Btrfs]] is now the default file system in Manjaro. Because [[Btrfs]] works differently, some things may seem unfamiliar and strange. The [[Btrfs]] page is therefore a good starting point for finding answers and gaining a better understanding of [[Btrfs]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Self-healing&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruptions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
see [[Btrfs]], [https://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs@kernel.org], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARCH-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia]&lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|Maintenance|When using snapshots, you must be particularly careful not to use up all the space on the file system -&amp;gt; [[Btrfs#Out_of_space]]}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd0&amp;gt;{{UserCmd|command=pamac install btrfs-progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReiserFS → reiser4 === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
ReiserFS was the first journaling filesystem to be included in the standard kernel. It was actively used by some distros some time ago, but is not currently widely used. Reiser4 is the successor to ReiserFS(3). However, Reiser4 seems not to be integrated in the kernel yet. &lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|As of kernel 6.13|reiserFS will no longer be supported.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/Reiser4 Reiser4@ARCH-wiki], [https://en.wikipedia.org/wiki/ReiserFS ReiserFS@wikipedia], [https://en.wikipedia.org/wiki/Reiser4 Reiser4@wikipedia], [https://reiser4.wiki.kernel.org/ Reiser4@kernel.org]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd2&amp;gt;{{UserCmd|command=pamac install reiserfsprogs reiser4progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Windows == &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
filesystems mostly used in windows&lt;br /&gt;
&lt;br /&gt;
=== NTFS === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
It is the most widely used filesystem on windows these days. It does exist in different versions, but unlike FAT32, all of them offer the following points:&lt;br /&gt;
* Large files&amp;gt; 4GB&lt;br /&gt;
* Long file names with UTF16 up to 255 characters&lt;br /&gt;
* Rights management, ACL&lt;br /&gt;
* Journaling of metadata&lt;br /&gt;
* Compression, encryption, ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Currently there are some restrictions when using NTFS with Linux. If windows is suddenly switched off or goes into hibernating, the NTFS filesystem is left in a &amp;quot;dirty-state&amp;quot;. When Windows starts again, NTFS is the first to be cleaned. This operation is currently not supported by the Linux driver. Then Linux shows the NTFS filesystem as read-only to be on the safe side. The same thing may happen, when NTFS becomes damaged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/NTFS NTFS@ARCH-wiki], [https://en.wikipedia.org/wiki/NTFS NTFS@wikipedia]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
{{BoxWarning|If you regularly switch between Windows and Linux|You should switch off &amp;quot;hibernation&amp;quot;, &amp;quot;Hybrid Boot&amp;quot;, &amp;quot;Fast Boot&amp;quot; in Windows. Then Linux has always full (read / write) access to NTFS drives.&lt;br /&gt;
* [https://forum.manjaro.org/t/all-of-my-files-are-in-read-only-mode/83777/7 all-of-my-files-are-in-read-only-mode@forum]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{BoxDanger|If your NTFS file system becomes corrupted|It is strongly recommended that you only repair the file system using the original Windows tools. Anything else is highly risky.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd3&amp;gt;{{UserCmd|command=pamac install ntfs-3g}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DOS == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
filesystems under DOS and early windows on a lot of floppydisks and USB-sticks&lt;br /&gt;
&lt;br /&gt;
=== FAT16 → FAT32 (+VFAT) === &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
This is a traditional filesystem under DOS and early Windows versions. Even today it can be found on many floppy disks, USB sticks and hard drives. It is supported by all types of operating systems and is therefore often used to exchange files, to pass them on, or to keep them accessible to both operating systems in the case of dualboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
Even with FAT32, this comes not without its disadvantages.&lt;br /&gt;
* no support for user rights or xattr&lt;br /&gt;
* severely restricted file names (8.3 or LFN for VFAT, no distinction between lowercase and uppercase)&lt;br /&gt;
* no files over 2GB (FAT16) 4GB (FAT32)&lt;br /&gt;
* no journaling&lt;br /&gt;
* not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
{{warning | FAT Filesystems do not use journaling. Data on such filesystems is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/FAT FAT@ARCH-wiki], [https://en.wikipedia.org/wiki/File_Allocation_Table FAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd4&amp;gt;{{UserCmd|command=pamac install dosfstools}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== exFAT === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Microsoft developed the exFAT (Extended File Allocation Table) in 2006 and optimized it for flash memories such as USB sticks and SD cards. It can store large files and large numbers of files, and it can manage very large partitions. It is supported by Linux, Windows, macOS and many other devices and is one of the most compatible filesystems. ExFAT is included in Linux 5.4 and higher.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
* Flash friendly&lt;br /&gt;
* No support for user rights or xattr&lt;br /&gt;
* Files over 4 GB&lt;br /&gt;
* Checksums for metadata&lt;br /&gt;
* No journal&lt;br /&gt;
* Not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning | exFAT FS does not use journaling. Data on such a filesystem is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/ExFAT ExFAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd5&amp;gt;{{UserCmd|command=pamac install exfatprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== macOS == &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
Filesystems mostly used in macOS&lt;br /&gt;
&lt;br /&gt;
=== HFS → HFS+ === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/HFS_Plus HFSPlus@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install from AUR==== &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd6&amp;gt;{{UserCmd|command=pamac install hfsprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Others == &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XFS === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/XFS XFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
===ZFS=== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/ZFS ZFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
==Comparisions== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt; Possible usage of Filesystems&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Filesystem!!Manjaro!!Win10!!OSX!!Win9x, DOS&lt;br /&gt;
|-&lt;br /&gt;
|ext2||●||▷ ExtFS||●||&lt;br /&gt;
|-&lt;br /&gt;
|ext3/4||●||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|btrfs||● btrfs-progs||▷ ExtFS, WinBtrfs||-||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser3||● reiser4progs||▷ RFSTool||?||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser4||○ reiserfs||?||?||-&lt;br /&gt;
|-&lt;br /&gt;
|NTFS||○ ntfs-3g&amp;lt;br&amp;gt;▶ 5.15?? ntfs3||●||?||&lt;br /&gt;
|-&lt;br /&gt;
|FAT32||● dosfstools||●||●||●&lt;br /&gt;
|-&lt;br /&gt;
|exFAT||▶ 5.4 exfatprogs||●||?||?&lt;br /&gt;
|-&lt;br /&gt;
|HFS||○ hfsprogs (AUR)||?||●||&lt;br /&gt;
|-&lt;br /&gt;
|XFS||?||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|ZFS||?||?||?||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
● = fully supported, additional tools to install&lt;br /&gt;
 ▶ = included since kernel x.x.x &lt;br /&gt;
 ○ = partially supported&lt;br /&gt;
 ▷ = possible via external tools&lt;br /&gt;
 ? = feel free to extend ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Some important properties&lt;br /&gt;
|-&lt;br /&gt;
! Properties !!ext2!!ext3!!ext4!!btrfs||reiserfs(3)||XFS&lt;br /&gt;
|-&lt;br /&gt;
|journaling ||-||● ordered||● ordered||● full||▶ 2.6||●&lt;br /&gt;
|-&lt;br /&gt;
|barriers ||-||||●||●&lt;br /&gt;
|-&lt;br /&gt;
|checksum ||-||-||◎ metadata||● full||●&lt;br /&gt;
|-&lt;br /&gt;
|kompression||-||-||-||●,&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;zstd ▶ 4.14/5.1&amp;lt;/small&amp;gt;||&lt;br /&gt;
|-&lt;br /&gt;
|encryption||-||-||▶ 4.13||-&lt;br /&gt;
|-&lt;br /&gt;
|snapshots||-||-||-||●||-&lt;br /&gt;
|-&lt;br /&gt;
|TRIM possible||-||-||▶ 2.6.33||▶ 4.3&lt;br /&gt;
|-&lt;br /&gt;
|xattr, ACL||◎||?||ACL||ACL||ACL&lt;br /&gt;
|-&lt;br /&gt;
|small repair||● fsck||● fsck||● fsck||● auto||reiserfsck&lt;br /&gt;
|-&lt;br /&gt;
|journal repair||● fsck||● fsck||● fsck||● auto 3.2||&lt;br /&gt;
|-&lt;br /&gt;
|repair after power loss||-||?||● tune2fs, fsck||● auto, scrub||&lt;br /&gt;
|-&lt;br /&gt;
|since||1993||2001||2008||2009||2001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=See also= &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/ExFAT Wikipedia:exFAT]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/Comparison_of_file_systems Wikipedia:Comparison of filesystems]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://wiki.archlinux.org/index.php/Filesystems Archwiki:filesystems]&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:filesystems{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54912</id>
		<title>Pamac</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54912"/>
		<updated>2025-10-02T15:06:54Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: added &amp;quot;only&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Overview= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Pamac (Add/Remove Software) is Manjaro&amp;#039;s Package Manager.  It is based on libalpm with AUR and Appstream support.  It focuses on providing an easy to use interface while still providing a powerful set of features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-main.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
=Installing Pamac= &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Pamac is pre-installed on many Manjaro Editions but if your system does not have it it can be easily installed.  Pamac comes in several different packages:&lt;br /&gt;
* {{ic|pamac-gtk}} - The GTK version of pamac.  Includes a tray icon for many desktops.&lt;br /&gt;
* {{ic|pamac-cli}} - The command line version of pamac.&lt;br /&gt;
* {{ic|pamac-tray-icon-plasma}} - A tray icon for KDE plasma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
These packages can be installed using pacman.  For example, to install the GTK version, you can use the command:&lt;br /&gt;
{{UserCmd|command=sudo pacman -Syu pamac-gtk}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
{{BoxSuccess|tip|Both the GTK and Qt pamac packages will automatically install the CLI version as well}}&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac GUI= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Software== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To install packages, simply check the box next to the packages.  Once you have selected all the packages you want to install, click the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
If any of the packages have optional dependencies (packages that enable additional functionality) you will see a window like the one to the left which allows to select the ones you would like to install.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
After you have selected optional dependencies, you should see a window similar to the one pictured on the left.  This lists all the packages that will be installed, upgraded or removed by the action.  Once you have reviewed the list, press the Apply button to install the packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn&amp;#039;t select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Removing Software== &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the Transaction Summary before accepting the package removal.|  Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Preferences== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The General tab of preferences contains several settings, most of which are self-explanatory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package&lt;br /&gt;
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages&lt;br /&gt;
* Maximum parallel downloads - The number of concurrent downloads allowed&lt;br /&gt;
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].&lt;br /&gt;
* Check for updates - Disabling this will stop pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.&lt;br /&gt;
* Ignore updates for - This is a list of packages that you don&amp;#039;t want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
{{BoxWarning|Ignoring updates for individual packages will leave you in an unsupported &amp;quot;partial upgrade&amp;quot; state.|  It is common for innocuous looking ignored packages to leave your system unbootable}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== AUR (Arch User Repository) ==== &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you enable AUR support, you may also select, &amp;quot;Check for updates from AUR&amp;quot; so software you install from AUR won&amp;#039;t become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Checking for &amp;quot;development package&amp;quot; updates will allow updates on *-git packages which are built from the latest source code to also be updated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{BoxWarning| Any use of the AUR is at your own risk.|&amp;#039;&amp;#039;&amp;#039;DISCLAIMER:&amp;#039;&amp;#039;&amp;#039; AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The &amp;quot;Build directory&amp;quot; is where AUR packages will be built.  Using &amp;quot;tmp&amp;quot; usually will provide the best performance but very large packages may fail to build.  In this case, select a location with more available space.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded.  This cache can be very useful if you have to install older packages in an emergency.  However, left unchecked, this cache will grow very large over time.  These preferences allow your cache to be automatically managed based on your preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to &amp;quot;3&amp;quot;, only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
By selecting &amp;quot;Remove only the versions of uninstalled packages&amp;quot;, pamac will retain all versions of packages you still have installed.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac CLI= &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Pamac also includes a fully functional CLI for when you don&amp;#039;t have a working GUI or for those that prefer to manage packages that way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{BoxWarning|Do not use sudo with pamac.|Using sudo with pamac can have undesirable effects, especially when building packages. It also can lead to Permission issues with the database. Pamac will ask for escalated rights only if needed.}}&lt;br /&gt;
&lt;br /&gt;
==Locating and Installing Packages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1    community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2  community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1  community &lt;br /&gt;
  Themes for SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search -a smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1         community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2       community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1       community &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
papirus-smplayer-theme-git&lt;br /&gt;
20181024-2       AUR &lt;br /&gt;
  Papirus theme for SMPlayer (git version)&lt;br /&gt;
smplayer-svn&lt;br /&gt;
17.12.0.r8852-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV&lt;br /&gt;
smplayer-svn-notitlebar&lt;br /&gt;
18.3.0.r8982M-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode&lt;br /&gt;
smplayer-skins-svn&lt;br /&gt;
15.2.0.r8852-1   AUR &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes-svn&lt;br /&gt;
17.3.0.r8852-1   AUR &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
smplayer-qt4&lt;br /&gt;
18.5.0-1         AUR &lt;br /&gt;
  Complete front-end for MPlayer/MPV (Qt4)&lt;br /&gt;
rosa-media-player-plugin&lt;br /&gt;
1.0-2            AUR &lt;br /&gt;
  The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).&lt;br /&gt;
smplayer-theme-faenza (Out of Date: 09/15/2017)&lt;br /&gt;
2-2              AUR &lt;br /&gt;
  Normal, dark and silver faenza theme for smplayer.&lt;br /&gt;
umplayer&lt;br /&gt;
0.98.2-2         AUR &lt;br /&gt;
  An alternative to SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Once you have identified the packages you wish to install, you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:&lt;br /&gt;
{{UserCmd|command=pamac install smplayer smplayer-themes}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|When using install, pamac will check to see if packages are installed and only install the ones not already installed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac build umplayer}}&lt;br /&gt;
&lt;br /&gt;
==Removing Packages== &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example, if you wanted to remove all the packages installed above, you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove smplayer smplayer-themes umplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the list of packages before confirming.|Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&lt;br /&gt;
==Identifying Installed Packages== &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
To display a list of all installed packages, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac list -i}}&lt;br /&gt;
&lt;br /&gt;
==Displaying Detailed Package Information== &amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
To display detailed information on a package that is in the repos or installed on your system, use the command {{ic|pamac info}}.  Keeping with our example of SMPlayer :&lt;br /&gt;
{{UserCmd|command=pamac info smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
If you also would like to check packages in [[Arch_User_Repository|AUR]], you could use:&lt;br /&gt;
{{UserCmd|command=pamac info -a smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Updating the System== &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
To check if updates are available, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac checkupdates -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]], you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac upgrade -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
{{BoxInfo|update / upgrade|pamac update and pamac upgrade are exactly the same.  You can use them interchangeably.}}&lt;br /&gt;
&lt;br /&gt;
==Dealing with Orphaned Packages== &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:&lt;br /&gt;
{{UserCmd|command=pamac list -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
To remove all orphans use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cleaning the Cache== &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Otherwise, to clear the cache completely, enter the following command (and use with care):&lt;br /&gt;
{{UserCmd|command=pamac clean}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:&lt;br /&gt;
{{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Useful Pamac Functions== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac search -f /usr/bin/smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
To force a package to be installed even if it is already installed, use {{ic|pamac reinstall}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac reinstall smplayer}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54835</id>
		<title>Pamac</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54835"/>
		<updated>2025-10-01T12:17:23Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: warning shortend&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Overview= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Pamac (Add/Remove Software) is Manjaro&amp;#039;s Package Manager.  It is based on libalpm with AUR and Appstream support.  It focuses on providing an easy to use interface while still providing a powerful set of features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-main.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
=Installing Pamac= &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Pamac is pre-installed on many Manjaro Editions but if your system does not have it it can be easily installed.  Pamac comes in several different packages:&lt;br /&gt;
* {{ic|pamac-gtk}} - The GTK version of pamac.  Includes a tray icon for many desktops.&lt;br /&gt;
* {{ic|pamac-cli}} - The command line version of pamac.&lt;br /&gt;
* {{ic|pamac-tray-icon-plasma}} - A tray icon for KDE plasma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
These packages can be installed using pacman.  For example, to install the GTK version, you can use the command:&lt;br /&gt;
{{UserCmd|command=sudo pacman -Syu pamac-gtk}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
{{BoxSuccess|tip|Both the GTK and Qt pamac packages will automatically install the CLI version as well}}&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac GUI= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Software== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To install packages, simply check the box next to the packages.  Once you have selected all the packages you want to install, click the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
If any of the packages have optional dependencies (packages that enable additional functionality) you will see a window like the one to the left which allows to select the ones you would like to install.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
After you have selected optional dependencies, you should see a window similar to the one pictured on the left.  This lists all the packages that will be installed, upgraded or removed by the action.  Once you have reviewed the list, press the Apply button to install the packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn&amp;#039;t select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Removing Software== &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the Transaction Summary before accepting the package removal.|  Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Preferences== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The General tab of preferences contains several settings, most of which are self-explanatory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package&lt;br /&gt;
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages&lt;br /&gt;
* Maximum parallel downloads - The number of concurrent downloads allowed&lt;br /&gt;
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].&lt;br /&gt;
* Check for updates - Disabling this will stop pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.&lt;br /&gt;
* Ignore updates for - This is a list of packages that you don&amp;#039;t want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
{{BoxWarning|Ignoring updates for individual packages will leave you in an unsupported &amp;quot;partial upgrade&amp;quot; state.|  It is common for innocuous looking ignored packages to leave your system unbootable}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== AUR (Arch User Repository) ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you enable AUR support, you may also select, &amp;quot;Check for updates from AUR&amp;quot; so software you install from AUR won&amp;#039;t become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Checking for &amp;quot;development package&amp;quot; updates will allow updates on *-git packages which are built from the latest source code to also be updated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{BoxWarning| Any use of the AUR is at your own risk.|&amp;#039;&amp;#039;&amp;#039;DISCLAIMER:&amp;#039;&amp;#039;&amp;#039; AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The &amp;quot;Build directory&amp;quot; is where AUR packages will be built.  Using &amp;quot;tmp&amp;quot; usually will provide the best performance but very large packages may fail to build.  In this case, select a location with more available space.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded.  This cache can be very useful if you have to install older packages in an emergency.  However, left unchecked, this cache will grow very large over time.  These preferences allow your cache to be automatically managed based on your preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to &amp;quot;3&amp;quot;, only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
By selecting &amp;quot;Remove only the versions of uninstalled packages&amp;quot;, pamac will retain all versions of packages you still have installed.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac CLI= &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Pamac also includes a fully functional CLI for when you don&amp;#039;t have a working GUI or for those that prefer to manage packages that way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{BoxWarning|Do not use sudo with pamac.|Using sudo with pamac can have undesirable effects, especially when building packages. It also can lead to Permission issues with the database. Pamac will ask for escalated rights if needed.}}&lt;br /&gt;
&lt;br /&gt;
==Locating and Installing Packages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1    community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2  community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1  community &lt;br /&gt;
  Themes for SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search -a smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1         community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2       community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1       community &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
papirus-smplayer-theme-git&lt;br /&gt;
20181024-2       AUR &lt;br /&gt;
  Papirus theme for SMPlayer (git version)&lt;br /&gt;
smplayer-svn&lt;br /&gt;
17.12.0.r8852-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV&lt;br /&gt;
smplayer-svn-notitlebar&lt;br /&gt;
18.3.0.r8982M-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode&lt;br /&gt;
smplayer-skins-svn&lt;br /&gt;
15.2.0.r8852-1   AUR &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes-svn&lt;br /&gt;
17.3.0.r8852-1   AUR &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
smplayer-qt4&lt;br /&gt;
18.5.0-1         AUR &lt;br /&gt;
  Complete front-end for MPlayer/MPV (Qt4)&lt;br /&gt;
rosa-media-player-plugin&lt;br /&gt;
1.0-2            AUR &lt;br /&gt;
  The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).&lt;br /&gt;
smplayer-theme-faenza (Out of Date: 09/15/2017)&lt;br /&gt;
2-2              AUR &lt;br /&gt;
  Normal, dark and silver faenza theme for smplayer.&lt;br /&gt;
umplayer&lt;br /&gt;
0.98.2-2         AUR &lt;br /&gt;
  An alternative to SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Once you have identified the packages you wish to install, you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:&lt;br /&gt;
{{UserCmd|command=pamac install smplayer smplayer-themes}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|When using install, pamac will check to see if packages are installed and only install the ones not already installed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac build umplayer}}&lt;br /&gt;
&lt;br /&gt;
==Removing Packages== &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example, if you wanted to remove all the packages installed above, you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove smplayer smplayer-themes umplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the list of packages before confirming.|Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&lt;br /&gt;
==Identifying Installed Packages== &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
To display a list of all installed packages, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac list -i}}&lt;br /&gt;
&lt;br /&gt;
==Displaying Detailed Package Information== &amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
To display detailed information on a package that is in the repos or installed on your system, use the command {{ic|pamac info}}.  Keeping with our example of SMPlayer :&lt;br /&gt;
{{UserCmd|command=pamac info smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
If you also would like to check packages in [[Arch_User_Repository|AUR]], you could use:&lt;br /&gt;
{{UserCmd|command=pamac info -a smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Updating the System== &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
To check if updates are available, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac checkupdates -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]], you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac upgrade -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
{{BoxInfo|update / upgrade|pamac update and pamac upgrade are exactly the same.  You can use them interchangeably.}}&lt;br /&gt;
&lt;br /&gt;
==Dealing with Orphaned Packages== &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:&lt;br /&gt;
{{UserCmd|command=pamac list -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
To remove all orphans use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cleaning the Cache== &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Otherwise, to clear the cache completely, enter the following command (and use with care):&lt;br /&gt;
{{UserCmd|command=pamac clean}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:&lt;br /&gt;
{{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Useful Pamac Functions== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac search -f /usr/bin/smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
To force a package to be installed even if it is already installed, use {{ic|pamac reinstall}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac reinstall smplayer}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54834</id>
		<title>Pamac</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54834"/>
		<updated>2025-10-01T12:15:17Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: info changed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Overview= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Pamac (Add/Remove Software) is Manjaro&amp;#039;s Package Manager.  It is based on libalpm with AUR and Appstream support.  It focuses on providing an easy to use interface while still providing a powerful set of features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-main.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
=Installing Pamac= &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Pamac is pre-installed on many Manjaro Editions but if your system does not have it it can be easily installed.  Pamac comes in several different packages:&lt;br /&gt;
* {{ic|pamac-gtk}} - The GTK version of pamac.  Includes a tray icon for many desktops.&lt;br /&gt;
* {{ic|pamac-cli}} - The command line version of pamac.&lt;br /&gt;
* {{ic|pamac-tray-icon-plasma}} - A tray icon for KDE plasma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
These packages can be installed using pacman.  For example, to install the GTK version, you can use the command:&lt;br /&gt;
{{UserCmd|command=sudo pacman -Syu pamac-gtk}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
{{BoxSuccess|tip|Both the GTK and Qt pamac packages will automatically install the CLI version as well}}&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac GUI= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Software== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To install packages, simply check the box next to the packages.  Once you have selected all the packages you want to install, click the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
If any of the packages have optional dependencies (packages that enable additional functionality) you will see a window like the one to the left which allows to select the ones you would like to install.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
After you have selected optional dependencies, you should see a window similar to the one pictured on the left.  This lists all the packages that will be installed, upgraded or removed by the action.  Once you have reviewed the list, press the Apply button to install the packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn&amp;#039;t select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Removing Software== &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the Transaction Summary before accepting the package removal.|  Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Preferences== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The General tab of preferences contains several settings, most of which are self-explanatory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package&lt;br /&gt;
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages&lt;br /&gt;
* Maximum parallel downloads - The number of concurrent downloads allowed&lt;br /&gt;
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].&lt;br /&gt;
* Check for updates - Disabling this will stop pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.&lt;br /&gt;
* Ignore updates for - This is a list of packages that you don&amp;#039;t want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
{{BoxWarning|Ignoring updates for individual packages will leave you in an unsupported &amp;quot;partial upgrade&amp;quot; state.|  It is common for innocuous looking ignored packages to leave your system unbootable}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== AUR (Arch User Repository) ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you enable AUR support, you may also select, &amp;quot;Check for updates from AUR&amp;quot; so software you install from AUR won&amp;#039;t become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Checking for &amp;quot;development package&amp;quot; updates will allow updates on *-git packages which are built from the latest source code to also be updated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{BoxWarning| Any use of the AUR is at your own risk.|&amp;#039;&amp;#039;&amp;#039;DISCLAIMER:&amp;#039;&amp;#039;&amp;#039; AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The &amp;quot;Build directory&amp;quot; is where AUR packages will be built.  Using &amp;quot;tmp&amp;quot; usually will provide the best performance but very large packages may fail to build.  In this case, select a location with more available space.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded.  This cache can be very useful if you have to install older packages in an emergency.  However, left unchecked, this cache will grow very large over time.  These preferences allow your cache to be automatically managed based on your preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to &amp;quot;3&amp;quot;, only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
By selecting &amp;quot;Remove only the versions of uninstalled packages&amp;quot;, pamac will retain all versions of packages you still have installed.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac CLI= &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Pamac also includes a fully functional CLI for when you don&amp;#039;t have a working GUI or for those that prefer to manage packages that way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{BoxWarning|Do not use sudo with pamac.|Using sudo with pamac can have undesirable effects, especially when building packages. It also can lead to Permission issues with the database. Pamac will ask for escalated rights if needed.}}&lt;br /&gt;
&lt;br /&gt;
==Locating and Installing Packages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1    community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2  community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1  community &lt;br /&gt;
  Themes for SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search -a smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1         community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2       community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1       community &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
papirus-smplayer-theme-git&lt;br /&gt;
20181024-2       AUR &lt;br /&gt;
  Papirus theme for SMPlayer (git version)&lt;br /&gt;
smplayer-svn&lt;br /&gt;
17.12.0.r8852-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV&lt;br /&gt;
smplayer-svn-notitlebar&lt;br /&gt;
18.3.0.r8982M-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode&lt;br /&gt;
smplayer-skins-svn&lt;br /&gt;
15.2.0.r8852-1   AUR &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes-svn&lt;br /&gt;
17.3.0.r8852-1   AUR &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
smplayer-qt4&lt;br /&gt;
18.5.0-1         AUR &lt;br /&gt;
  Complete front-end for MPlayer/MPV (Qt4)&lt;br /&gt;
rosa-media-player-plugin&lt;br /&gt;
1.0-2            AUR &lt;br /&gt;
  The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).&lt;br /&gt;
smplayer-theme-faenza (Out of Date: 09/15/2017)&lt;br /&gt;
2-2              AUR &lt;br /&gt;
  Normal, dark and silver faenza theme for smplayer.&lt;br /&gt;
umplayer&lt;br /&gt;
0.98.2-2         AUR &lt;br /&gt;
  An alternative to SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Once you have identified the packages you wish to install, you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:&lt;br /&gt;
{{UserCmd|command=pamac install smplayer smplayer-themes}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|When using install, pamac will check to see if packages are installed and only install the ones not already installed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac build umplayer}}&lt;br /&gt;
&lt;br /&gt;
==Removing Packages== &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example, if you wanted to remove all the packages installed above, you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove smplayer smplayer-themes umplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the list of packages pamac presents before confirming.|Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Identifying Installed Packages== &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
To display a list of all installed packages, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac list -i}}&lt;br /&gt;
&lt;br /&gt;
==Displaying Detailed Package Information== &amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
To display detailed information on a package that is in the repos or installed on your system, use the command {{ic|pamac info}}.  Keeping with our example of SMPlayer :&lt;br /&gt;
{{UserCmd|command=pamac info smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
If you also would like to check packages in [[Arch_User_Repository|AUR]], you could use:&lt;br /&gt;
{{UserCmd|command=pamac info -a smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Updating the System== &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
To check if updates are available, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac checkupdates -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]], you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac upgrade -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
{{BoxInfo|update / upgrade|pamac update and pamac upgrade are exactly the same.  You can use them interchangeably.}}&lt;br /&gt;
&lt;br /&gt;
==Dealing with Orphaned Packages== &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:&lt;br /&gt;
{{UserCmd|command=pamac list -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
To remove all orphans use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cleaning the Cache== &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Otherwise, to clear the cache completely, enter the following command (and use with care):&lt;br /&gt;
{{UserCmd|command=pamac clean}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:&lt;br /&gt;
{{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Useful Pamac Functions== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac search -f /usr/bin/smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
To force a package to be installed even if it is already installed, use {{ic|pamac reinstall}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac reinstall smplayer}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54833</id>
		<title>Pamac</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54833"/>
		<updated>2025-10-01T12:07:25Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Überschrift für AUR hinzugefügt&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Overview= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Pamac (Add/Remove Software) is Manjaro&amp;#039;s Package Manager.  It is based on libalpm with AUR and Appstream support.  It focuses on providing an easy to use interface while still providing a powerful set of features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-main.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
=Installing Pamac= &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Pamac is pre-installed on many Manjaro Editions but if your system does not have it it can be easily installed.  Pamac comes in several different packages:&lt;br /&gt;
* {{ic|pamac-gtk}} - The GTK version of pamac.  Includes a tray icon for many desktops.&lt;br /&gt;
* {{ic|pamac-cli}} - The command line version of pamac.&lt;br /&gt;
* {{ic|pamac-tray-icon-plasma}} - A tray icon for KDE plasma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
These packages can be installed using pacman.  For example, to install the GTK version, you can use the command:&lt;br /&gt;
{{UserCmd|command=sudo pacman -Syu pamac-gtk}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
{{BoxSuccess|tip|Both the GTK and Qt pamac packages will automatically install the CLI version as well}}&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac GUI= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Software== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To install packages, simply check the box next to the packages.  Once you have selected all the packages you want to install, click the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
If any of the packages have optional dependencies (packages that enable additional functionality) you will see a window like the one to the left which allows to select the ones you would like to install.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
After you have selected optional dependencies, you should see a window similar to the one pictured on the left.  This lists all the packages that will be installed, upgraded or removed by the action.  Once you have reviewed the list, press the Apply button to install the packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn&amp;#039;t select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Removing Software== &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the Transaction Summary before accepting the package removal.|  Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Preferences== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The General tab of preferences contains several settings, most of which are self-explanatory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package&lt;br /&gt;
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages&lt;br /&gt;
* Maximum parallel downloads - The number of concurrent downloads allowed&lt;br /&gt;
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].&lt;br /&gt;
* Check for updates - Disabling this will stop pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.&lt;br /&gt;
* Ignore updates for - This is a list of packages that you don&amp;#039;t want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
{{BoxWarning|Ignoring updates for individual packages will leave you in an unsupported &amp;quot;partial upgrade&amp;quot; state.|  It is common for innocuous looking ignored packages to leave your system unbootable}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== AUR (Arch User Repository) ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you enable AUR support, you may also select, &amp;quot;Check for updates from AUR&amp;quot; so software you install from AUR won&amp;#039;t become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Checking for &amp;quot;development package&amp;quot; updates will allow updates on *-git packages which are built from the latest source code to also be updated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{BoxWarning| Any use of the AUR is at your own risk.|&amp;#039;&amp;#039;&amp;#039;DISCLAIMER:&amp;#039;&amp;#039;&amp;#039; AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The &amp;quot;Build directory&amp;quot; is where AUR packages will be built.  Using &amp;quot;tmp&amp;quot; usually will provide the best performance but very large packages may fail to build.  In this case, select a location with more available space.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded.  This cache can be very useful if you have to install older packages in an emergency.  However, left unchecked, this cache will grow very large over time.  These preferences allow your cache to be automatically managed based on your preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to &amp;quot;3&amp;quot;, only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
By selecting &amp;quot;Remove only the versions of uninstalled packages&amp;quot;, pamac will retain all versions of packages you still have installed.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac CLI= &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Pamac also includes a fully functional CLI for when you don&amp;#039;t have a working GUI or for those that prefer to manage packages that way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{BoxWarning|Do not use sudo with pamac.|Using sudo with pamac can have undesirable effects, especially when building packages. It also can lead to Permission issues with the database. Pamac will ask for escalated rights if needed.}}&lt;br /&gt;
&lt;br /&gt;
==Locating and Installing Packages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1    community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2  community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1  community &lt;br /&gt;
  Themes for SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search -a smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1         community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2       community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1       community &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
papirus-smplayer-theme-git&lt;br /&gt;
20181024-2       AUR &lt;br /&gt;
  Papirus theme for SMPlayer (git version)&lt;br /&gt;
smplayer-svn&lt;br /&gt;
17.12.0.r8852-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV&lt;br /&gt;
smplayer-svn-notitlebar&lt;br /&gt;
18.3.0.r8982M-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode&lt;br /&gt;
smplayer-skins-svn&lt;br /&gt;
15.2.0.r8852-1   AUR &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes-svn&lt;br /&gt;
17.3.0.r8852-1   AUR &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
smplayer-qt4&lt;br /&gt;
18.5.0-1         AUR &lt;br /&gt;
  Complete front-end for MPlayer/MPV (Qt4)&lt;br /&gt;
rosa-media-player-plugin&lt;br /&gt;
1.0-2            AUR &lt;br /&gt;
  The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).&lt;br /&gt;
smplayer-theme-faenza (Out of Date: 09/15/2017)&lt;br /&gt;
2-2              AUR &lt;br /&gt;
  Normal, dark and silver faenza theme for smplayer.&lt;br /&gt;
umplayer&lt;br /&gt;
0.98.2-2         AUR &lt;br /&gt;
  An alternative to SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Once you have identified the packages you wish to install, you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:&lt;br /&gt;
{{UserCmd|command=pamac install smplayer smplayer-themes}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|When using install, pamac will check to see if packages are installed and only install the ones not already installed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac build umplayer}}&lt;br /&gt;
&lt;br /&gt;
==Removing Packages== &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example, if you wanted to remove all the packages installed above, you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove smplayer smplayer-themes umplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the list of packages pamac presents before confirming.|Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Identifying Installed Packages== &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
To display a list of all installed packages, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac list -i}}&lt;br /&gt;
&lt;br /&gt;
==Displaying Detailed Package Information== &amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
To display detailed information on a package that is in the repos or installed on your system, use the command {{ic|pamac info}}.  Keeping with our example of SMPlayer :&lt;br /&gt;
{{UserCmd|command=pamac info smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
If you also would like to check packages in [[Arch_User_Repository|AUR]], you could use:&lt;br /&gt;
{{UserCmd|command=pamac info -a smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Updating the System== &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
To check if updates are available, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac checkupdates -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]], you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac upgrade -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|pamac update and pamac upgrade are exactly the same.  You can use them interchangeably.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dealing with Orphaned Packages== &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:&lt;br /&gt;
{{UserCmd|command=pamac list -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
To remove all orphans use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cleaning the Cache== &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Otherwise, to clear the cache completely, enter the following command (and use with care):&lt;br /&gt;
{{UserCmd|command=pamac clean}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:&lt;br /&gt;
{{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Useful Pamac Functions== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac search -f /usr/bin/smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
To force a package to be installed even if it is already installed, use {{ic|pamac reinstall}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac reinstall smplayer}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54832</id>
		<title>Pamac</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54832"/>
		<updated>2025-10-01T12:02:22Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: moved warning for AUR, changed wording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Overview= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Pamac (Add/Remove Software) is Manjaro&amp;#039;s Package Manager.  It is based on libalpm with AUR and Appstream support.  It focuses on providing an easy to use interface while still providing a powerful set of features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-main.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
=Installing Pamac= &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Pamac is pre-installed on many Manjaro Editions but if your system does not have it it can be easily installed.  Pamac comes in several different packages:&lt;br /&gt;
* {{ic|pamac-gtk}} - The GTK version of pamac.  Includes a tray icon for many desktops.&lt;br /&gt;
* {{ic|pamac-cli}} - The command line version of pamac.&lt;br /&gt;
* {{ic|pamac-tray-icon-plasma}} - A tray icon for KDE plasma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
These packages can be installed using pacman.  For example, to install the GTK version, you can use the command:&lt;br /&gt;
{{UserCmd|command=sudo pacman -Syu pamac-gtk}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
{{BoxSuccess|tip|Both the GTK and Qt pamac packages will automatically install the CLI version as well}}&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac GUI= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Software== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To install packages, simply check the box next to the packages.  Once you have selected all the packages you want to install, click the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
If any of the packages have optional dependencies (packages that enable additional functionality) you will see a window like the one to the left which allows to select the ones you would like to install.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
After you have selected optional dependencies, you should see a window similar to the one pictured on the left.  This lists all the packages that will be installed, upgraded or removed by the action.  Once you have reviewed the list, press the Apply button to install the packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn&amp;#039;t select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Removing Software== &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the Transaction Summary before accepting the package removal.|  Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Preferences== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The General tab of preferences contains several settings, most of which are self-explanatory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package&lt;br /&gt;
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages&lt;br /&gt;
* Maximum parallel downloads - The number of concurrent downloads allowed&lt;br /&gt;
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].&lt;br /&gt;
* Check for updates - Disabling this will stop pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.&lt;br /&gt;
* Ignore updates for - This is a list of packages that you don&amp;#039;t want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
{{BoxWarning|Ignoring updates for individual packages will leave you in an unsupported &amp;quot;partial upgrade&amp;quot; state.|  It is common for innocuous looking ignored packages to leave your system unbootable}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you enable AUR support, you may also select, &amp;quot;Check for updates from AUR&amp;quot; so software you install from AUR won&amp;#039;t become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Checking for &amp;quot;development package&amp;quot; updates will allow updates on *-git packages which are built from the latest source code to also be updated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{BoxWarning| Any use of the AUR is at your own risk.|&amp;#039;&amp;#039;&amp;#039;DISCLAIMER:&amp;#039;&amp;#039;&amp;#039; AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The &amp;quot;Build directory&amp;quot; is where AUR packages will be built.  Using &amp;quot;tmp&amp;quot; usually will provide the best performance but very large packages may fail to build.  In this case, select a location with more available space.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded.  This cache can be very useful if you have to install older packages in an emergency.  However, left unchecked, this cache will grow very large over time.  These preferences allow your cache to be automatically managed based on your preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to &amp;quot;3&amp;quot;, only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
By selecting &amp;quot;Remove only the versions of uninstalled packages&amp;quot;, pamac will retain all versions of packages you still have installed.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac CLI= &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Pamac also includes a fully functional CLI for when you don&amp;#039;t have a working GUI or for those that prefer to manage packages that way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{BoxWarning|Do not use sudo with pamac.|Using sudo with pamac can have undesirable effects, especially when building packages. It also can lead to Permission issues with the database. Pamac will ask for escalated rights if needed.}}&lt;br /&gt;
&lt;br /&gt;
==Locating and Installing Packages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1    community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2  community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1  community &lt;br /&gt;
  Themes for SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search -a smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1         community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2       community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1       community &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
papirus-smplayer-theme-git&lt;br /&gt;
20181024-2       AUR &lt;br /&gt;
  Papirus theme for SMPlayer (git version)&lt;br /&gt;
smplayer-svn&lt;br /&gt;
17.12.0.r8852-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV&lt;br /&gt;
smplayer-svn-notitlebar&lt;br /&gt;
18.3.0.r8982M-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode&lt;br /&gt;
smplayer-skins-svn&lt;br /&gt;
15.2.0.r8852-1   AUR &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes-svn&lt;br /&gt;
17.3.0.r8852-1   AUR &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
smplayer-qt4&lt;br /&gt;
18.5.0-1         AUR &lt;br /&gt;
  Complete front-end for MPlayer/MPV (Qt4)&lt;br /&gt;
rosa-media-player-plugin&lt;br /&gt;
1.0-2            AUR &lt;br /&gt;
  The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).&lt;br /&gt;
smplayer-theme-faenza (Out of Date: 09/15/2017)&lt;br /&gt;
2-2              AUR &lt;br /&gt;
  Normal, dark and silver faenza theme for smplayer.&lt;br /&gt;
umplayer&lt;br /&gt;
0.98.2-2         AUR &lt;br /&gt;
  An alternative to SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Once you have identified the packages you wish to install, you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:&lt;br /&gt;
{{UserCmd|command=pamac install smplayer smplayer-themes}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|When using install, pamac will check to see if packages are installed and only install the ones not already installed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac build umplayer}}&lt;br /&gt;
&lt;br /&gt;
==Removing Packages== &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example, if you wanted to remove all the packages installed above, you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove smplayer smplayer-themes umplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the list of packages pamac presents before confirming.|Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Identifying Installed Packages== &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
To display a list of all installed packages, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac list -i}}&lt;br /&gt;
&lt;br /&gt;
==Displaying Detailed Package Information== &amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
To display detailed information on a package that is in the repos or installed on your system, use the command {{ic|pamac info}}.  Keeping with our example of SMPlayer :&lt;br /&gt;
{{UserCmd|command=pamac info smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
If you also would like to check packages in [[Arch_User_Repository|AUR]], you could use:&lt;br /&gt;
{{UserCmd|command=pamac info -a smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Updating the System== &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
To check if updates are available, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac checkupdates -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]], you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac upgrade -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|pamac update and pamac upgrade are exactly the same.  You can use them interchangeably.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dealing with Orphaned Packages== &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:&lt;br /&gt;
{{UserCmd|command=pamac list -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
To remove all orphans use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cleaning the Cache== &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Otherwise, to clear the cache completely, enter the following command (and use with care):&lt;br /&gt;
{{UserCmd|command=pamac clean}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:&lt;br /&gt;
{{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Useful Pamac Functions== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac search -f /usr/bin/smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
To force a package to be installed even if it is already installed, use {{ic|pamac reinstall}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac reinstall smplayer}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54831</id>
		<title>Pamac</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54831"/>
		<updated>2025-10-01T11:51:33Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Warning shortened&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Overview= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Pamac (Add/Remove Software) is Manjaro&amp;#039;s Package Manager.  It is based on libalpm with AUR and Appstream support.  It focuses on providing an easy to use interface while still providing a powerful set of features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-main.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
=Installing Pamac= &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Pamac is pre-installed on many Manjaro Editions but if your system does not have it it can be easily installed.  Pamac comes in several different packages:&lt;br /&gt;
* {{ic|pamac-gtk}} - The GTK version of pamac.  Includes a tray icon for many desktops.&lt;br /&gt;
* {{ic|pamac-cli}} - The command line version of pamac.&lt;br /&gt;
* {{ic|pamac-tray-icon-plasma}} - A tray icon for KDE plasma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
These packages can be installed using pacman.  For example, to install the GTK version, you can use the command:&lt;br /&gt;
{{UserCmd|command=sudo pacman -Syu pamac-gtk}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
{{BoxSuccess|tip|Both the GTK and Qt pamac packages will automatically install the CLI version as well}}&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac GUI= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Software== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To install packages, simply check the box next to the packages.  Once you have selected all the packages you want to install, click the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
If any of the packages have optional dependencies (packages that enable additional functionality) you will see a window like the one to the left which allows to select the ones you would like to install.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
After you have selected optional dependencies, you should see a window similar to the one pictured on the left.  This lists all the packages that will be installed, upgraded or removed by the action.  Once you have reviewed the list, press the Apply button to install the packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn&amp;#039;t select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Removing Software== &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the Transaction Summary before accepting the package removal.|  Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Preferences== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The General tab of preferences contains several settings, most of which are self-explanatory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package&lt;br /&gt;
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages&lt;br /&gt;
* Maximum parallel downloads - The number of concurrent downloads allowed&lt;br /&gt;
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].&lt;br /&gt;
* Check for updates - Disabling this will stop pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.&lt;br /&gt;
* Ignore updates for - This is a list of packages that you don&amp;#039;t want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
{{warning|Ignoring updates for individual packages will leave you in an unsupported &amp;quot;partial upgrade&amp;quot; state.  It is common for innocuous looking ignored packages to leave your system unbootable}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning|&amp;#039;&amp;#039;&amp;#039;DISCLAIMER:&amp;#039;&amp;#039;&amp;#039; AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted. Any use of the provided files is at your own risk.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you enable AUR support, you may also select, &amp;quot;Check for updates from AUR&amp;quot; so software you install from AUR won&amp;#039;t become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Checking for &amp;quot;development package&amp;quot; updates will allow updates on *-git packages which are built from the latest source code to also be updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The &amp;quot;Build directory&amp;quot; is where AUR packages will be built.  Using &amp;quot;tmp&amp;quot; usually will provide the best performance but very large packages may fail to build.  In this case, select a location with more available space.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded.  This cache can be very useful if you have to install older packages in an emergency.  However, left unchecked, this cache will grow very large over time.  These preferences allow your cache to be automatically managed based on your preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to &amp;quot;3&amp;quot;, only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
By selecting &amp;quot;Remove only the versions of uninstalled packages&amp;quot;, pamac will retain all versions of packages you still have installed.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac CLI= &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Pamac also includes a fully functional CLI for when you don&amp;#039;t have a working GUI or for those that prefer to manage packages that way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{BoxWarning|Do not use sudo with pamac.|Using sudo with pamac can have undesirable effects, especially when building packages. It also can lead to Permission issues with the database. Pamac will ask for escalated rights if needed.}}&lt;br /&gt;
&lt;br /&gt;
==Locating and Installing Packages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1    community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2  community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1  community &lt;br /&gt;
  Themes for SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search -a smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1         community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2       community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1       community &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
papirus-smplayer-theme-git&lt;br /&gt;
20181024-2       AUR &lt;br /&gt;
  Papirus theme for SMPlayer (git version)&lt;br /&gt;
smplayer-svn&lt;br /&gt;
17.12.0.r8852-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV&lt;br /&gt;
smplayer-svn-notitlebar&lt;br /&gt;
18.3.0.r8982M-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode&lt;br /&gt;
smplayer-skins-svn&lt;br /&gt;
15.2.0.r8852-1   AUR &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes-svn&lt;br /&gt;
17.3.0.r8852-1   AUR &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
smplayer-qt4&lt;br /&gt;
18.5.0-1         AUR &lt;br /&gt;
  Complete front-end for MPlayer/MPV (Qt4)&lt;br /&gt;
rosa-media-player-plugin&lt;br /&gt;
1.0-2            AUR &lt;br /&gt;
  The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).&lt;br /&gt;
smplayer-theme-faenza (Out of Date: 09/15/2017)&lt;br /&gt;
2-2              AUR &lt;br /&gt;
  Normal, dark and silver faenza theme for smplayer.&lt;br /&gt;
umplayer&lt;br /&gt;
0.98.2-2         AUR &lt;br /&gt;
  An alternative to SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Once you have identified the packages you wish to install, you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:&lt;br /&gt;
{{UserCmd|command=pamac install smplayer smplayer-themes}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|When using install, pamac will check to see if packages are installed and only install the ones not already installed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac build umplayer}}&lt;br /&gt;
&lt;br /&gt;
==Removing Packages== &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example, if you wanted to remove all the packages installed above, you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove smplayer smplayer-themes umplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the list of packages pamac presents before confirming.|Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Identifying Installed Packages== &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
To display a list of all installed packages, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac list -i}}&lt;br /&gt;
&lt;br /&gt;
==Displaying Detailed Package Information== &amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
To display detailed information on a package that is in the repos or installed on your system, use the command {{ic|pamac info}}.  Keeping with our example of SMPlayer :&lt;br /&gt;
{{UserCmd|command=pamac info smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
If you also would like to check packages in [[Arch_User_Repository|AUR]], you could use:&lt;br /&gt;
{{UserCmd|command=pamac info -a smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Updating the System== &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
To check if updates are available, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac checkupdates -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]], you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac upgrade -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|pamac update and pamac upgrade are exactly the same.  You can use them interchangeably.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dealing with Orphaned Packages== &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:&lt;br /&gt;
{{UserCmd|command=pamac list -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
To remove all orphans use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cleaning the Cache== &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Otherwise, to clear the cache completely, enter the following command (and use with care):&lt;br /&gt;
{{UserCmd|command=pamac clean}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:&lt;br /&gt;
{{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Useful Pamac Functions== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac search -f /usr/bin/smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
To force a package to be installed even if it is already installed, use {{ic|pamac reinstall}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac reinstall smplayer}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54830</id>
		<title>Pamac</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54830"/>
		<updated>2025-10-01T11:49:35Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: added another reason to the warning&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Overview= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Pamac (Add/Remove Software) is Manjaro&amp;#039;s Package Manager.  It is based on libalpm with AUR and Appstream support.  It focuses on providing an easy to use interface while still providing a powerful set of features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-main.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
=Installing Pamac= &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Pamac is pre-installed on many Manjaro Editions but if your system does not have it it can be easily installed.  Pamac comes in several different packages:&lt;br /&gt;
* {{ic|pamac-gtk}} - The GTK version of pamac.  Includes a tray icon for many desktops.&lt;br /&gt;
* {{ic|pamac-cli}} - The command line version of pamac.&lt;br /&gt;
* {{ic|pamac-tray-icon-plasma}} - A tray icon for KDE plasma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
These packages can be installed using pacman.  For example, to install the GTK version, you can use the command:&lt;br /&gt;
{{UserCmd|command=sudo pacman -Syu pamac-gtk}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
{{BoxSuccess|tip|Both the GTK and Qt pamac packages will automatically install the CLI version as well}}&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac GUI= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Software== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To install packages, simply check the box next to the packages.  Once you have selected all the packages you want to install, click the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
If any of the packages have optional dependencies (packages that enable additional functionality) you will see a window like the one to the left which allows to select the ones you would like to install.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
After you have selected optional dependencies, you should see a window similar to the one pictured on the left.  This lists all the packages that will be installed, upgraded or removed by the action.  Once you have reviewed the list, press the Apply button to install the packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn&amp;#039;t select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Removing Software== &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
{{warning|It is extremely important to carefully review the Transaction Summary before accepting the package removal.  Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Preferences== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The General tab of preferences contains several settings, most of which are self-explanatory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package&lt;br /&gt;
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages&lt;br /&gt;
* Maximum parallel downloads - The number of concurrent downloads allowed&lt;br /&gt;
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].&lt;br /&gt;
* Check for updates - Disabling this will stop pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.&lt;br /&gt;
* Ignore updates for - This is a list of packages that you don&amp;#039;t want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
{{warning|Ignoring updates for individual packages will leave you in an unsupported &amp;quot;partial upgrade&amp;quot; state.  It is common for innocuous looking ignored packages to leave your system unbootable}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning|&amp;#039;&amp;#039;&amp;#039;DISCLAIMER:&amp;#039;&amp;#039;&amp;#039; AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted. Any use of the provided files is at your own risk.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you enable AUR support, you may also select, &amp;quot;Check for updates from AUR&amp;quot; so software you install from AUR won&amp;#039;t become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Checking for &amp;quot;development package&amp;quot; updates will allow updates on *-git packages which are built from the latest source code to also be updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The &amp;quot;Build directory&amp;quot; is where AUR packages will be built.  Using &amp;quot;tmp&amp;quot; usually will provide the best performance but very large packages may fail to build.  In this case, select a location with more available space.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded.  This cache can be very useful if you have to install older packages in an emergency.  However, left unchecked, this cache will grow very large over time.  These preferences allow your cache to be automatically managed based on your preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to &amp;quot;3&amp;quot;, only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
By selecting &amp;quot;Remove only the versions of uninstalled packages&amp;quot;, pamac will retain all versions of packages you still have installed.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac CLI= &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Pamac also includes a fully functional CLI for when you don&amp;#039;t have a working GUI or for those that prefer to manage packages that way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{BoxWarning|Do not use sudo with pamac.|Using sudo with pamac can have undesirable effects, especially when building packages. It also can lead to Permission issues with the database. Pamac will ask for escalated rights if needed.}}&lt;br /&gt;
&lt;br /&gt;
==Locating and Installing Packages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1    community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2  community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1  community &lt;br /&gt;
  Themes for SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search -a smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1         community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2       community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1       community &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
papirus-smplayer-theme-git&lt;br /&gt;
20181024-2       AUR &lt;br /&gt;
  Papirus theme for SMPlayer (git version)&lt;br /&gt;
smplayer-svn&lt;br /&gt;
17.12.0.r8852-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV&lt;br /&gt;
smplayer-svn-notitlebar&lt;br /&gt;
18.3.0.r8982M-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode&lt;br /&gt;
smplayer-skins-svn&lt;br /&gt;
15.2.0.r8852-1   AUR &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes-svn&lt;br /&gt;
17.3.0.r8852-1   AUR &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
smplayer-qt4&lt;br /&gt;
18.5.0-1         AUR &lt;br /&gt;
  Complete front-end for MPlayer/MPV (Qt4)&lt;br /&gt;
rosa-media-player-plugin&lt;br /&gt;
1.0-2            AUR &lt;br /&gt;
  The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).&lt;br /&gt;
smplayer-theme-faenza (Out of Date: 09/15/2017)&lt;br /&gt;
2-2              AUR &lt;br /&gt;
  Normal, dark and silver faenza theme for smplayer.&lt;br /&gt;
umplayer&lt;br /&gt;
0.98.2-2         AUR &lt;br /&gt;
  An alternative to SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Once you have identified the packages you wish to install, you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:&lt;br /&gt;
{{UserCmd|command=pamac install smplayer smplayer-themes}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|When using install, pamac will check to see if packages are installed and only install the ones not already installed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac build umplayer}}&lt;br /&gt;
&lt;br /&gt;
==Removing Packages== &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example, if you wanted to remove all the packages installed above, you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove smplayer smplayer-themes umplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the list of packages pamac presents before confirming.|Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Identifying Installed Packages== &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
To display a list of all installed packages, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac list -i}}&lt;br /&gt;
&lt;br /&gt;
==Displaying Detailed Package Information== &amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
To display detailed information on a package that is in the repos or installed on your system, use the command {{ic|pamac info}}.  Keeping with our example of SMPlayer :&lt;br /&gt;
{{UserCmd|command=pamac info smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
If you also would like to check packages in [[Arch_User_Repository|AUR]], you could use:&lt;br /&gt;
{{UserCmd|command=pamac info -a smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Updating the System== &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
To check if updates are available, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac checkupdates -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]], you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac upgrade -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|pamac update and pamac upgrade are exactly the same.  You can use them interchangeably.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dealing with Orphaned Packages== &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:&lt;br /&gt;
{{UserCmd|command=pamac list -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
To remove all orphans use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cleaning the Cache== &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Otherwise, to clear the cache completely, enter the following command (and use with care):&lt;br /&gt;
{{UserCmd|command=pamac clean}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:&lt;br /&gt;
{{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Useful Pamac Functions== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac search -f /usr/bin/smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
To force a package to be installed even if it is already installed, use {{ic|pamac reinstall}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac reinstall smplayer}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54829</id>
		<title>Pamac</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Pamac&amp;diff=54829"/>
		<updated>2025-10-01T11:37:00Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: wording für sudo angepasst&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Overview= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Pamac (Add/Remove Software) is Manjaro&amp;#039;s Package Manager.  It is based on libalpm with AUR and Appstream support.  It focuses on providing an easy to use interface while still providing a powerful set of features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-main.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
=Installing Pamac= &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Pamac is pre-installed on many Manjaro Editions but if your system does not have it it can be easily installed.  Pamac comes in several different packages:&lt;br /&gt;
* {{ic|pamac-gtk}} - The GTK version of pamac.  Includes a tray icon for many desktops.&lt;br /&gt;
* {{ic|pamac-cli}} - The command line version of pamac.&lt;br /&gt;
* {{ic|pamac-tray-icon-plasma}} - A tray icon for KDE plasma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
These packages can be installed using pacman.  For example, to install the GTK version, you can use the command:&lt;br /&gt;
{{UserCmd|command=sudo pacman -Syu pamac-gtk}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
{{BoxSuccess|tip|Both the GTK and Qt pamac packages will automatically install the CLI version as well}}&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac GUI= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Software== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
To install packages, simply check the box next to the packages.  Once you have selected all the packages you want to install, click the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
If any of the packages have optional dependencies (packages that enable additional functionality) you will see a window like the one to the left which allows to select the ones you would like to install.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
After you have selected optional dependencies, you should see a window similar to the one pictured on the left.  This lists all the packages that will be installed, upgraded or removed by the action.  Once you have reviewed the list, press the Apply button to install the packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn&amp;#039;t select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Removing Software== &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
{{warning|It is extremely important to carefully review the Transaction Summary before accepting the package removal.  Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Preferences== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The General tab of preferences contains several settings, most of which are self-explanatory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package&lt;br /&gt;
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages&lt;br /&gt;
* Maximum parallel downloads - The number of concurrent downloads allowed&lt;br /&gt;
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].&lt;br /&gt;
* Check for updates - Disabling this will stop pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.&lt;br /&gt;
* Ignore updates for - This is a list of packages that you don&amp;#039;t want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
{{warning|Ignoring updates for individual packages will leave you in an unsupported &amp;quot;partial upgrade&amp;quot; state.  It is common for innocuous looking ignored packages to leave your system unbootable}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning|&amp;#039;&amp;#039;&amp;#039;DISCLAIMER:&amp;#039;&amp;#039;&amp;#039; AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted. Any use of the provided files is at your own risk.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
If you enable AUR support, you may also select, &amp;quot;Check for updates from AUR&amp;quot; so software you install from AUR won&amp;#039;t become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Checking for &amp;quot;development package&amp;quot; updates will allow updates on *-git packages which are built from the latest source code to also be updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The &amp;quot;Build directory&amp;quot; is where AUR packages will be built.  Using &amp;quot;tmp&amp;quot; usually will provide the best performance but very large packages may fail to build.  In this case, select a location with more available space.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded.  This cache can be very useful if you have to install older packages in an emergency.  However, left unchecked, this cache will grow very large over time.  These preferences allow your cache to be automatically managed based on your preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to &amp;quot;3&amp;quot;, only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
By selecting &amp;quot;Remove only the versions of uninstalled packages&amp;quot;, pamac will retain all versions of packages you still have installed.&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using the Pamac CLI= &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Pamac also includes a fully functional CLI for when you don&amp;#039;t have a working GUI or for those that prefer to manage packages that way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{BoxWarning|Do not use sudo with pamac.|Using sudo with pamac can have undesirable effects, especially when building packages. Pamac will ask for escalated rights if needed.}}&lt;br /&gt;
&lt;br /&gt;
==Locating and Installing Packages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1    community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2  community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1  community &lt;br /&gt;
  Themes for SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;pamac search -a smplayer&lt;br /&gt;
smplayer&lt;br /&gt;
[Installed] 19.5.0-1         community &lt;br /&gt;
  Media player with built-in codecs that can play virtually all video and audio formats&lt;br /&gt;
smplayer-skins&lt;br /&gt;
[Installed] 1:15.2.0-2       community &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes&lt;br /&gt;
[Installed] 1:18.6.0-1       community &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
papirus-smplayer-theme-git&lt;br /&gt;
20181024-2       AUR &lt;br /&gt;
  Papirus theme for SMPlayer (git version)&lt;br /&gt;
smplayer-svn&lt;br /&gt;
17.12.0.r8852-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV&lt;br /&gt;
smplayer-svn-notitlebar&lt;br /&gt;
18.3.0.r8982M-1  AUR &lt;br /&gt;
  Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode&lt;br /&gt;
smplayer-skins-svn&lt;br /&gt;
15.2.0.r8852-1   AUR &lt;br /&gt;
  Skins for SMPlayer&lt;br /&gt;
smplayer-themes-svn&lt;br /&gt;
17.3.0.r8852-1   AUR &lt;br /&gt;
  Themes for SMPlayer&lt;br /&gt;
smplayer-qt4&lt;br /&gt;
18.5.0-1         AUR &lt;br /&gt;
  Complete front-end for MPlayer/MPV (Qt4)&lt;br /&gt;
rosa-media-player-plugin&lt;br /&gt;
1.0-2            AUR &lt;br /&gt;
  The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).&lt;br /&gt;
smplayer-theme-faenza (Out of Date: 09/15/2017)&lt;br /&gt;
2-2              AUR &lt;br /&gt;
  Normal, dark and silver faenza theme for smplayer.&lt;br /&gt;
umplayer&lt;br /&gt;
0.98.2-2         AUR &lt;br /&gt;
  An alternative to SMPlayer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Once you have identified the packages you wish to install, you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:&lt;br /&gt;
{{UserCmd|command=pamac install smplayer smplayer-themes}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|When using install, pamac will check to see if packages are installed and only install the ones not already installed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac build umplayer}}&lt;br /&gt;
&lt;br /&gt;
==Removing Packages== &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example, if you wanted to remove all the packages installed above, you could use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove smplayer smplayer-themes umplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
{{BoxWarning|Carefully review the list of packages pamac presents before confirming.|Some packages have many packages which depend on them and you don&amp;#039;t want to inadvertently remove your whole desktop environment}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Identifying Installed Packages== &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
To display a list of all installed packages, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac list -i}}&lt;br /&gt;
&lt;br /&gt;
==Displaying Detailed Package Information== &amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
To display detailed information on a package that is in the repos or installed on your system, use the command {{ic|pamac info}}.  Keeping with our example of SMPlayer :&lt;br /&gt;
{{UserCmd|command=pamac info smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
If you also would like to check packages in [[Arch_User_Repository|AUR]], you could use:&lt;br /&gt;
{{UserCmd|command=pamac info -a smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Updating the System== &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
To check if updates are available, you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac checkupdates -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]], you can use the command:&lt;br /&gt;
{{UserCmd|command=pamac upgrade -a}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
{{BoxInfo|tip|pamac update and pamac upgrade are exactly the same.  You can use them interchangeably.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dealing with Orphaned Packages== &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:&lt;br /&gt;
{{UserCmd|command=pamac list -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
To remove all orphans use the command:&lt;br /&gt;
{{UserCmd|command=pamac remove -o}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cleaning the Cache== &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
When pamac installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Otherwise, to clear the cache completely, enter the following command (and use with care):&lt;br /&gt;
{{UserCmd|command=pamac clean}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:&lt;br /&gt;
{{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Useful Pamac Functions== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac search -f /usr/bin/smplayer}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
To force a package to be installed even if it is already installed, use {{ic|pamac reinstall}}.  For example:&lt;br /&gt;
{{UserCmd|command=pamac reinstall smplayer}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Build_Manjaro_ISOs_with_buildiso&amp;diff=54828</id>
		<title>Build Manjaro ISOs with buildiso</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Build_Manjaro_ISOs_with_buildiso&amp;diff=54828"/>
		<updated>2025-09-30T12:39:41Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Link korrigiert&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Prerequisites= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
This is a detailed walkthrough of installation and configuration of the tools and build process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
It is a requirement to either download and install the latest version of [https://manjaro.org/products/download/x86 Manjaro] or be running a well maintained Manjaro system. &amp;#039;&amp;#039;&amp;#039;It is vital your system is updated&amp;#039;&amp;#039;&amp;#039; with the latest available kernel and packages.&lt;br /&gt;
&lt;br /&gt;
==Install Manjaro Tools== &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
To get started you need to the following packages&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
{{UserCmd|command=pamac install manjaro-tools-iso-git git}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
We will be working with the official XFCE to help you understand what you need to do.&lt;br /&gt;
&lt;br /&gt;
=ISO profile= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
==Download the latest ISO profiles==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
The latest profiles can be found in the Manjaro gitlab.  You can download them directly using the command:&lt;br /&gt;
{{UserCmd|command=git clone &amp;lt;nowiki&amp;gt;https://gitlab.manjaro.org/profiles-and-settings/iso-profiles.git&amp;lt;/nowiki&amp;gt; ~/iso-profiles}}&lt;br /&gt;
&lt;br /&gt;
==ISO profile overview== &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
The ISO profile for xfce can now be found at &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
{{UserCmd|command=ls -l ~/iso-profiles/manjaro/xfce}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Let&amp;#039;s take a closer look at the XFCE profile folder (marked above):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;desktop-overlay&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 live-overlay -&amp;gt; ../../shared/manjaro/live-overlay&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;Packages-Desktop&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 Packages-Live -&amp;gt; ../../shared/Packages-Live&lt;br /&gt;
 Packages-Mhwd -&amp;gt; ../../shared/Packages-Mhwd&lt;br /&gt;
 Packages-Root -&amp;gt; ../../shared/Packages-Root&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;profile.conf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;desktop-overlay&amp;#039;&amp;#039;&amp;#039;: After every successful installation of your ISO the files and folders in here will get copied over.&lt;br /&gt;
* &amp;#039;&amp;#039;live-overlay&amp;#039;&amp;#039;: Similar to &amp;#039;&amp;#039;desktop-overlay&amp;#039;&amp;#039;. Files and folders in here will only get copied over to the LiveCD of your ISO.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Packages-Desktop&amp;#039;&amp;#039;&amp;#039;: This file contains packages for the ISO installation. All packages will also get installed on LiveCDs.&lt;br /&gt;
* &amp;#039;&amp;#039;Packages-Live&amp;#039;&amp;#039;: This file contains packages, which will only get installed on the LiveCD.&lt;br /&gt;
* &amp;#039;&amp;#039;Packages-Mhwd&amp;#039;&amp;#039;: This file contains Mhwd packages important to all Manjaro installations and LiveCDs.&lt;br /&gt;
* &amp;#039;&amp;#039;Packages-Root&amp;#039;&amp;#039;: This file contains base packages important to all Manjaro installations and LiveCDs.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;profile.conf&amp;#039;&amp;#039;&amp;#039; contains basic settings for your ISO installation and LiveCD.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
As you have probably noticed, several are only symlinks to the &amp;lt;code&amp;gt;shared&amp;lt;/code&amp;gt; ISO profile. It is good practice to never change files or folders in the &amp;lt;code&amp;gt;shared&amp;lt;/code&amp;gt; ISO profile. If you ever want to change them, first copy them to your ISO profile folder and delete the symlink.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
All folders and files specific to your ISO are &amp;#039;&amp;#039;&amp;#039;in bold&amp;#039;&amp;#039;&amp;#039;. You can change them to your liking.&lt;br /&gt;
&lt;br /&gt;
==Modifying an ISO profile== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
The most common places to tweak and customize an ISO profile are the 3 folders marked above: &amp;#039;&amp;#039;desktop-overlay&amp;#039;&amp;#039;, &amp;#039;&amp;#039;profile.conf&amp;#039;&amp;#039;, &amp;#039;&amp;#039;Packages-Desktop&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
===desktop-overlay=== &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
The &amp;#039;&amp;#039;desktop-overlay&amp;#039;&amp;#039; folder looks like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
{{UserCmdOutput|command=tree ~/iso-profiles/manjaro/xfce/desktop-overlay/etc|result=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
../iso-profiles/manjaro/xfce/desktop-overlay/&lt;br /&gt;
├── etc&lt;br /&gt;
│   ├── fonts&lt;br /&gt;
│   │   └── conf.d&lt;br /&gt;
│   │       └── 70-no-bitmaps.conf&lt;br /&gt;
│   └── lightdm&lt;br /&gt;
│       ├── lightdm.conf&lt;br /&gt;
│       └── lightdm-gtk-greeter.conf&lt;br /&gt;
└── usr&lt;br /&gt;
    └── share&lt;br /&gt;
        └── icons&lt;br /&gt;
            └── default&lt;br /&gt;
                └── index.theme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Go to this directory.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
 {{UserCmd|command=cd ~/iso-profiles/manjaro/xfce/desktop-overlay/etc/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Then create &amp;#039;&amp;#039;&amp;#039;skel&amp;#039;&amp;#039;&amp;#039; folder. This is where you can clone everything you see on your Desktop Screen to ISO.&lt;br /&gt;
{{UserCmd|command=mkdir skel}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
After the ISO has been successfully installed all files and folder in &amp;#039;&amp;#039;desktop-overlay&amp;#039;&amp;#039; folder get copied over to the installed system. This includes settings/config files but also themes and backgrounds/pictures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
All files and folder in here will get copied to the home folder. Most hidden files and their structure in &amp;lt;code&amp;gt;~/iso-profiles/manjaro/xfce/desktop-overlay/etc/skel/&amp;lt;/code&amp;gt; should be already familiar to you, because your home folder looks very similar.&lt;br /&gt;
&lt;br /&gt;
===Clone Custom Wallpaper Desktop=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
To clone your Custom Wallpaper Desktop. Open a New File Manager and go to this file.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
Change all image directories to where your Custom Wallpaper was located at.  For example:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
 /usr/share/backgrounds/&amp;lt;YOUR IMAGE HERE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;A sample `xfce4-desktop.xml` can be viewed by unfolding this block&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;channel name=&amp;quot;xfce4-desktop&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;property name=&amp;quot;backdrop&amp;quot; type=&amp;quot;empty&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;property name=&amp;quot;screen0&amp;quot; type=&amp;quot;empty&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;property name=&amp;quot;monitor0&amp;quot; type=&amp;quot;empty&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;property name=&amp;quot;image-path&amp;quot; type=&amp;quot;string&amp;quot; value=&amp;quot;&amp;#039;&amp;#039;&amp;#039;/usr/share/backgrounds/&amp;lt;YOUR IMAGE HERE&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;property name=&amp;quot;last-image&amp;quot; type=&amp;quot;string&amp;quot; value=&amp;quot;&amp;#039;&amp;#039;&amp;#039;/usr/share/backgrounds/&amp;lt;YOUR IMAGE HERE&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;property name=&amp;quot;last-single-image&amp;quot; type=&amp;quot;string&amp;quot; value=&amp;quot;&amp;#039;&amp;#039;&amp;#039;/usr/share/backgrounds/&amp;lt;YOUR IMAGE HERE&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;property name=&amp;quot;image-style&amp;quot; type=&amp;quot;int&amp;quot; value=&amp;quot;5&amp;quot;/&amp;gt;&lt;br /&gt;
       &amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property name=&amp;quot;monitorVGA-0&amp;quot; type=&amp;quot;empty&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;property name=&amp;quot;workspace0&amp;quot; type=&amp;quot;empty&amp;quot;&amp;gt;&lt;br /&gt;
           &amp;lt;property name=&amp;quot;color-style&amp;quot; type=&amp;quot;int&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
           &amp;lt;property name=&amp;quot;image-style&amp;quot; type=&amp;quot;int&amp;quot; value=&amp;quot;5&amp;quot;/&amp;gt;&lt;br /&gt;
           &amp;lt;property name=&amp;quot;last-image&amp;quot; type=&amp;quot;string&amp;quot; value=&amp;quot;&amp;#039;&amp;#039;&amp;#039;/usr/share/backgrounds/&amp;lt;YOUR IMAGE HERE&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/property&amp;gt;&lt;br /&gt;
         &amp;lt;property name=&amp;quot;workspace1&amp;quot; type=&amp;quot;empty&amp;quot;&amp;gt;&lt;br /&gt;
           &amp;lt;property name=&amp;quot;color-style&amp;quot; type=&amp;quot;int&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
           &amp;lt;property name=&amp;quot;image-style&amp;quot; type=&amp;quot;int&amp;quot; value=&amp;quot;5&amp;quot;/&amp;gt;&lt;br /&gt;
           &amp;lt;property name=&amp;quot;last-image&amp;quot; type=&amp;quot;string&amp;quot; value=&amp;quot;&amp;#039;&amp;#039;&amp;#039;/usr/share/backgrounds/&amp;lt;YOUR IMAGE HERE&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;/property&amp;gt;&lt;br /&gt;
     &amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property name=&amp;quot;desktop-icons&amp;quot; type=&amp;quot;empty&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;property name=&amp;quot;style&amp;quot; type=&amp;quot;int&amp;quot; value=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;property name=&amp;quot;file-icons&amp;quot; type=&amp;quot;empty&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;property name=&amp;quot;show-removable&amp;quot; type=&amp;quot;bool&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;/property&amp;gt;&lt;br /&gt;
     &amp;lt;property name=&amp;quot;icon-size&amp;quot; type=&amp;quot;uint&amp;quot; value=&amp;quot;32&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/property&amp;gt;&lt;br /&gt;
 &amp;lt;/channel&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Go to this directory:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cd ~/iso-profiles/manjaro/xfce/desktop-overlay/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Then create &amp;lt;code&amp;gt;usr/share/backgrounds&amp;lt;/code&amp;gt; and place your Custom Wallpaper at this directory.&lt;br /&gt;
{{UserCmd|command=mkdir ./usr/share/backgrounds}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cp ~/Pictures/Wallpapers/your-wallpaper.png ~/iso-profiles/manjaro/xfce/desktop-overlay/usr/share/backgrounds}}&lt;br /&gt;
&lt;br /&gt;
===profile.conf=== &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;The full content of an example profile.conf can be viewed by unfolding this block. It is always best to use the latest version instead of copying this one.&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##########################################&lt;br /&gt;
###### use this file in the profile ######&lt;br /&gt;
##########################################&lt;br /&gt;
&lt;br /&gt;
# use multilib packages; x86_64 only&lt;br /&gt;
# multilib=&amp;quot;true&amp;quot;&lt;br /&gt;
&lt;br /&gt;
displaymanager=&amp;quot;lightdm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Set to false to disable autologin in the livecd&lt;br /&gt;
# autologin=&amp;quot;true&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# nonfree mhwd drivers&lt;br /&gt;
# nonfree_mhwd=&amp;quot;true&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# use extra packages as defined in pkglist to activate a full profile&lt;br /&gt;
#extra=&amp;quot;true&amp;quot;&lt;br /&gt;
&lt;br /&gt;
################ install ################&lt;br /&gt;
&lt;br /&gt;
# unset defaults to given value&lt;br /&gt;
# efi_boot_loader=&amp;quot;grub&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# configure calamares for netinstall&lt;br /&gt;
# netinstall=&amp;quot;false&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# configure calamares to use chrootcfg instead of unpackfs&lt;br /&gt;
# chrootcfg=&amp;quot;false&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# use geoip for localization&lt;br /&gt;
# geoip=&amp;#039;true&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# unset defaults to given values&lt;br /&gt;
# names must match systemd service names&lt;br /&gt;
enable_systemd=(&amp;#039;avahi-daemon&amp;#039; &amp;#039;bluetooth&amp;#039; &amp;#039;cronie&amp;#039; &amp;#039;ModemManager&amp;#039; &amp;#039;NetworkManager&amp;#039; &amp;#039;cups&amp;#039; &amp;#039;haveged&amp;#039; &amp;#039;ufw&amp;#039; &amp;#039;apparmor&amp;#039; &amp;#039;snapd.apparmor&amp;#039; &amp;#039;snapd&amp;#039; &amp;#039;systemd-timesyncd&amp;#039;)&lt;br /&gt;
enable_systemd_timers=(&amp;#039;fstrim&amp;#039; &amp;#039;pacman-filesdb-refresh&amp;#039;)&lt;br /&gt;
disable_systemd=(&amp;#039;pacman-init&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
# add strict snaps: strict_snaps=&amp;quot;snapd core core18 gnome-3-28-1804 gtk-common-themes snap-store&amp;quot;&lt;br /&gt;
# strict_snaps=&amp;quot;&amp;quot;&lt;br /&gt;
# add classic snaps: classic_snaps=&amp;quot;code&amp;quot;&lt;br /&gt;
# classic_snaps=&amp;quot;&amp;quot;&lt;br /&gt;
# choose the snap channel. Possible options are: stable, candidate, beta, edge&lt;br /&gt;
# snap_channel=&amp;quot;candidate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# the same workgroup name if samba is used&lt;br /&gt;
# smb_workgroup=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
################# livecd #################&lt;br /&gt;
&lt;br /&gt;
# unset defaults to given value&lt;br /&gt;
# hostname=&amp;quot;manjaro&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# unset defaults to given value&lt;br /&gt;
# username=&amp;quot;manjaro&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# unset defaults to given value&lt;br /&gt;
# password=&amp;quot;manjaro&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# the login shell&lt;br /&gt;
# defaults to bash&lt;br /&gt;
# login_shell=/bin/bash&lt;br /&gt;
&lt;br /&gt;
# unset defaults to given values&lt;br /&gt;
# addgroups=&amp;quot;lp,network,power,wheel&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# unset defaults to given values&lt;br /&gt;
# names must match systemd service names&lt;br /&gt;
# services in enable_systemd array don&amp;#039;t need to be listed here&lt;br /&gt;
# enable_systemd_live=(&amp;#039;manjaro-live&amp;#039; &amp;#039;mhwd-live&amp;#039; &amp;#039;pacman-init&amp;#039; &amp;#039;mirrors-live&amp;#039;)&lt;br /&gt;
disable_systemd_live=(&amp;#039;tlp&amp;#039; &amp;#039;tlp-sleep&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
custom_boot_args=(&amp;#039;splash&amp;#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
This config file contains setting options. All default settings are commented. If you want to change them, uncomment them (remove the &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; symbol in front) and change it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
The following settings are noteworthy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;multilib=&amp;lt;/code&amp;gt; setting belongs to the &amp;lt;code&amp;gt;&amp;gt;multilib&amp;lt;/code&amp;gt; flag in your package lists. multilib will install basic 32bit libraries on 64bit systems. This increases compatibility for 32bit applications on 64bit systems.&lt;br /&gt;
* &amp;lt;code&amp;gt;displaymanager=&amp;lt;/code&amp;gt; sets the display / login manager your system uses. You need to list your display manager in your package list, too.&lt;br /&gt;
* &amp;lt;code&amp;gt;kernel=&amp;lt;/code&amp;gt; lets you set the installed kernel. Do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; include any kernels in your package list! This setting is all you need.&lt;br /&gt;
* &amp;lt;code&amp;gt;enable_systemd=&amp;lt;/code&amp;gt; let&amp;#039;s you set systemd services, which get started on the installed system (and with a similar setting on the livecd).&lt;br /&gt;
&lt;br /&gt;
===Packages-Desktop=== &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;An example `Packages-Desktop` file can be viewed by unfolding this block. It is always best to use the latest version instead of copying this one.&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Network&lt;br /&gt;
avahi&lt;br /&gt;
networkmanager&lt;br /&gt;
networkmanager-openconnect&lt;br /&gt;
networkmanager-openvpn&lt;br /&gt;
networkmanager-pptp&lt;br /&gt;
networkmanager-vpnc&lt;br /&gt;
nss-mdns # NSS support for mDNS (optdepend for avahi)&lt;br /&gt;
ntp&lt;br /&gt;
mobile-broadband-provider-info&lt;br /&gt;
modemmanager&lt;br /&gt;
openresolv&lt;br /&gt;
openssh&lt;br /&gt;
samba&lt;br /&gt;
usb_modeswitch&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
## Libraries for Sound/Audio/Video&lt;br /&gt;
alsa-firmware&lt;br /&gt;
alsa-utils&lt;br /&gt;
ffmpeg&lt;br /&gt;
gst-libav&lt;br /&gt;
gst-plugins-bad&lt;br /&gt;
gst-plugins-base&lt;br /&gt;
gst-plugins-good&lt;br /&gt;
gst-plugins-ugly&lt;br /&gt;
libdvdcss&lt;br /&gt;
&amp;gt;multilib manjaro-alsa&lt;br /&gt;
manjaro-pulse&lt;br /&gt;
pulseaudio-bluetooth&lt;br /&gt;
pulseaudio-ctl&lt;br /&gt;
pulseaudio-zeroconf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
## Connect Packages&lt;br /&gt;
android-tools&lt;br /&gt;
android-udev&lt;br /&gt;
gvfs&lt;br /&gt;
gvfs-afc&lt;br /&gt;
gvfs-gphoto2&lt;br /&gt;
gvfs-mtp&lt;br /&gt;
gvfs-nfs&lt;br /&gt;
gvfs-smb&lt;br /&gt;
mtpfs&lt;br /&gt;
udiskie&lt;br /&gt;
udisks2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
## AUR Support/Development&lt;br /&gt;
# Missing base-devel packages&lt;br /&gt;
autoconf&lt;br /&gt;
automake&lt;br /&gt;
binutils&lt;br /&gt;
bison&lt;br /&gt;
fakeroot&lt;br /&gt;
flex&lt;br /&gt;
gcc&lt;br /&gt;
&amp;gt;multilib gcc-libs-multilib&lt;br /&gt;
&amp;gt;multilib gcc-multilib&lt;br /&gt;
libtool&lt;br /&gt;
m4&lt;br /&gt;
make&lt;br /&gt;
patch&lt;br /&gt;
pkg-config&lt;br /&gt;
&amp;gt;multilib lib32-flex&lt;br /&gt;
# Extra packages for AUR support&lt;br /&gt;
&amp;gt;extra git&lt;br /&gt;
&amp;gt;extra patchutils&lt;br /&gt;
&amp;gt;extra subversion&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
## Fonts&lt;br /&gt;
cantarell-fonts&lt;br /&gt;
# noto-fonts             # default font&lt;br /&gt;
# noto-fonts-cjk         # big package, ~76 mb compressed&lt;br /&gt;
# &amp;gt;extra noto-fonts-emoji&lt;br /&gt;
terminus-font&lt;br /&gt;
ttf-bitstream-vera       # xfce4-terminal default Monospace&lt;br /&gt;
# ttf-dejavu             # Installed as gnome-themes-standard dependency&lt;br /&gt;
&amp;gt;extra ttf-inconsolata&lt;br /&gt;
&amp;gt;extra ttf-indic-otf&lt;br /&gt;
&amp;gt;extra ttf-liberation&lt;br /&gt;
&amp;gt;extra ttf-droid&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
## Games&lt;br /&gt;
&amp;gt;extra steam-manjaro&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
## Package management&lt;br /&gt;
pamac&lt;br /&gt;
flatpak&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
## Java&lt;br /&gt;
&amp;gt;extra jdk8-openjdk&lt;br /&gt;
&amp;gt;extra jre8-openjdk-headless&lt;br /&gt;
&amp;gt;extra jre8-openjdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
## Printing&lt;br /&gt;
&amp;gt;extra cups&lt;br /&gt;
&amp;gt;extra cups-pdf&lt;br /&gt;
&amp;gt;extra cups-pk-helper&lt;br /&gt;
&amp;gt;extra ghostscript&lt;br /&gt;
&amp;gt;extra gsfonts&lt;br /&gt;
&amp;gt;extra gtk3-print-backends&lt;br /&gt;
&amp;gt;extra hplip&lt;br /&gt;
&amp;gt;extra splix&lt;br /&gt;
&amp;gt;extra system-config-printer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
## Optional dependencies for hplip&lt;br /&gt;
&amp;gt;extra pyqt5-common # For hplip&lt;br /&gt;
&amp;gt;extra python-pillow # For hplip&lt;br /&gt;
&amp;gt;extra python-pip # For hplip&lt;br /&gt;
&amp;gt;extra python-pyqt5  # For hplip gui&lt;br /&gt;
&amp;gt;extra python-reportlab # For hplip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
## Display manager&lt;br /&gt;
lightdm&lt;br /&gt;
lightdm-gtk-greeter&lt;br /&gt;
lightdm-gtk-greeter-settings&lt;br /&gt;
accountsservice  # Enhanced user accounts handling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
## GTK3&lt;br /&gt;
gtk3-classic&lt;br /&gt;
&amp;gt;multilib lib32-gtk3-classic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
## XFCE Group&lt;br /&gt;
exo-gtk3&lt;br /&gt;
garcon-gtk3&lt;br /&gt;
thunar-gtk3&lt;br /&gt;
thunar-volman&lt;br /&gt;
tumbler&lt;br /&gt;
xfce4-appfinder-gtk3&lt;br /&gt;
xfce4-panel-gtk3&lt;br /&gt;
xfce4-power-manager-gtk3&lt;br /&gt;
xfce4-session-gtk3&lt;br /&gt;
xfce4-settings-gtk3&lt;br /&gt;
xfce4-terminal&lt;br /&gt;
xfconf-gtk3&lt;br /&gt;
xfdesktop-gtk3&lt;br /&gt;
xfwm4-gtk3&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
## XFCE Extras&lt;br /&gt;
blueman&lt;br /&gt;
ffmpegthumbnailer  # tumbler - for video thumbnails&lt;br /&gt;
freetype2          # tumbler - for font thumbnails&lt;br /&gt;
gksu&lt;br /&gt;
gnome-keyring      # fix wlan segfault&lt;br /&gt;
libgsf             # tumbler - for ODF thumbnails&lt;br /&gt;
libopenraw         # tumbler - for RAW thumbnails&lt;br /&gt;
light-locker&lt;br /&gt;
network-manager-applet&lt;br /&gt;
menulibre&lt;br /&gt;
orage&lt;br /&gt;
poppler-glib       # tumbler - for PDF thumbnails&lt;br /&gt;
thunar-archive-plugin&lt;br /&gt;
file-roller&lt;br /&gt;
thunar-media-tags-plugin&lt;br /&gt;
# &amp;gt;extra xfce4-artwork&lt;br /&gt;
xfce4-battery-plugin&lt;br /&gt;
xfce4-clipman-plugin&lt;br /&gt;
&amp;gt;extra xfce4-cpufreq-plugin&lt;br /&gt;
&amp;gt;extra xfce4-cpugraph-plugin&lt;br /&gt;
# xfce4-datetime-plugin&lt;br /&gt;
&amp;gt;extra xfce4-dict&lt;br /&gt;
&amp;gt;extra xfce4-diskperf-plugin&lt;br /&gt;
&amp;gt;extra xfce4-fsguard-plugin&lt;br /&gt;
&amp;gt;extra xfce4-genmon-plugin&lt;br /&gt;
&amp;gt;extra xfce4-mailwatch-plugin&lt;br /&gt;
&amp;gt;extra xfce4-mount-plugin&lt;br /&gt;
&amp;gt;extra xfce4-mpc-plugin&lt;br /&gt;
&amp;gt;extra xfce4-netload-plugin&lt;br /&gt;
&amp;gt;extra xfce4-notes-plugin&lt;br /&gt;
xfce4-notifyd-gtk3&lt;br /&gt;
xfce4-screenshooter&lt;br /&gt;
&amp;gt;extra xfce4-sensors-plugin&lt;br /&gt;
&amp;gt;extra xfce4-smartbookmark-plugin&lt;br /&gt;
&amp;gt;extra xfce4-systemload-plugin&lt;br /&gt;
xfce4-taskmanager&lt;br /&gt;
&amp;gt;extra xfce4-time-out-plugin&lt;br /&gt;
&amp;gt;extra xfce4-timer-plugin&lt;br /&gt;
&amp;gt;extra xfce4-verve-plugin&lt;br /&gt;
&amp;gt;extra xfce4-wavelan-plugin&lt;br /&gt;
&amp;gt;extra xfce4-weather-plugin&lt;br /&gt;
xfce4-whiskermenu-plugin-gtk3&lt;br /&gt;
xfce4-xkb-plugin&lt;br /&gt;
xfce4-pulseaudio-plugin&lt;br /&gt;
pavucontrol&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
## Themes&lt;br /&gt;
&amp;gt;extra manjaro-wallpapers-18.0&lt;br /&gt;
&amp;gt;extra wallpapers-2018&lt;br /&gt;
gnome-icon-theme&lt;br /&gt;
gnome-themes-standard&lt;br /&gt;
grub-theme-manjaro&lt;br /&gt;
matcha-gtk-theme&lt;br /&gt;
xcursor-simpleandsoft&lt;br /&gt;
xcursor-vanilla-dmz-aa&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
## Applications&lt;br /&gt;
&amp;gt;extra catfish&lt;br /&gt;
dmidecode # optional dependency inxi&lt;br /&gt;
engrampa&lt;br /&gt;
&amp;gt;extra firefox&lt;br /&gt;
# &amp;gt;extra flashplugin&lt;br /&gt;
&amp;gt;extra galculator-gtk2&lt;br /&gt;
gcolor2&lt;br /&gt;
&amp;gt;extra gimp&lt;br /&gt;
gparted&lt;br /&gt;
gufw&lt;br /&gt;
&amp;gt;extra audacious&lt;br /&gt;
&amp;gt;extra hexchat&lt;br /&gt;
htop&lt;br /&gt;
qpdfview&lt;br /&gt;
inxi&lt;br /&gt;
&amp;gt;extra libreoffice-still&lt;br /&gt;
ms-office-online&lt;br /&gt;
manjaro-hello&lt;br /&gt;
manjaro-application-utility&lt;br /&gt;
manjaro-settings-manager&lt;br /&gt;
manjaro-settings-manager-notifier&lt;br /&gt;
&amp;gt;basic midori&lt;br /&gt;
&amp;gt;extra mlocate&lt;br /&gt;
mousepad&lt;br /&gt;
mugshot&lt;br /&gt;
&amp;gt;basic parole # media player&lt;br /&gt;
&amp;gt;extra pidgin&lt;br /&gt;
powertop&lt;br /&gt;
screenfetch&lt;br /&gt;
&amp;gt;extra poppler-data  # CKJ support for pdf&lt;br /&gt;
&amp;gt;basic sylpheed # mail client&lt;br /&gt;
&amp;gt;extra thunderbird&lt;br /&gt;
&amp;gt;extra vlc&lt;br /&gt;
&amp;gt;extra viewnior&lt;br /&gt;
&amp;gt;extra xfburn&lt;br /&gt;
&amp;gt;extra yelp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
# Optional dependencies engrampa&lt;br /&gt;
p7zip  # 7Z and ARJ archive support&lt;br /&gt;
unace  # ACE archive support&lt;br /&gt;
unrar  # RAR archive support&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
## Documentation&lt;br /&gt;
manjaro-documentation-en&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
## Settings packages&lt;br /&gt;
&amp;gt;extra manjaro-xfce-gtk3-settings&lt;br /&gt;
&amp;gt;basic manjaro-xfce-gtk3-minimal-settings&lt;br /&gt;
manjaro-browser-settings&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
## Xorg Input Drivers&lt;br /&gt;
xf86-input-elographics&lt;br /&gt;
xf86-input-evdev&lt;br /&gt;
xf86-input-keyboard&lt;br /&gt;
xf86-input-libinput&lt;br /&gt;
xf86-input-mouse&lt;br /&gt;
xf86-input-void&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
## Xorg Server and Graphics&lt;br /&gt;
&amp;gt;multilib lib32-libva-intel-driver&lt;br /&gt;
&amp;gt;multilib lib32-libva-mesa-driver&lt;br /&gt;
&amp;gt;multilib lib32-libva-vdpau-driver&lt;br /&gt;
libva-intel-driver&lt;br /&gt;
libva-mesa-driver&lt;br /&gt;
libva-vdpau-driver&lt;br /&gt;
mesa-demos&lt;br /&gt;
&amp;gt;multilib lib32-mesa-demos&lt;br /&gt;
numlockx&lt;br /&gt;
xdg-user-dirs&lt;br /&gt;
xorg-server&lt;br /&gt;
xorg-twm&lt;br /&gt;
xorg-xinit&lt;br /&gt;
xorg-xkill&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
## Desktop Utils&lt;br /&gt;
perl-file-mimeinfo&lt;br /&gt;
xdg-utils&lt;br /&gt;
xdg-su&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
## Misc&lt;br /&gt;
manjaro-hotfixes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
This file contains a list of packages, which will get installed on your installed ISO (XFCE) &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; the LiveCD (the packages in Packages-Live file only get installled on the live ISO). This is a package list with Xfce specific packages (and packages you like to add to your custom Manjaro ISO) of multiple package lists in your ISO profile. The other package lists are more generic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can add or remove package names from this list as you like. You do not need to worry about dependencies when adding package names, just make sure the package name is spelled correctly and the package is available in the Manjaro repositories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; marks a comment. The rest of the line after the &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; symbol gets ignored.&lt;br /&gt;
&lt;br /&gt;
===Adding AUR packages=== &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
If you want to add AUR packages to your ISO, you need to create a online repository and add it to a file &amp;#039;&amp;#039;&amp;#039;user-repos.conf&amp;#039;&amp;#039;&amp;#039; beside your &amp;#039;&amp;#039;&amp;#039;profile.conf&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Only use your own http enabled repo.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
[your-repo-name]&lt;br /&gt;
 SigLevel = Optional TrustAll&lt;br /&gt;
 Server = http://repo.server.tld/your-repo-name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
The article [[Buildiso with AUR packages: Using buildpkg]] contains more detailed information on this process.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=manjaro-tools.conf= &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;manjaro-tools.conf&amp;lt;/code&amp;gt; is the central configuration file for all tools part of &amp;#039;&amp;#039;manjaro-tools&amp;#039;&amp;#039;. Only edit the general and the &amp;quot;buildiso&amp;quot; part to not exceed the scope of this tutorial. If you are not sure what and how to edit it, do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; edit it. You can always use arguments with the &amp;lt;code&amp;gt;buildiso&amp;lt;/code&amp;gt; command later. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
By default, the systemwide config file is installed in&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
/etc/manjaro-tools/manjaro-tools.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
Best practice is to leave the systemwide file untouched and copy the system wide config to your home directory here:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
~/.config/manjaro-tools&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
If the userconfig is present, &amp;#039;&amp;#039;manjaro-tools&amp;#039;&amp;#039;/&amp;#039;&amp;#039;buildiso&amp;#039;&amp;#039; will load the userconfig values. Best practice is to leave the systemwide file untouched. By default it is commented and shows just initialization values done in code.&lt;br /&gt;
&lt;br /&gt;
=Build your ISO= &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Build your ISO with the following command:&lt;br /&gt;
{{UserCmd|command=buildiso -p xfce}}&lt;br /&gt;
You need to specify the name of your ISO profile after the &amp;lt;code&amp;gt;-p&amp;lt;/code&amp;gt; argument. In this case, it is &amp;lt;code&amp;gt;xfce&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
If the build process fails with an error, start it again. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Attention:&amp;#039;&amp;#039;&amp;#039; The build process needs at least 10 minutes to complete or much longer when you are using HDDs, slow CPUs, or large ISOs.&lt;br /&gt;
&lt;br /&gt;
When the build process finishes successfully, the ISO file and the package list will appear in this folder: &lt;br /&gt;
 /var/cache/manjaro-tools/iso/&lt;br /&gt;
===Example:=== &amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
You can use arguments with the &amp;lt;code&amp;gt;buildiso&amp;lt;/code&amp;gt; command for more build options:&lt;br /&gt;
{{UserCmd|command=buildiso -f -p xfce -b stable}}&lt;br /&gt;
* &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; let&amp;#039;s you specify if you want the full ISO. If omitted a minimal ISO will be build.&lt;br /&gt;
* &amp;lt;code&amp;gt;-b&amp;lt;/code&amp;gt; let&amp;#039;s you specify the branch. You can also set this in your &amp;lt;code&amp;gt;manjaro-tools.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
You can find other examples of builds using different arguments for &amp;#039;&amp;#039;buildiso&amp;#039;&amp;#039; [https://wiki.manjaro.org/index.php?title=Manjaro-tools#buildiso here].&lt;br /&gt;
&lt;br /&gt;
=Cleaning your hard drive= &amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
After a successful or failed build, you can get rid of most data (the &amp;quot;raw&amp;quot; ISO with all downloaded packages) by deleting this folder:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
{{UserCmd|command=sudo rm -r /var/lib/manjaro-tools/buildiso/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
To clean your system of packages files of packages not installed on your system (this includes all the package files downloaded for your custom ISO): &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
{{UserCmd|command=sudo paccache -ruk0}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
You can also manually look into &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
/var/cache/manjaro-tools/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
and delete folders or files to your liking. If you want to delete all ISO images, package lists, and cached Xorg packages do:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
{{UserCmd|command=sudo rm -r /var/cache/manjaro-tools/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Please remember that all these packages and files are saved for your convenience. If you clean your system like suggested above, you have to download &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; packages and build &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; images again the next time you want to build your own Manjaro ISO.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
By default, your &amp;lt;code&amp;gt;manjaro-tools.conf&amp;lt;/code&amp;gt; file is saved. If you want to delete it, use&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
 {{UserCmd|command=rm -r ~/.config/manjaro-tools}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks= &amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Building a minimal ISO== &amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
A minimal ISO is easy to create by modifying an entry in the profile.conf file. Find the section&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # use extra packages as defined in pkglist to activate a full profile&lt;br /&gt;
 # extra=&amp;quot;false&amp;quot;&lt;br /&gt;
 extra=&amp;quot;true&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and remove the &amp;#039;&amp;#039;&amp;#039;#&amp;#039;&amp;#039;&amp;#039; mark in front of &amp;#039;&amp;#039;&amp;#039;extra = &amp;quot;false&amp;quot;&amp;#039;&amp;#039;&amp;#039; and add a &amp;#039;&amp;#039;&amp;#039;#&amp;#039;&amp;#039;&amp;#039; in front of &amp;#039;&amp;#039;&amp;#039;extra = &amp;quot;true&amp;quot;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
If you prefer not to change this you can always use the &amp;#039;&amp;#039;&amp;#039;-f&amp;#039;&amp;#039;&amp;#039; with buildiso to build a full profile.&lt;br /&gt;
&lt;br /&gt;
=See also= &amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
* Source: [https://gitlab.manjaro.org/profiles-and-settings/iso-profiles Manjaro Gitlab ISO Profiles] (master branch may be unstable - select the branch for latest release)&lt;br /&gt;
* Video: [https://youtu.be/B--je--m0VI Building Manjaro ISO by Philip Müller](Tutorial Video)&lt;br /&gt;
* Wiki: [[Buildiso with AUR packages: Using buildpkg]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
[[Category:ISO{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=CheatSheet/&amp;diff=54794</id>
		<title>CheatSheet/</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=CheatSheet/&amp;diff=54794"/>
		<updated>2025-09-05T17:19:46Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: df and btrfs fi us&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;!-- Example titles --&amp;gt;&lt;br /&gt;
= Commands CheatSheet for Manjaro =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Locating and Installing Packages ===&lt;br /&gt;
==== Using Pamac CLI ====&lt;br /&gt;
Install packages {{UserCmd|command=pamac install [PackageName]}}&lt;br /&gt;
Uninstall packages {{UserCmd|command=pamac remove [PackageName]}}&lt;br /&gt;
Search for a package {{UserCmd|command=pamac search [PackageName]}}&lt;br /&gt;
Update installed packages {{UserCmd|command=pamac upgrade}}&lt;br /&gt;
Check for updates {{UserCmd|command=pamac checkupdates}}&lt;br /&gt;
&lt;br /&gt;
==== Using native pacman ====&lt;br /&gt;
Install packages {{UserCmd|command=sudo pacman -Syu [PackageName]}}&lt;br /&gt;
Uninstall packages {{UserCmd|command=sudo pacman -Rns [PackageName]}}&lt;br /&gt;
Search for a package {{UserCmd|command=pacman -Ss [PackageName]}}&lt;br /&gt;
Update installed packages {{UserCmd|command=sudo pacman -Syu}}&lt;br /&gt;
Check for updates {{UserCmd|command=sudo pacman -Syu}}&lt;br /&gt;
&lt;br /&gt;
=== Maintenance ===&lt;br /&gt;
&lt;br /&gt;
Generates  a  random  mirrorlist for the users and sort them by their current access time. {{UserCmd|command=sudo pacman-mirrors --fasttrack}}&lt;br /&gt;
Generate cache list {{UserCmd|command=du -sh ~/.cache/*}}&lt;br /&gt;
Purge files not accessed in 100 days {{UserCmd|command=find ~/.cache/ -type f -atime +100 -delete}}&lt;br /&gt;
Report journal current size {{UserCmd|command=journalctl --disk-usage}}&lt;br /&gt;
Remove but recent entries by size or time {{UserCmd|command=journalctl --vacuum-size=50M}} {{UserCmd|command=journalctl --vacuum-time=2weeks}}&lt;br /&gt;
Check for orphaned packages {{UserCmd|command=pamac list -o }}&lt;br /&gt;
Remove all orphans {{UserCmd|command=pamac remove -o }}&lt;br /&gt;
Remove all packages except the latest 3 versions {{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
=== AUR ===&lt;br /&gt;
&lt;br /&gt;
Search for package {{UserCmd|command=pamac search -a [PackageName]}}&lt;br /&gt;
Build the package {{UserCmd|command=pamac build [PackageName]}}&lt;br /&gt;
&lt;br /&gt;
=== Access rights ===&lt;br /&gt;
&lt;br /&gt;
Execute command as root {{UserCmd|command=sudo [command]}}&lt;br /&gt;
Empty password cache {{UserCmd|command=sudo -k}}&lt;br /&gt;
Change user password {{UserCmd|command=passwd username}}&lt;br /&gt;
Change owner and group of file {{UserCmd|command=chown [owner]:[group] -c [file]}}&lt;br /&gt;
Change file permissions {{UserCmd|command=chmod [permissions] -c [file]}}&lt;br /&gt;
Set permissions in octal mode: 4(read) 2(write) 1(execute)&lt;br /&gt;
&lt;br /&gt;
Example: 755 read-write-execute for owner and read-execute for group and others&lt;br /&gt;
&lt;br /&gt;
Display files and permissions [of directory]{{UserCmd|command=ls -lh [dir]}}&lt;br /&gt;
&lt;br /&gt;
=== Files and Directories ===&lt;br /&gt;
&lt;br /&gt;
Change the working directory {{UserCmd|command=cd [dir]}}&lt;br /&gt;
Change to parent directory {{UserCmd|command=cd ..}}&lt;br /&gt;
List directory contents {{UserCmd|command=ls -l}}&lt;br /&gt;
List also hidden files {{UserCmd|command=ls -la}}&lt;br /&gt;
Copy file {{UserCmd|command=cp [file] [target]}}&lt;br /&gt;
Copy directory &amp;#039;&amp;#039;&amp;#039;recursively&amp;#039;&amp;#039;&amp;#039; {{UserCmd|command=cp -r [directory] [target]}}&lt;br /&gt;
Move or rename file/directory {{UserCmd|command=mv [source] [target]}}&lt;br /&gt;
Remove directory &amp;#039;&amp;#039;&amp;#039;recursively&amp;#039;&amp;#039;&amp;#039; {{UserCmd|command=rm -r [dir]}}&lt;br /&gt;
Create symbolic link {{UserCmd|command=ln -s [target] [link]}}&lt;br /&gt;
Mount filesystem {{UserCmd|command=mount -t [type] [/dev/sdx9] [mountpoint]}}&lt;br /&gt;
Mount ISO image {{UserCmd|command=mount -o loop [iso] [mountpoint]}}&lt;br /&gt;
Home directory of user {{UserCmd|command=cd /home/$USER}} {{UserCmd|command=cd ~}}&lt;br /&gt;
Directory with global configurations {{UserCmd|command=cd /etc}}&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
&lt;br /&gt;
Display network information {{UserCmd|command=nmcli}}&lt;br /&gt;
List wireless access points {{UserCmd|command=nmcli c}}&lt;br /&gt;
Enable firewall [package Community: ufw]  {{UserCmd|command=ufw enable}}&lt;br /&gt;
Allow/deny all incoming traffic {{UserCmd|command=ufw default [allow/deny]}}&lt;br /&gt;
Displays firewall status and rules {{UserCmd|command=ufw status}}&lt;br /&gt;
Allows/deny incoming traffic on the specified port {{UserCmd|command=ufw [allow/deny] [port]}}&lt;br /&gt;
Allows/deny incoming traffic from specified IP address {{UserCmd|command=ufw [allow/deny] from [ip]}}&lt;br /&gt;
&lt;br /&gt;
=== System and Screen ===&lt;br /&gt;
&lt;br /&gt;
Display kernel version {{UserCmd|command=uname -r}}&lt;br /&gt;
Display long kernel version {{UserCmd|command=uname -a}}&lt;br /&gt;
Report free disk space (non btrfs){{UserCmd|command=df [/] [/home]}} &lt;br /&gt;
Report free disk space (btrfs){{UserCmd|command=sudo btrfs filesystem usage -h [/]}}&lt;br /&gt;
Display system tasks  {{UserCmd|command=top}} {{UserCmd|command=htop}}&lt;br /&gt;
Display system information {{UserCmd|command=inxi --filter --verbosity=8}}&lt;br /&gt;
Display system information (from chroot){{UserCmd|command=inxi --filter --verbosity=8 --color}}&lt;br /&gt;
Display a tree of processes  {{UserCmd|command=pstree}}&lt;br /&gt;
&lt;br /&gt;
Switch to tty  &lt;br /&gt;
* {{key press|Ctrl|Alt|F1}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F2}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F3}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F4}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F5}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F6}}&lt;br /&gt;
&lt;br /&gt;
Switch to the X session &lt;br /&gt;
* {{key press|Ctrl|Alt|F7}}&lt;br /&gt;
&lt;br /&gt;
Start a unit {{UserCmd|command=systemctl start unit}}&lt;br /&gt;
Stop a unit {{UserCmd|command=systemctl stop unit}}&lt;br /&gt;
Check status of a unit {{UserCmd|command=systemctl status unit}}&lt;br /&gt;
Enable a unit {{UserCmd|command=systemctl enable unit}}&lt;br /&gt;
Disable a unit {{UserCmd|command=systemctl disable unit}}&lt;br /&gt;
Restart a unit {{UserCmd|command=systemctl restart unit}}&lt;br /&gt;
Shut down the system {{UserCmd|command=poweroff}}&lt;br /&gt;
Restart the system {{UserCmd|command=reboot}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- More Detail for formatter: https://www.mediawiki.org/wiki/Help:Formatting --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
&lt;br /&gt;
[https://forum.manjaro.org/t/manjaro-cli-cheat-sheet/101305 Original forum post]&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=CheatSheet/&amp;diff=54793</id>
		<title>CheatSheet/</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=CheatSheet/&amp;diff=54793"/>
		<updated>2025-09-05T17:12:20Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: added another inxi for chroot&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;!-- Example titles --&amp;gt;&lt;br /&gt;
= Commands CheatSheet for Manjaro =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Locating and Installing Packages ===&lt;br /&gt;
==== Using Pamac CLI ====&lt;br /&gt;
Install packages {{UserCmd|command=pamac install [PackageName]}}&lt;br /&gt;
Uninstall packages {{UserCmd|command=pamac remove [PackageName]}}&lt;br /&gt;
Search for a package {{UserCmd|command=pamac search [PackageName]}}&lt;br /&gt;
Update installed packages {{UserCmd|command=pamac upgrade}}&lt;br /&gt;
Check for updates {{UserCmd|command=pamac checkupdates}}&lt;br /&gt;
&lt;br /&gt;
==== Using native pacman ====&lt;br /&gt;
Install packages {{UserCmd|command=sudo pacman -Syu [PackageName]}}&lt;br /&gt;
Uninstall packages {{UserCmd|command=sudo pacman -Rns [PackageName]}}&lt;br /&gt;
Search for a package {{UserCmd|command=pacman -Ss [PackageName]}}&lt;br /&gt;
Update installed packages {{UserCmd|command=sudo pacman -Syu}}&lt;br /&gt;
Check for updates {{UserCmd|command=sudo pacman -Syu}}&lt;br /&gt;
&lt;br /&gt;
=== Maintenance ===&lt;br /&gt;
&lt;br /&gt;
Generates  a  random  mirrorlist for the users and sort them by their current access time. {{UserCmd|command=sudo pacman-mirrors --fasttrack}}&lt;br /&gt;
Generate cache list {{UserCmd|command=du -sh ~/.cache/*}}&lt;br /&gt;
Purge files not accessed in 100 days {{UserCmd|command=find ~/.cache/ -type f -atime +100 -delete}}&lt;br /&gt;
Report journal current size {{UserCmd|command=journalctl --disk-usage}}&lt;br /&gt;
Remove but recent entries by size or time {{UserCmd|command=journalctl --vacuum-size=50M}} {{UserCmd|command=journalctl --vacuum-time=2weeks}}&lt;br /&gt;
Check for orphaned packages {{UserCmd|command=pamac list -o }}&lt;br /&gt;
Remove all orphans {{UserCmd|command=pamac remove -o }}&lt;br /&gt;
Remove all packages except the latest 3 versions {{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
=== AUR ===&lt;br /&gt;
&lt;br /&gt;
Search for package {{UserCmd|command=pamac search -a [PackageName]}}&lt;br /&gt;
Build the package {{UserCmd|command=pamac build [PackageName]}}&lt;br /&gt;
&lt;br /&gt;
=== Access rights ===&lt;br /&gt;
&lt;br /&gt;
Execute command as root {{UserCmd|command=sudo [command]}}&lt;br /&gt;
Empty password cache {{UserCmd|command=sudo -k}}&lt;br /&gt;
Change user password {{UserCmd|command=passwd username}}&lt;br /&gt;
Change owner and group of file {{UserCmd|command=chown [owner]:[group] -c [file]}}&lt;br /&gt;
Change file permissions {{UserCmd|command=chmod [permissions] -c [file]}}&lt;br /&gt;
Set permissions in octal mode: 4(read) 2(write) 1(execute)&lt;br /&gt;
&lt;br /&gt;
Example: 755 read-write-execute for owner and read-execute for group and others&lt;br /&gt;
&lt;br /&gt;
Display files and permissions [of directory]{{UserCmd|command=ls -lh [dir]}}&lt;br /&gt;
&lt;br /&gt;
=== Files and Directories ===&lt;br /&gt;
&lt;br /&gt;
Change the working directory {{UserCmd|command=cd [dir]}}&lt;br /&gt;
Change to parent directory {{UserCmd|command=cd ..}}&lt;br /&gt;
List directory contents {{UserCmd|command=ls -l}}&lt;br /&gt;
List also hidden files {{UserCmd|command=ls -la}}&lt;br /&gt;
Copy file {{UserCmd|command=cp [file] [target]}}&lt;br /&gt;
Copy directory &amp;#039;&amp;#039;&amp;#039;recursively&amp;#039;&amp;#039;&amp;#039; {{UserCmd|command=cp -r [directory] [target]}}&lt;br /&gt;
Move or rename file/directory {{UserCmd|command=mv [source] [target]}}&lt;br /&gt;
Remove directory &amp;#039;&amp;#039;&amp;#039;recursively&amp;#039;&amp;#039;&amp;#039; {{UserCmd|command=rm -r [dir]}}&lt;br /&gt;
Create symbolic link {{UserCmd|command=ln -s [target] [link]}}&lt;br /&gt;
Mount filesystem {{UserCmd|command=mount -t [type] [/dev/sdx9] [mountpoint]}}&lt;br /&gt;
Mount ISO image {{UserCmd|command=mount -o loop [iso] [mountpoint]}}&lt;br /&gt;
Home directory of user {{UserCmd|command=cd /home/$USER}} {{UserCmd|command=cd ~}}&lt;br /&gt;
Directory with global configurations {{UserCmd|command=cd /etc}}&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
&lt;br /&gt;
Display network information {{UserCmd|command=nmcli}}&lt;br /&gt;
List wireless access points {{UserCmd|command=nmcli c}}&lt;br /&gt;
Enable firewall [package Community: ufw]  {{UserCmd|command=ufw enable}}&lt;br /&gt;
Allow/deny all incoming traffic {{UserCmd|command=ufw default [allow/deny]}}&lt;br /&gt;
Displays firewall status and rules {{UserCmd|command=ufw status}}&lt;br /&gt;
Allows/deny incoming traffic on the specified port {{UserCmd|command=ufw [allow/deny] [port]}}&lt;br /&gt;
Allows/deny incoming traffic from specified IP address {{UserCmd|command=ufw [allow/deny] from [ip]}}&lt;br /&gt;
&lt;br /&gt;
=== System and Screen ===&lt;br /&gt;
&lt;br /&gt;
Display kernel version {{UserCmd|command=uname -r}}&lt;br /&gt;
Display long kernel version {{UserCmd|command=uname -a}}&lt;br /&gt;
Report file system disk space usage {{UserCmd|command=df [/] [/home]}}  {{UserCmd|command=sudo btrfs filesystem usage -h [/]}}&lt;br /&gt;
Display system tasks  {{UserCmd|command=top}}  {{UserCmd|command=htop}}&lt;br /&gt;
Display system information {{UserCmd|command=inxi --filter --verbosity=8}}&lt;br /&gt;
Display system information (from chroot){{UserCmd|command=inxi --filter --verbosity=8 --color}}&lt;br /&gt;
Display a tree of processes  {{UserCmd|command=pstree}}&lt;br /&gt;
&lt;br /&gt;
Switch to tty  &lt;br /&gt;
* {{key press|Ctrl|Alt|F1}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F2}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F3}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F4}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F5}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F6}}&lt;br /&gt;
&lt;br /&gt;
Switch to the X session &lt;br /&gt;
* {{key press|Ctrl|Alt|F7}}&lt;br /&gt;
&lt;br /&gt;
Start a unit {{UserCmd|command=systemctl start unit}}&lt;br /&gt;
Stop a unit {{UserCmd|command=systemctl stop unit}}&lt;br /&gt;
Check status of a unit {{UserCmd|command=systemctl status unit}}&lt;br /&gt;
Enable a unit {{UserCmd|command=systemctl enable unit}}&lt;br /&gt;
Disable a unit {{UserCmd|command=systemctl disable unit}}&lt;br /&gt;
Restart a unit {{UserCmd|command=systemctl restart unit}}&lt;br /&gt;
Shut down the system {{UserCmd|command=poweroff}}&lt;br /&gt;
Restart the system {{UserCmd|command=reboot}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- More Detail for formatter: https://www.mediawiki.org/wiki/Help:Formatting --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
&lt;br /&gt;
[https://forum.manjaro.org/t/manjaro-cli-cheat-sheet/101305 Original forum post]&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=CheatSheet&amp;diff=54789</id>
		<title>CheatSheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=CheatSheet&amp;diff=54789"/>
		<updated>2025-09-03T15:49:28Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: inxi angepasst und btrfs disk free&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!-- Example titles --&amp;gt;&lt;br /&gt;
= Commands CheatSheet for Manjaro = &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Locating and Installing Packages === &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
==== Using Pamac CLI ====&lt;br /&gt;
Install packages {{UserCmd|command=pamac install [PackageName]}}&lt;br /&gt;
Uninstall packages {{UserCmd|command=pamac remove [PackageName]}}&lt;br /&gt;
Search for a package {{UserCmd|command=pamac search [PackageName]}}&lt;br /&gt;
Update installed packages {{UserCmd|command=pamac upgrade}}&lt;br /&gt;
Check for updates {{UserCmd|command=pamac checkupdates}}&lt;br /&gt;
&lt;br /&gt;
==== Using native pacman ==== &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Install packages {{UserCmd|command=sudo pacman -Syu [PackageName]}}&lt;br /&gt;
Uninstall packages {{UserCmd|command=sudo pacman -Rns [PackageName]}}&lt;br /&gt;
Search for a package {{UserCmd|command=pacman -Ss [PackageName]}}&lt;br /&gt;
Update installed packages {{UserCmd|command=sudo pacman -Syu}}&lt;br /&gt;
Check for updates {{UserCmd|command=sudo pacman -Syu}}&lt;br /&gt;
&lt;br /&gt;
=== Maintenance === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
Generates  a  random  mirrorlist for the users and sort them by their current access time. {{UserCmd|command=sudo pacman-mirrors --fasttrack}}&lt;br /&gt;
Generate cache list {{UserCmd|command=du -sh ~/.cache/*}}&lt;br /&gt;
Purge files not accessed in 100 days {{UserCmd|command=find ~/.cache/ -type f -atime +100 -delete}}&lt;br /&gt;
Report journal current size {{UserCmd|command=journalctl --disk-usage}}&lt;br /&gt;
Remove but recent entries by size or time {{UserCmd|command=journalctl --vacuum-size=50M}} {{UserCmd|command=journalctl --vacuum-time=2weeks}}&lt;br /&gt;
Check for orphaned packages {{UserCmd|command=pamac list -o }}&lt;br /&gt;
Remove all orphans {{UserCmd|command=pamac remove -o }}&lt;br /&gt;
Remove all packages except the latest 3 versions {{UserCmd|command=pamac clean --keep 3}}&lt;br /&gt;
&lt;br /&gt;
=== AUR === &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
Search for package {{UserCmd|command=pamac search -a [PackageName]}}&lt;br /&gt;
Build the package {{UserCmd|command=pamac build [PackageName]}}&lt;br /&gt;
&lt;br /&gt;
=== Access rights === &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Execute command as root {{UserCmd|command=sudo [command]}}&lt;br /&gt;
Empty password cache {{UserCmd|command=sudo -k}}&lt;br /&gt;
Change user password {{UserCmd|command=passwd username}}&lt;br /&gt;
Change owner and group of file {{UserCmd|command=chown [owner]:[group] -c [file]}}&lt;br /&gt;
Change file permissions {{UserCmd|command=chmod [permissions] -c [file]}}&lt;br /&gt;
Set permissions in octal mode: 4(read) 2(write) 1(execute)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
Example: 755 read-write-execute for owner and read-execute for group and others&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Display files and permissions [of directory]{{UserCmd|command=ls -lh [dir]}}&lt;br /&gt;
&lt;br /&gt;
=== Files and Directories === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
Change the working directory {{UserCmd|command=cd [dir]}}&lt;br /&gt;
Change to parent directory {{UserCmd|command=cd ..}}&lt;br /&gt;
List directory contents {{UserCmd|command=ls -l}}&lt;br /&gt;
List also hidden files {{UserCmd|command=ls -la}}&lt;br /&gt;
Copy file {{UserCmd|command=cp [file] [target]}}&lt;br /&gt;
Copy directory &amp;#039;&amp;#039;&amp;#039;recursively&amp;#039;&amp;#039;&amp;#039; {{UserCmd|command=cp -r [directory] [target]}}&lt;br /&gt;
Move or rename file/directory {{UserCmd|command=mv [source] [target]}}&lt;br /&gt;
Remove directory &amp;#039;&amp;#039;&amp;#039;recursively&amp;#039;&amp;#039;&amp;#039; {{UserCmd|command=rm -r [dir]}}&lt;br /&gt;
Create symbolic link {{UserCmd|command=ln -s [target] [link]}}&lt;br /&gt;
Mount filesystem {{UserCmd|command=mount -t [type] [/dev/sdx9] [mountpoint]}}&lt;br /&gt;
Mount ISO image {{UserCmd|command=mount -o loop [iso] [mountpoint]}}&lt;br /&gt;
Home directory of user {{UserCmd|command=cd /home/$USER}} {{UserCmd|command=cd ~}}&lt;br /&gt;
Directory with global configurations {{UserCmd|command=cd /etc}}&lt;br /&gt;
&lt;br /&gt;
=== Network === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
Display network information {{UserCmd|command=nmcli}}&lt;br /&gt;
List wireless access points {{UserCmd|command=nmcli c}}&lt;br /&gt;
Enable firewall [package Community: ufw]  {{UserCmd|command=ufw enable}}&lt;br /&gt;
Allow/deny all incoming traffic {{UserCmd|command=ufw default [allow/deny]}}&lt;br /&gt;
Displays firewall status and rules {{UserCmd|command=ufw status}}&lt;br /&gt;
Allows/deny incoming traffic on the specified port {{UserCmd|command=ufw [allow/deny] [port]}}&lt;br /&gt;
Allows/deny incoming traffic from specified IP address {{UserCmd|command=ufw [allow/deny] from [ip]}}&lt;br /&gt;
&lt;br /&gt;
=== System and Screen === &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Display kernel version {{UserCmd|command=uname -r}}&lt;br /&gt;
Display long kernel version {{UserCmd|command=uname -a}}&lt;br /&gt;
&lt;br /&gt;
Report file system free space (non btrfs) {{UserCmd|command=df [/] [/home]}} &lt;br /&gt;
Report file system free space (btrfs) {{UserCmd|command=sudo btrfs filesystem usage -h [/]}}&lt;br /&gt;
Display system tasks  {{UserCmd|command=top}}  {{UserCmd|command=htop}}&lt;br /&gt;
Display system information {{UserCmd|command=sudo inxi --verbosity=8 --filter}}&lt;br /&gt;
Display system information (from chroot) {{UserCmd|command=inxi --verbosity=8 --filter --color}}&lt;br /&gt;
Display a tree of processes  {{UserCmd|command=pstree}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
Switch to tty  &lt;br /&gt;
* {{key press|Ctrl|Alt|F1}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F2}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F3}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F4}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F5}} &lt;br /&gt;
* {{key press|Ctrl|Alt|F6}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Switch to the X session &lt;br /&gt;
* {{key press|Ctrl|Alt|F7}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
Start a unit {{UserCmd|command=systemctl start unit}}&lt;br /&gt;
Stop a unit {{UserCmd|command=systemctl stop unit}}&lt;br /&gt;
Check status of a unit {{UserCmd|command=systemctl status unit}}&lt;br /&gt;
Enable a unit {{UserCmd|command=systemctl enable unit}}&lt;br /&gt;
Disable a unit {{UserCmd|command=systemctl disable unit}}&lt;br /&gt;
Restart a unit {{UserCmd|command=systemctl restart unit}}&lt;br /&gt;
Shut down the system {{UserCmd|command=poweroff}}&lt;br /&gt;
Restart the system {{UserCmd|command=reboot}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&amp;lt;!-- More Detail for formatter: https://www.mediawiki.org/wiki/Help:Formatting --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=See Also= &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
[https://forum.manjaro.org/t/manjaro-cli-cheat-sheet/101305 Original forum post]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54776</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54776"/>
		<updated>2025-07-13T14:27:32Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: How to balance metadata&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don&amp;#039;t forget to delete snapshots, or you&amp;#039;ll soon run into &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]] problems&amp;#039;&amp;#039;&amp;#039;. Btrfs needs free space (at least 5 GB) to do its work. If your volume is more than 90% full, you&amp;#039;ll need to figure out what to do (quickly). Even a Manjaro update can be more than 10 GB in size, so you&amp;#039;ll always need some free space.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need (starting with the oldest one!)&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to delete snapshots before you run out of space|Each time you create a snapshot, you only use the &amp;#039;&amp;#039;&amp;#039;rest of the volume&amp;#039;&amp;#039;&amp;#039; to save all changes. Eventually, you&amp;#039;ll need to free the snapshot. Don&amp;#039;t overuse the space. Btrfs needs &amp;#039;&amp;#039;&amp;#039;breathing room.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more than &amp;#039;&amp;#039;&amp;#039;95%&amp;#039;&amp;#039;&amp;#039; and leave at least &amp;#039;&amp;#039;&amp;#039;5 GB free&amp;#039;&amp;#039;&amp;#039;, or you&amp;#039;ll be in big trouble.}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 95%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 85% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
=== Metadata ===&lt;br /&gt;
It is rarely recommended to include blocks with metadata in a balance. It is advantageous, in exceptional cases, if the following conditions are currently met:&lt;br /&gt;
You can check with:&lt;br /&gt;
{{RootCmd|command=sudo btrfs fi us /|grep &amp;#039;Meta.*Size&amp;#039;}}&lt;br /&gt;
{{ic|Metadata,RAID1: Size:9.00GiB, Used:6.58GiB (73.09%)}}&lt;br /&gt;
* Several GB of metadata are present in your filesystem (&amp;#039;&amp;#039;6.6 GB present, 9 GB used&amp;#039;&amp;#039;)&lt;br /&gt;
* This metadata is poorly distributed (&amp;#039;&amp;#039;73%&amp;#039;&amp;#039;)&lt;br /&gt;
* Significantly more than one full GB could become free (9 GB - 6.6 GB ==&amp;gt; &amp;#039;&amp;#039;2.4 GB could become free&amp;#039;&amp;#039;)&lt;br /&gt;
The command is then:&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=95 /}}&lt;br /&gt;
Btrfs had to move 9 GB of metadata to free up 1 GB ! &lt;br /&gt;
{{ic|Metadata,RAID1: Size:8.00GiB, Used:6.58GiB (82.20%)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t skimp on storage space when creating a Btrfs volume. A Btrfs volume should normally be less than 90% full. Then it&amp;#039;s recommended to adjust the volume. In an emergency, 95% (plus at least 5 GB free) is fine. However, this isn&amp;#039;t beneficial for neither the Btrfs volume nor an SSD.&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039; (starting with the oldest one)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full (plus 5 GB free space)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90-95 %) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54775</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54775"/>
		<updated>2025-07-13T13:38:29Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: /* Get out of jail */ beginn with oldest snapshot&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don&amp;#039;t forget to delete snapshots, or you&amp;#039;ll soon run into &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]] problems&amp;#039;&amp;#039;&amp;#039;. Btrfs needs free space (at least 5 GB) to do its work. If your volume is more than 90% full, you&amp;#039;ll need to figure out what to do (quickly). Even a Manjaro update can be more than 10 GB in size, so you&amp;#039;ll always need some free space.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need (starting with the oldest one!)&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to delete snapshots before you run out of space|Each time you create a snapshot, you only use the &amp;#039;&amp;#039;&amp;#039;rest of the volume&amp;#039;&amp;#039;&amp;#039; to save all changes. Eventually, you&amp;#039;ll need to free the snapshot. Don&amp;#039;t overuse the space. Btrfs needs &amp;#039;&amp;#039;&amp;#039;breathing room.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more than &amp;#039;&amp;#039;&amp;#039;95%&amp;#039;&amp;#039;&amp;#039; and leave at least &amp;#039;&amp;#039;&amp;#039;5 GB free&amp;#039;&amp;#039;&amp;#039;, or you&amp;#039;ll be in big trouble.}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 95%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 85% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t skimp on storage space when creating a Btrfs volume. A Btrfs volume should normally be less than 90% full. Then it&amp;#039;s recommended to adjust the volume. In an emergency, 95% (plus at least 5 GB free) is fine. However, this isn&amp;#039;t beneficial for neither the Btrfs volume nor an SSD.&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039; (starting with the oldest one)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full (plus 5 GB free space)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90-95 %) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54774</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54774"/>
		<updated>2025-07-13T13:35:14Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: delete oldest snapshot first&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don&amp;#039;t forget to delete snapshots, or you&amp;#039;ll soon run into &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]] problems&amp;#039;&amp;#039;&amp;#039;. Btrfs needs free space (at least 5 GB) to do its work. If your volume is more than 90% full, you&amp;#039;ll need to figure out what to do (quickly). Even a Manjaro update can be more than 10 GB in size, so you&amp;#039;ll always need some free space.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need (starting with the oldest one!)&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to delete snapshots before you run out of space|Each time you create a snapshot, you only use the &amp;#039;&amp;#039;&amp;#039;rest of the volume&amp;#039;&amp;#039;&amp;#039; to save all changes. Eventually, you&amp;#039;ll need to free the snapshot. Don&amp;#039;t overuse the space. Btrfs needs &amp;#039;&amp;#039;&amp;#039;breathing room.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more than &amp;#039;&amp;#039;&amp;#039;95%&amp;#039;&amp;#039;&amp;#039; and leave at least &amp;#039;&amp;#039;&amp;#039;5 GB free&amp;#039;&amp;#039;&amp;#039;, or you&amp;#039;ll be in big trouble.}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 95%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 85% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t skimp on storage space when creating a Btrfs volume. A Btrfs volume should normally be less than 90% full. Then it&amp;#039;s recommended to adjust the volume. In an emergency, 95% (plus at least 5 GB free) is fine. However, this isn&amp;#039;t beneficial for neither the Btrfs volume nor an SSD.&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full (plus 5 GB free space)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90-95 %) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54773</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54773"/>
		<updated>2025-07-13T05:55:35Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: 90 -&amp;gt; 95 %&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don&amp;#039;t forget to delete snapshots, or you&amp;#039;ll soon run into &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]] problems&amp;#039;&amp;#039;&amp;#039;. Btrfs needs free space (at least 5 GB) to do its work. If your volume is more than 90% full, you&amp;#039;ll need to figure out what to do (quickly). Even a Manjaro update can be more than 10 GB in size, so you&amp;#039;ll always need some free space.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to delete snapshots before you run out of space|Each time you create a snapshot, you only use the &amp;#039;&amp;#039;&amp;#039;rest of the volume&amp;#039;&amp;#039;&amp;#039; to save all changes. Eventually, you&amp;#039;ll need to free the snapshot. Don&amp;#039;t overuse the space. Btrfs needs &amp;#039;&amp;#039;&amp;#039;breathing room.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more than &amp;#039;&amp;#039;&amp;#039;95%&amp;#039;&amp;#039;&amp;#039; and leave at least &amp;#039;&amp;#039;&amp;#039;5 GB free&amp;#039;&amp;#039;&amp;#039;, or you&amp;#039;ll be in big trouble.}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 95%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 85% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t skimp on storage space when creating a Btrfs volume. A Btrfs volume should normally be less than 90% full. Then it&amp;#039;s recommended to adjust the volume. In an emergency, 95% (plus at least 5 GB free) is fine. However, this isn&amp;#039;t beneficial for neither the Btrfs volume nor an SSD.&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full (plus 5 GB free space)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90-95 %) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54772</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54772"/>
		<updated>2025-07-13T05:54:30Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: /* Get out of jail */ 95% plus 5 GB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don&amp;#039;t forget to delete snapshots, or you&amp;#039;ll soon run into &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]] problems&amp;#039;&amp;#039;&amp;#039;. Btrfs needs free space (at least 5 GB) to do its work. If your volume is more than 90% full, you&amp;#039;ll need to figure out what to do (quickly). Even a Manjaro update can be more than 10 GB in size, so you&amp;#039;ll always need some free space.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to delete snapshots before you run out of space|Each time you create a snapshot, you only use the &amp;#039;&amp;#039;&amp;#039;rest of the volume&amp;#039;&amp;#039;&amp;#039; to save all changes. Eventually, you&amp;#039;ll need to free the snapshot. Don&amp;#039;t overuse the space. Btrfs needs &amp;#039;&amp;#039;&amp;#039;breathing room.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more than &amp;#039;&amp;#039;&amp;#039;95%&amp;#039;&amp;#039;&amp;#039; and leave at least &amp;#039;&amp;#039;&amp;#039;5 GB free&amp;#039;&amp;#039;&amp;#039;, or you&amp;#039;ll be in big trouble.}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 85% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t skimp on storage space when creating a Btrfs volume. A Btrfs volume should normally be less than 90% full. Then it&amp;#039;s recommended to adjust the volume. In an emergency, 95% (plus at least 5 GB free) is fine. However, this isn&amp;#039;t beneficial for neither the Btrfs volume nor an SSD.&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full (plus 5 GB free space)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90-95 %) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54771</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54771"/>
		<updated>2025-07-13T05:50:06Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Grenze neu definiert 95% +5 GB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don&amp;#039;t forget to delete snapshots, or you&amp;#039;ll soon run into &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]] problems&amp;#039;&amp;#039;&amp;#039;. Btrfs needs free space (at least 5 GB) to do its work. If your volume is more than 90% full, you&amp;#039;ll need to figure out what to do (quickly). Even a Manjaro update can be more than 10 GB in size, so you&amp;#039;ll always need some free space.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to delete snapshots before you run out of space|Each time you create a snapshot, you only use the &amp;#039;&amp;#039;&amp;#039;rest of the volume&amp;#039;&amp;#039;&amp;#039; to save all changes. Eventually, you&amp;#039;ll need to free the snapshot. Don&amp;#039;t overuse the space. Btrfs needs &amp;#039;&amp;#039;&amp;#039;breathing room.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more than &amp;#039;&amp;#039;&amp;#039;95%&amp;#039;&amp;#039;&amp;#039; and leave at least &amp;#039;&amp;#039;&amp;#039;5 GB free&amp;#039;&amp;#039;&amp;#039;, or you&amp;#039;ll be in big trouble.}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 85% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t skimp on storage space when creating a Btrfs volume. A Btrfs volume should normally be less than 90% full. Then it&amp;#039;s recommended to adjust the volume. In an emergency, 95% (plus at least 5 GB free) is fine. However, this isn&amp;#039;t beneficial for neither the Btrfs volume nor an SSD.&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54770</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54770"/>
		<updated>2025-07-13T05:43:26Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: set limit to 85%&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don&amp;#039;t forget to delete snapshots, or you&amp;#039;ll soon run into &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]] problems&amp;#039;&amp;#039;&amp;#039;. Btrfs needs free space (at least 5 GB) to do its work. If your volume is more than 90% full, you&amp;#039;ll need to figure out what to do (quickly). Even a Manjaro update can be more than 10 GB in size, so you&amp;#039;ll always need some free space.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to delete snapshots before you run out of space|Each time you create a snapshot, you only use the &amp;#039;&amp;#039;&amp;#039;rest of the volume&amp;#039;&amp;#039;&amp;#039; to save all changes. Eventually, you&amp;#039;ll need to free the snapshot. Don&amp;#039;t overuse the space. Btrfs needs &amp;#039;&amp;#039;&amp;#039;breathing room.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more than &amp;#039;&amp;#039;&amp;#039;95%&amp;#039;&amp;#039;&amp;#039; and leave at least &amp;#039;&amp;#039;&amp;#039;5 GB free&amp;#039;&amp;#039;&amp;#039;, or you&amp;#039;ll be in big trouble.}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 85% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54769</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54769"/>
		<updated>2025-07-13T05:40:46Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: change limit to 95% + 5GB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don&amp;#039;t forget to delete snapshots, or you&amp;#039;ll soon run into &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]] problems&amp;#039;&amp;#039;&amp;#039;. Btrfs needs free space (at least 5 GB) to do its work. If your volume is more than 90% full, you&amp;#039;ll need to figure out what to do (quickly). Even a Manjaro update can be more than 10 GB in size, so you&amp;#039;ll always need some free space.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to delete snapshots before you run out of space|Each time you create a snapshot, you only use the &amp;#039;&amp;#039;&amp;#039;rest of the volume&amp;#039;&amp;#039;&amp;#039; to save all changes. Eventually, you&amp;#039;ll need to free the snapshot. Don&amp;#039;t overuse the space. Btrfs needs &amp;#039;&amp;#039;&amp;#039;breathing room.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more than &amp;#039;&amp;#039;&amp;#039;95%&amp;#039;&amp;#039;&amp;#039; and leave at least &amp;#039;&amp;#039;&amp;#039;5 GB free&amp;#039;&amp;#039;&amp;#039;, or you&amp;#039;ll be in big trouble.}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54768</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54768"/>
		<updated>2025-07-13T05:33:33Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Increased limits to 90%, 5 GB, 10 GB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don&amp;#039;t forget to delete snapshots, or you&amp;#039;ll soon run into &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]] problems&amp;#039;&amp;#039;&amp;#039;. Btrfs needs free space (at least 5 GB) to do its work. If your volume is more than 90% full, you&amp;#039;ll need to figure out what to do (quickly). Even a Manjaro update can be more than 10 GB in size, so you&amp;#039;ll always need some free space.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get deep into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54706</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54706"/>
		<updated>2025-06-17T16:24:38Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: scrub&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]]-trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 85% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get deep into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog.&lt;br /&gt;
&lt;br /&gt;
With btrfs scrub, you can force btrfs to repair all corrupted blocks. This can take a long time because all blocks containing data must be read to verify the checksums.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54705</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54705"/>
		<updated>2025-06-17T16:17:18Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: or&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]]-trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 85% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get deep into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one or more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This repair can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54618</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=54618"/>
		<updated>2025-04-27T14:40:31Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: how to delet them&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s best to delete snapshots using the tool that created them.&lt;br /&gt;
* If you used Snapper to create them, delete them using Snapper.&lt;br /&gt;
* If you used Timeshift to create them, delete them using Timeshift.&lt;br /&gt;
* If you created them manually, delete them manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]]-trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 85% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get deep into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This repair can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs_Maintenance&amp;diff=54617</id>
		<title>Btrfs Maintenance</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs_Maintenance&amp;diff=54617"/>
		<updated>2025-04-26T18:03:54Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: -musage is not recommended because it rotates metadata&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- This is a boilerplot to help you --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Example titles --&amp;gt;&lt;br /&gt;
= Btrfs Maintenance =&lt;br /&gt;
&lt;br /&gt;
== Btrfs needs no maintenance ==&lt;br /&gt;
&lt;br /&gt;
This can even be true when:&lt;br /&gt;
* You always keep 10% of your volume &amp;#039;&amp;#039;&amp;#039;unallocated&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{BoxWarning|free or unallocated|I&amp;#039;m not saying &amp;quot;free&amp;quot; because with btrfs, free means nothing. The value you need to pay most attention to is &amp;#039;&amp;#039;&amp;#039;unallocated&amp;#039;&amp;#039;&amp;#039; ! }}&lt;br /&gt;
&lt;br /&gt;
==== Every filesystem needs some maintenance ====&lt;br /&gt;
&lt;br /&gt;
Some filesystems do an automatic chkfs at every XX. mount.&lt;br /&gt;
Others need the user to do a chkfs manually. On most you have to watch not to fill them to 100%. Others reserve 5% for root.&lt;br /&gt;
Some filesystems need to be defragmented. Others do not.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Every filesystem has its own needs and tools !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Automatic maintenance ==&lt;br /&gt;
Btrfs does some maintenance automatically.&lt;br /&gt;
&lt;br /&gt;
=== Is the Volume in a clean state ===&lt;br /&gt;
At mount btrfs tests wehter the volume is in a clean state.&lt;br /&gt;
&lt;br /&gt;
==== power down ====&lt;br /&gt;
Most file systems are not prepared for a sudden loss of power. If the computer suddenly loses power, transactions may not be written or only partially written to the volume. File systems that use journaling can often recover after a power failure.&lt;br /&gt;
&lt;br /&gt;
Btrfs attempts to clean the volume by removing the last (uncompleted) action. This can result in losing the last changes you made before turning off. But you get a clean file system that doesn&amp;#039;t need to be repaired.&lt;br /&gt;
&lt;br /&gt;
==== error ====&lt;br /&gt;
If btrfs encounters an unrecoverable error, such as a checksum mismatch, the filesystem will be mounted &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. (When using RAID2, such errors are auto-repaired)&lt;br /&gt;
&lt;br /&gt;
==== clean ====&lt;br /&gt;
btrfs will mount the subvolume read-write.&lt;br /&gt;
&lt;br /&gt;
== Manual Maintenance ==&lt;br /&gt;
From time to time it may be advisable to check the health of a btrfs volume.&lt;br /&gt;
{{BoxInfo|Note| Btrfs is used to perform all maintenance on &amp;#039;&amp;#039;&amp;#039;a normally running system&amp;#039;&amp;#039;&amp;#039;. The volume can be fully used. Shutting down during such an action is also unproblematic. Btrfs will keep running the action after the next launch until it completes.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
Check if the &amp;#039;&amp;#039;&amp;#039;unallocated&amp;#039;&amp;#039;&amp;#039; space on your volume is ok.&lt;br /&gt;
&lt;br /&gt;
==== check unallocated space ====&lt;br /&gt;
&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage -h /}}&lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|Pay special attention to &amp;#039;&amp;#039;&amp;#039;unallocated&amp;#039;&amp;#039;&amp;#039; !|The commonly used term &amp;quot;free&amp;quot; is meaningless to btrfs users. Even if you have 50% of your volume &amp;quot;free&amp;quot;, you can run out of storage space. }}&lt;br /&gt;
&lt;br /&gt;
Try to leave &amp;#039;&amp;#039;&amp;#039;at least 10%&amp;#039;&amp;#039;&amp;#039; of your volume unallocated. If this got below 10%:&lt;br /&gt;
* Expand the volume to double size (see: [[Btrfs]])&lt;br /&gt;
* Delete some unused data&lt;br /&gt;
* Delete some old snapshots&lt;br /&gt;
* Balance ([[Btrfs]])&lt;br /&gt;
&lt;br /&gt;
==== Clean up unused snapshots ====&lt;br /&gt;
From time to time it is necessary to check if you have snapshots that you no longer need but that are taking up valuable space on your volume.&lt;br /&gt;
&lt;br /&gt;
=== Balance your free disk space ===&lt;br /&gt;
If you have some &amp;quot;free&amp;quot; space on your volume, but the unallocated space is below 10% (or close to 10%), you can help btrfs to rebalance some parts.&lt;br /&gt;
&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
Btrfs looks for chunks that contain more than 50% free space. It will take 2 of them and then move everything into a new chunk. After that, a chunk is released. This continues until each chunk is at least 50% full.&lt;br /&gt;
&lt;br /&gt;
This will give you some unallocated (free) chunks that help btrfs **not** to get out of space.&lt;br /&gt;
&lt;br /&gt;
If you have less than 20% unallocated space, please do the following:&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=75 /}}&lt;br /&gt;
Btrfs looks for chunks that are less than 75% full.&lt;br /&gt;
It will take 4 of them and then move everything into 3 new chunks. After that, a chunk can be released. This continues until each chunk is at least 75% full.&lt;br /&gt;
&lt;br /&gt;
If you still have less than 20% unallocated space, please do the following:&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
&lt;br /&gt;
=== scrub ===&lt;br /&gt;
Check if everything is ok with the checksums and the readability of your data. &amp;#039;&amp;#039;&amp;#039;Only do this when in doubt&amp;#039;&amp;#039;&amp;#039;. This may take a long time as btrfs has to read ALL the data. Btrfs only scans the portion of your volume that actually contains data.&lt;br /&gt;
&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BoxSuccess|Want to watch how btrfs works ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a separate terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}}&lt;br /&gt;
&lt;br /&gt;
== special cases ==&lt;br /&gt;
There seem to be some cases where additional maintenance is needed.&lt;br /&gt;
==== SSD ====&lt;br /&gt;
Btrfs is optimal for SSDs due to its CoW nature&lt;br /&gt;
&lt;br /&gt;
===== Read rate degradation (unconfirmed) =====&lt;br /&gt;
This isn&amp;#039;t a problem with SSDs in general, it just seems to happen in a few rare cases. Updating the firmware should then solve the problem.&lt;br /&gt;
One way to test the read speed with btrfs is to read out all the data (scrub). If your SSD seems to have this RRD issue, &amp;#039;&amp;#039;&amp;#039;balancing&amp;#039;&amp;#039;&amp;#039; will help so that all data is written to a new location. This can be done while the system is running! But please only &amp;#039;&amp;#039;&amp;#039;once&amp;#039;&amp;#039;&amp;#039; a year!&lt;br /&gt;
&lt;br /&gt;
{{RootCmd|command=btrfs balance start --full-balance /}}&lt;br /&gt;
This will take a long time. You can shut down your PC at any time. Do not be surprised. The &amp;quot;balance&amp;quot; will restart after booting until done!&lt;br /&gt;
&lt;br /&gt;
If you want your data to rotate:&lt;br /&gt;
&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dlimit=10 /}}&lt;br /&gt;
This rewrites 10 chunks at a time. This can be used weekly if you find it necessary.&lt;br /&gt;
&lt;br /&gt;
==== Rotating disks ====&lt;br /&gt;
On spinning disks, fragmentation can become an issue in some rare use cases. Then you can defragment your Btrfs volume.&lt;br /&gt;
&lt;br /&gt;
===== Defragmentation (not recommended) =====&lt;br /&gt;
This is NOT the same as defragmentation in older Windows file systems. Btrfs does NOT require defragmentation as normal maintenance. Only do this if you can measure a huge read performance loss because a specific file/database is fragmented!&lt;br /&gt;
{{BoxDanger|Defragment only these specific files|Defragmenting an entire Btrfs volume does not increase its speed, it just wears out the device}}&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
[[Btrfs]] Learn basics about btrfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Set_all_Qt_app%27s_to_use_GTK%2B_font_%26_theme_settings&amp;diff=54184</id>
		<title>Set all Qt app&#039;s to use GTK+ font &amp; theme settings</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Set_all_Qt_app%27s_to_use_GTK%2B_font_%26_theme_settings&amp;diff=54184"/>
		<updated>2025-02-09T16:32:19Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: https://forum.manjaro.org/t/layout-of-qt5-programs-are-broken-after-stable-update-2025-02-04/173985/3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
{{SectionTemplate|&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt; Overview&amp;lt;/translate&amp;gt;|&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
When using a [[Desktop_Environments|Desktop Environment]] or Window Manager that doesn&amp;#039;t allow for the settings of QT themes, you can set QT to use your GTK themes instead. &lt;br /&gt;
&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{SectionTemplate|&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Using qt5ct&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
|2=&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
{{BoxInfo|note|In some Manjaro editions, this is already done for you by default}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Install {{ic|qt5ct}} using your favorite package manager or the command:&lt;br /&gt;
{{UserCmd|command=pamac install qt5ct}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
Set environment variables in {{ic|~/.profile}} by adding or updating the following lines:&lt;br /&gt;
{{File|file=~/.profile|content=&amp;lt;pre&amp;gt;export QT_QPA_PLATFORMTHEME=&amp;quot;qt5ct&amp;quot;&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add the following line to {{ic|~/.bash_profile}} if it does not already exist:&lt;br /&gt;
{{File|file=~/.bash_profile|content=&amp;lt;pre&amp;gt;[[ -f ~/.profile ]] &amp;amp;&amp;amp; . ~/.profile&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Reboot the computer (or logout and re-login)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Run the application &amp;#039;&amp;#039;&amp;#039;QT5 Configuration Manager&amp;#039;&amp;#039;&amp;#039; from the menu or run the command {{ic|qt5ct}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
Logout and login again to make the change effective&lt;br /&gt;
&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{SectionTemplate|&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt; [[File:Chmsee-icon.png|left|36px]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; See Also&amp;lt;/translate&amp;gt;|&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/Uniform_Look_for_Qt_and_GTK_Applications Arch Wiki]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53914</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53914"/>
		<updated>2024-12-30T16:07:21Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: BoxWarning&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]]-trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 85% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get deep into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This repair can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a (unformatted) partition&amp;#039;&amp;#039;&amp;#039; (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! &amp;#039;&amp;#039;&amp;#039;Do not boot without it&amp;#039;&amp;#039;&amp;#039;. If possible do not reboot at all in this stage! This USB-stick has to stay until &amp;#039;&amp;#039;&amp;#039;btrfs device remove&amp;#039;&amp;#039;&amp;#039; has &amp;#039;&amp;#039;&amp;#039;completed&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* If neccesary &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(90%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* After &amp;quot;btrfs remove&amp;quot; has finished successfully, you can remove the USB stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53913</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53913"/>
		<updated>2024-12-30T15:38:44Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Bulletproof&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]]-trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 85% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get deep into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using RAID 1 btrfs mirrors &amp;#039;&amp;#039;&amp;#039;data and metadata&amp;#039;&amp;#039;&amp;#039;. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This repair can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
{{BoxInfo|Bulletproof your system|If you have enough storage space and it is spread across 2 devices, it is really advisable to use btrfs RAID1/10. This will cover a whole range of risks that would be impossible to manage without RAID. At the same time, RAID in BTRFS is as straightforward as it gets.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53912</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53912"/>
		<updated>2024-12-30T15:24:51Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: deep&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]]-trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 85% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to &amp;#039;&amp;#039;&amp;#039;replace&amp;#039;&amp;#039;&amp;#039; the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get deep into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53911</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53911"/>
		<updated>2024-12-30T15:21:58Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: link zu out of space und add&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Out_of_space|out of space]]-trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 85% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Extend_a_volume|Add]]&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (This does only help if they are not part of &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53910</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53910"/>
		<updated>2024-12-30T15:16:18Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: link zu out of space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run [[Btrfs#Out_of_space|out of space]]&amp;#039;&amp;#039;&amp;#039;  soon.&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53909</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53909"/>
		<updated>2024-12-30T15:10:37Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: ls -lA&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -lA /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53908</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53908"/>
		<updated>2024-12-30T15:07:56Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: BoxInfo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
{{BoxInfo|In order to make a rollback possible|The snapshot has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53907</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53907"/>
		<updated>2024-12-30T15:04:17Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: backup of snapshot&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, (or to restore one of the external backups of a snapshot) &amp;#039;&amp;#039;&amp;#039;without changing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-6.xx-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-6.xx-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/6.xx.xx-x-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53906</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53906"/>
		<updated>2024-12-30T14:54:44Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: btrfs sen linked&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work. It is also possible to send a ro-snapshot to another btrfs volume as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Send_.2B_receive_.3D_backup_.E2.87.92|backup]]&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume (or backups with send/receive) to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, or to restore one of the backups of this subvolume &amp;#039;&amp;#039;&amp;#039;without loosing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-5.10-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-5.10-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/5.10.59-1-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=53905</id>
		<title>File Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=53905"/>
		<updated>2024-12-30T14:38:43Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Btrfs out of space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This page provides information on some of the filesystems commonly used in Manjaro. It also shows where and how they are used. Further information on these and other filesystems can be found in the ARCH Wiki.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
A filesystem manages the space on a storage medium (hard disk, SSD ...). It makes this memory available to the operating system so that files can be saved and read again. Each of the following filesystems has advantages and disadvantages. They are mostly developed for a special purpose and are therefore used in a certain environment.&lt;br /&gt;
&lt;br /&gt;
== Linux == &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
filesystems that are mostly used under Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Note that many filesystem drivers are already included in the Linux kernel. You may not need anything else to mount, read, or write these filesystems. But there are packages with additional tools. You may need them to format, check, repair, modify, or optimize such filesystems. So if you regularly use a filesystem, it is a good idea to install the appropriate tools.&lt;br /&gt;
&lt;br /&gt;
=== Ext2 → Ext3 → Ext4 === &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Ext4 is the default filesystem in Manjaro at the moment. It is the evolution of the most used Linux filesystems (Ext3, Ext2) and promises improved design, better performance, reliability, and features over its predecessors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
If you are using Ext2 or Ext3, you can convert the partition to Ext4. Ext4 uses journaling, checksums and write barriers and is therefore more robust against damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Currently Ext4 is fully supported in Win10 and OsX. Support for ext4 has been built in since WSL is included in Win10 (2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
see [https://ext4.wiki.kernel.org/ Ext4@kernel.org], [https://wiki.archlinux.org/title/Ext4 Ext4@ARCH-wiki], [https://de.wikipedia.org/wiki/Ext4 Ext4@wikipedia] &lt;br /&gt;
&amp;lt;br&amp;gt;For advanced optimizations see  [https://wiki.archlinux.org/index.php/Ext4#Improving_performance Improving Ext4 performance@Archwiki].&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
In Manjaro, e2fsprogs is already installed&lt;br /&gt;
&lt;br /&gt;
===[[Btrfs]]=== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite filesystem for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. [[Btrfs]] not only is a filesystem, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Because [[Btrfs]] is different, some things seem unfamiliar and strange. Then the page [[Btrfs]] is a good starting point to search for answers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Self-healing&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruptions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
see [[Btrfs]], [https://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs@kernel.org], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARCH-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia]&lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|Maintenance|When using snapshots, you must be particularly careful not to use up all the space on the file system -&amp;gt; [[Btrfs#Out_of_space]]}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd0&amp;gt;{{UserCmd|command=pamac install btrfs-progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReiserFS → reiser4 === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
ReiserFS was the first journaling filesystem to be included in the standard kernel. It was actively used by some distros some time ago, but is not currently widely used. Reiser4 is the successor to ReiserFS(3). However, Reiser4 seems not to be integrated in the kernel yet. &lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|As of kernel 6.13|reiserFS will no longer be supported.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/Reiser4 Reiser4@ARCH-wiki], [https://en.wikipedia.org/wiki/ReiserFS ReiserFS@wikipedia], [https://en.wikipedia.org/wiki/Reiser4 Reiser4@wikipedia], [https://reiser4.wiki.kernel.org/ Reiser4@kernel.org]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd2&amp;gt;{{UserCmd|command=pamac install reiserfsprogs reiser4progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Windows == &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
filesystems mostly used in windows&lt;br /&gt;
&lt;br /&gt;
=== NTFS === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
It is the most widely used filesystem on windows these days. It does exist in different versions, but unlike FAT32, all of them offer the following points:&lt;br /&gt;
* Large files&amp;gt; 4GB&lt;br /&gt;
* Long file names with UTF16 up to 255 characters&lt;br /&gt;
* Rights management, ACL&lt;br /&gt;
* Journaling of metadata&lt;br /&gt;
* Compression, encryption, ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Currently there are some restrictions when using NTFS with Linux. If windows is suddenly switched off or goes into hibernating, the NTFS filesystem is left in a &amp;quot;dirty-state&amp;quot;. When Windows starts again, NTFS is the first to be cleaned. This operation is currently not supported by the Linux driver. Then Linux shows the NTFS filesystem as read-only to be on the safe side. The same thing may happen, when NTFS becomes damaged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/NTFS NTFS@ARCH-wiki], [https://en.wikipedia.org/wiki/NTFS NTFS@wikipedia]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
{{BoxWarning|If you regularly switch between Windows and Linux|You should switch off &amp;quot;hibernation&amp;quot;, &amp;quot;Hybrid Boot&amp;quot;, &amp;quot;Fast Boot&amp;quot; in Windows. Then Linux has always full (read / write) access to NTFS drives.&lt;br /&gt;
* [https://forum.manjaro.org/t/all-of-my-files-are-in-read-only-mode/83777/7 all-of-my-files-are-in-read-only-mode@forum]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{BoxDanger|If your NTFS file system becomes corrupted|It is strongly recommended that you only repair the file system using the original Windows tools. Anything else is highly risky.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd3&amp;gt;{{UserCmd|command=pamac install ntfs-3g}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DOS == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
filesystems under DOS and early windows on a lot of floppydisks and USB-sticks&lt;br /&gt;
&lt;br /&gt;
=== FAT16 → FAT32 (+VFAT) === &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
This is a traditional filesystem under DOS and early Windows versions. Even today it can be found on many floppy disks, USB sticks and hard drives. It is supported by all types of operating systems and is therefore often used to exchange files, to pass them on, or to keep them accessible to both operating systems in the case of dualboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
Even with FAT32, this comes not without its disadvantages.&lt;br /&gt;
* no support for user rights or xattr&lt;br /&gt;
* severely restricted file names (8.3 or LFN for VFAT, no distinction between lowercase and uppercase)&lt;br /&gt;
* no files over 2GB (FAT16) 4GB (FAT32)&lt;br /&gt;
* no journaling&lt;br /&gt;
* not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
{{warning | FAT Filesystems do not use journaling. Data on such filesystems is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/FAT FAT@ARCH-wiki], [https://en.wikipedia.org/wiki/File_Allocation_Table FAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd4&amp;gt;{{UserCmd|command=pamac install dosfstools}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== exFAT === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Microsoft developed the exFAT (Extended File Allocation Table) in 2006 and optimized it for flash memories such as USB sticks and SD cards. It can store large files and large numbers of files, and it can manage very large partitions. It is supported by Linux, Windows, macOS and many other devices and is one of the most compatible filesystems. ExFAT is included in Linux 5.4 and higher.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
* Flash friendly&lt;br /&gt;
* No support for user rights or xattr&lt;br /&gt;
* Files over 4 GB&lt;br /&gt;
* Checksums for metadata&lt;br /&gt;
* No journal&lt;br /&gt;
* Not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning | exFAT FS does not use journaling. Data on such a filesystem is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/ExFAT ExFAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd5&amp;gt;{{UserCmd|command=pamac install exfatprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== macOS == &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
Filesystems mostly used in macOS&lt;br /&gt;
&lt;br /&gt;
=== HFS → HFS+ === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/HFS_Plus HFSPlus@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install from AUR==== &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd6&amp;gt;{{UserCmd|command=pamac install hfsprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Others == &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XFS === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/XFS XFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
===ZFS=== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/ZFS ZFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
==Comparisions== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt; Possible usage of Filesystems&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Filesystem!!Manjaro!!Win10!!OSX!!Win9x, DOS&lt;br /&gt;
|-&lt;br /&gt;
|ext2||●||▷ ExtFS||●||&lt;br /&gt;
|-&lt;br /&gt;
|ext3/4||●||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|btrfs||● btrfs-progs||▷ ExtFS, WinBtrfs||-||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser3||● reiser4progs||▷ RFSTool||?||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser4||○ reiserfs||?||?||-&lt;br /&gt;
|-&lt;br /&gt;
|NTFS||○ ntfs-3g&amp;lt;br&amp;gt;▶ 5.15?? ntfs3||●||?||&lt;br /&gt;
|-&lt;br /&gt;
|FAT32||● dosfstools||●||●||●&lt;br /&gt;
|-&lt;br /&gt;
|exFAT||▶ 5.4 exfatprogs||●||?||?&lt;br /&gt;
|-&lt;br /&gt;
|HFS||○ hfsprogs (AUR)||?||●||&lt;br /&gt;
|-&lt;br /&gt;
|XFS||?||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|ZFS||?||?||?||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
● = fully supported, additional tools to install&lt;br /&gt;
 ▶ = included since kernel x.x.x &lt;br /&gt;
 ○ = partially supported&lt;br /&gt;
 ▷ = possible via external tools&lt;br /&gt;
 ? = feel free to extend ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Some important properties&lt;br /&gt;
|-&lt;br /&gt;
! Properties !!ext2!!ext3!!ext4!!btrfs||reiserfs(3)||XFS&lt;br /&gt;
|-&lt;br /&gt;
|journaling ||-||● ordered||● ordered||● full||▶ 2.6||●&lt;br /&gt;
|-&lt;br /&gt;
|barriers ||-||||●||●&lt;br /&gt;
|-&lt;br /&gt;
|checksum ||-||-||◎ metadata||● full||●&lt;br /&gt;
|-&lt;br /&gt;
|kompression||-||-||-||●,&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;zstd ▶ 4.14/5.1&amp;lt;/small&amp;gt;||&lt;br /&gt;
|-&lt;br /&gt;
|encryption||-||-||▶ 4.13||-&lt;br /&gt;
|-&lt;br /&gt;
|snapshots||-||-||-||●||-&lt;br /&gt;
|-&lt;br /&gt;
|TRIM possible||-||-||▶ 2.6.33||▶ 4.3&lt;br /&gt;
|-&lt;br /&gt;
|xattr, ACL||◎||?||ACL||ACL||ACL&lt;br /&gt;
|-&lt;br /&gt;
|small repair||● fsck||● fsck||● fsck||● auto||reiserfsck&lt;br /&gt;
|-&lt;br /&gt;
|journal repair||● fsck||● fsck||● fsck||● auto 3.2||&lt;br /&gt;
|-&lt;br /&gt;
|repair after power loss||-||?||● tune2fs, fsck||● auto, scrub||&lt;br /&gt;
|-&lt;br /&gt;
|since||1993||2001||2008||2009||2001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=See also= &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/ExFAT Wikipedia:exFAT]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/Comparison_of_file_systems Wikipedia:Comparison of filesystems]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://wiki.archlinux.org/index.php/Filesystems Archwiki:filesystems]&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:filesystems{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=53904</id>
		<title>File Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=53904"/>
		<updated>2024-12-30T14:26:53Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: kernel 6.14&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This page provides information on some of the filesystems commonly used in Manjaro. It also shows where and how they are used. Further information on these and other filesystems can be found in the ARCH Wiki.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
A filesystem manages the space on a storage medium (hard disk, SSD ...). It makes this memory available to the operating system so that files can be saved and read again. Each of the following filesystems has advantages and disadvantages. They are mostly developed for a special purpose and are therefore used in a certain environment.&lt;br /&gt;
&lt;br /&gt;
== Linux == &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
filesystems that are mostly used under Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Note that many filesystem drivers are already included in the Linux kernel. You may not need anything else to mount, read, or write these filesystems. But there are packages with additional tools. You may need them to format, check, repair, modify, or optimize such filesystems. So if you regularly use a filesystem, it is a good idea to install the appropriate tools.&lt;br /&gt;
&lt;br /&gt;
=== Ext2 → Ext3 → Ext4 === &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Ext4 is the default filesystem in Manjaro at the moment. It is the evolution of the most used Linux filesystems (Ext3, Ext2) and promises improved design, better performance, reliability, and features over its predecessors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
If you are using Ext2 or Ext3, you can convert the partition to Ext4. Ext4 uses journaling, checksums and write barriers and is therefore more robust against damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Currently Ext4 is fully supported in Win10 and OsX. Support for ext4 has been built in since WSL is included in Win10 (2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
see [https://ext4.wiki.kernel.org/ Ext4@kernel.org], [https://wiki.archlinux.org/title/Ext4 Ext4@ARCH-wiki], [https://de.wikipedia.org/wiki/Ext4 Ext4@wikipedia] &lt;br /&gt;
&amp;lt;br&amp;gt;For advanced optimizations see  [https://wiki.archlinux.org/index.php/Ext4#Improving_performance Improving Ext4 performance@Archwiki].&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
In Manjaro, e2fsprogs is already installed&lt;br /&gt;
&lt;br /&gt;
===[[Btrfs]]=== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite filesystem for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. [[Btrfs]] not only is a filesystem, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Because [[Btrfs]] is different, some things seem unfamiliar and strange. Then [[Btrfs]] is a good starting point to search for answers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Self-healing&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruptions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
see [[Btrfs]], [https://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs@kernel.org], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARCH-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd0&amp;gt;{{UserCmd|command=pamac install btrfs-progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReiserFS → reiser4 === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
ReiserFS was the first journaling filesystem to be included in the standard kernel. It was actively used by some distros some time ago, but is not currently widely used. Reiser4 is the successor to ReiserFS(3). However, Reiser4 seems not to be integrated in the kernel yet. &lt;br /&gt;
&lt;br /&gt;
{{BoxWarning|As of kernel 6.13|reiserFS will no longer be supported.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/Reiser4 Reiser4@ARCH-wiki], [https://en.wikipedia.org/wiki/ReiserFS ReiserFS@wikipedia], [https://en.wikipedia.org/wiki/Reiser4 Reiser4@wikipedia], [https://reiser4.wiki.kernel.org/ Reiser4@kernel.org]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd2&amp;gt;{{UserCmd|command=pamac install reiserfsprogs reiser4progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Windows == &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
filesystems mostly used in windows&lt;br /&gt;
&lt;br /&gt;
=== NTFS === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
It is the most widely used filesystem on windows these days. It does exist in different versions, but unlike FAT32, all of them offer the following points:&lt;br /&gt;
* Large files&amp;gt; 4GB&lt;br /&gt;
* Long file names with UTF16 up to 255 characters&lt;br /&gt;
* Rights management, ACL&lt;br /&gt;
* Journaling of metadata&lt;br /&gt;
* Compression, encryption, ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Currently there are some restrictions when using NTFS with Linux. If windows is suddenly switched off or goes into hibernating, the NTFS filesystem is left in a &amp;quot;dirty-state&amp;quot;. When Windows starts again, NTFS is the first to be cleaned. This operation is currently not supported by the Linux driver. Then Linux shows the NTFS filesystem as read-only to be on the safe side. The same thing may happen, when NTFS becomes damaged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/NTFS NTFS@ARCH-wiki], [https://en.wikipedia.org/wiki/NTFS NTFS@wikipedia]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
{{BoxWarning|If you regularly switch between Windows and Linux|You should switch off &amp;quot;hibernation&amp;quot;, &amp;quot;Hybrid Boot&amp;quot;, &amp;quot;Fast Boot&amp;quot; in Windows. Then Linux has always full (read / write) access to NTFS drives.&lt;br /&gt;
* [https://forum.manjaro.org/t/all-of-my-files-are-in-read-only-mode/83777/7 all-of-my-files-are-in-read-only-mode@forum]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{BoxDanger|If your NTFS file system becomes corrupted|It is strongly recommended that you only repair the file system using the original Windows tools. Anything else is highly risky.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd3&amp;gt;{{UserCmd|command=pamac install ntfs-3g}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DOS == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
filesystems under DOS and early windows on a lot of floppydisks and USB-sticks&lt;br /&gt;
&lt;br /&gt;
=== FAT16 → FAT32 (+VFAT) === &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
This is a traditional filesystem under DOS and early Windows versions. Even today it can be found on many floppy disks, USB sticks and hard drives. It is supported by all types of operating systems and is therefore often used to exchange files, to pass them on, or to keep them accessible to both operating systems in the case of dualboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
Even with FAT32, this comes not without its disadvantages.&lt;br /&gt;
* no support for user rights or xattr&lt;br /&gt;
* severely restricted file names (8.3 or LFN for VFAT, no distinction between lowercase and uppercase)&lt;br /&gt;
* no files over 2GB (FAT16) 4GB (FAT32)&lt;br /&gt;
* no journaling&lt;br /&gt;
* not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
{{warning | FAT Filesystems do not use journaling. Data on such filesystems is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/FAT FAT@ARCH-wiki], [https://en.wikipedia.org/wiki/File_Allocation_Table FAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd4&amp;gt;{{UserCmd|command=pamac install dosfstools}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== exFAT === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Microsoft developed the exFAT (Extended File Allocation Table) in 2006 and optimized it for flash memories such as USB sticks and SD cards. It can store large files and large numbers of files, and it can manage very large partitions. It is supported by Linux, Windows, macOS and many other devices and is one of the most compatible filesystems. ExFAT is included in Linux 5.4 and higher.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
* Flash friendly&lt;br /&gt;
* No support for user rights or xattr&lt;br /&gt;
* Files over 4 GB&lt;br /&gt;
* Checksums for metadata&lt;br /&gt;
* No journal&lt;br /&gt;
* Not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning | exFAT FS does not use journaling. Data on such a filesystem is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/ExFAT ExFAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd5&amp;gt;{{UserCmd|command=pamac install exfatprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== macOS == &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
Filesystems mostly used in macOS&lt;br /&gt;
&lt;br /&gt;
=== HFS → HFS+ === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/HFS_Plus HFSPlus@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install from AUR==== &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd6&amp;gt;{{UserCmd|command=pamac install hfsprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Others == &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XFS === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/XFS XFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
===ZFS=== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/ZFS ZFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
==Comparisions== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt; Possible usage of Filesystems&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Filesystem!!Manjaro!!Win10!!OSX!!Win9x, DOS&lt;br /&gt;
|-&lt;br /&gt;
|ext2||●||▷ ExtFS||●||&lt;br /&gt;
|-&lt;br /&gt;
|ext3/4||●||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|btrfs||● btrfs-progs||▷ ExtFS, WinBtrfs||-||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser3||● reiser4progs||▷ RFSTool||?||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser4||○ reiserfs||?||?||-&lt;br /&gt;
|-&lt;br /&gt;
|NTFS||○ ntfs-3g&amp;lt;br&amp;gt;▶ 5.15?? ntfs3||●||?||&lt;br /&gt;
|-&lt;br /&gt;
|FAT32||● dosfstools||●||●||●&lt;br /&gt;
|-&lt;br /&gt;
|exFAT||▶ 5.4 exfatprogs||●||?||?&lt;br /&gt;
|-&lt;br /&gt;
|HFS||○ hfsprogs (AUR)||?||●||&lt;br /&gt;
|-&lt;br /&gt;
|XFS||?||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|ZFS||?||?||?||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
● = fully supported, additional tools to install&lt;br /&gt;
 ▶ = included since kernel x.x.x &lt;br /&gt;
 ○ = partially supported&lt;br /&gt;
 ▷ = possible via external tools&lt;br /&gt;
 ? = feel free to extend ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Some important properties&lt;br /&gt;
|-&lt;br /&gt;
! Properties !!ext2!!ext3!!ext4!!btrfs||reiserfs(3)||XFS&lt;br /&gt;
|-&lt;br /&gt;
|journaling ||-||● ordered||● ordered||● full||▶ 2.6||●&lt;br /&gt;
|-&lt;br /&gt;
|barriers ||-||||●||●&lt;br /&gt;
|-&lt;br /&gt;
|checksum ||-||-||◎ metadata||● full||●&lt;br /&gt;
|-&lt;br /&gt;
|kompression||-||-||-||●,&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;zstd ▶ 4.14/5.1&amp;lt;/small&amp;gt;||&lt;br /&gt;
|-&lt;br /&gt;
|encryption||-||-||▶ 4.13||-&lt;br /&gt;
|-&lt;br /&gt;
|snapshots||-||-||-||●||-&lt;br /&gt;
|-&lt;br /&gt;
|TRIM possible||-||-||▶ 2.6.33||▶ 4.3&lt;br /&gt;
|-&lt;br /&gt;
|xattr, ACL||◎||?||ACL||ACL||ACL&lt;br /&gt;
|-&lt;br /&gt;
|small repair||● fsck||● fsck||● fsck||● auto||reiserfsck&lt;br /&gt;
|-&lt;br /&gt;
|journal repair||● fsck||● fsck||● fsck||● auto 3.2||&lt;br /&gt;
|-&lt;br /&gt;
|repair after power loss||-||?||● tune2fs, fsck||● auto, scrub||&lt;br /&gt;
|-&lt;br /&gt;
|since||1993||2001||2008||2009||2001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=See also= &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/ExFAT Wikipedia:exFAT]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/Comparison_of_file_systems Wikipedia:Comparison of filesystems]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://wiki.archlinux.org/index.php/Filesystems Archwiki:filesystems]&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:filesystems{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=53902</id>
		<title>File Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=53902"/>
		<updated>2024-12-30T06:05:40Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: readonly if damaged&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This page provides information on some of the filesystems commonly used in Manjaro. It also shows where and how they are used. Further information on these and other filesystems can be found in the ARCH Wiki.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
A filesystem manages the space on a storage medium (hard disk, SSD ...). It makes this memory available to the operating system so that files can be saved and read again. Each of the following filesystems has advantages and disadvantages. They are mostly developed for a special purpose and are therefore used in a certain environment.&lt;br /&gt;
&lt;br /&gt;
== Linux == &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
filesystems that are mostly used under Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Note that many filesystem drivers are already included in the Linux kernel. You may not need anything else to mount, read, or write these filesystems. But there are packages with additional tools. You may need them to format, check, repair, modify, or optimize such filesystems. So if you regularly use a filesystem, it is a good idea to install the appropriate tools.&lt;br /&gt;
&lt;br /&gt;
=== Ext2 → Ext3 → Ext4 === &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Ext4 is the default filesystem in Manjaro at the moment. It is the evolution of the most used Linux filesystems (Ext3, Ext2) and promises improved design, better performance, reliability, and features over its predecessors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
If you are using Ext2 or Ext3, you can convert the partition to Ext4. Ext4 uses journaling, checksums and write barriers and is therefore more robust against damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Currently Ext4 is fully supported in Win10 and OsX. Support for ext4 has been built in since WSL is included in Win10 (2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
see [https://ext4.wiki.kernel.org/ Ext4@kernel.org], [https://wiki.archlinux.org/title/Ext4 Ext4@ARCH-wiki], [https://de.wikipedia.org/wiki/Ext4 Ext4@wikipedia] &lt;br /&gt;
&amp;lt;br&amp;gt;For advanced optimizations see  [https://wiki.archlinux.org/index.php/Ext4#Improving_performance Improving Ext4 performance@Archwiki].&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
In Manjaro, e2fsprogs is already installed&lt;br /&gt;
&lt;br /&gt;
===[[Btrfs]]=== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite filesystem for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. [[Btrfs]] not only is a filesystem, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Because [[Btrfs]] is different, some things seem unfamiliar and strange. Then [[Btrfs]] is a good starting point to search for answers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Self-healing&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruptions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
see [[Btrfs]], [https://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs@kernel.org], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARCH-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd0&amp;gt;{{UserCmd|command=pamac install btrfs-progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReiserFS → reiser4 === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
ReiserFS was the first journaling filesystem to be included in the standard kernel. It was actively used by some distros some time ago, but is not currently widely used. Reiser4 is the successor to ReiserFS(3). However, Reiser4 seems not to be integrated in the kernel yet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/Reiser4 Reiser4@ARCH-wiki], [https://en.wikipedia.org/wiki/ReiserFS ReiserFS@wikipedia], [https://en.wikipedia.org/wiki/Reiser4 Reiser4@wikipedia], [https://reiser4.wiki.kernel.org/ Reiser4@kernel.org]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd2&amp;gt;{{UserCmd|command=pamac install reiserfsprogs reiser4progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Windows == &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
filesystems mostly used in windows&lt;br /&gt;
&lt;br /&gt;
=== NTFS === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
It is the most widely used filesystem on windows these days. It does exist in different versions, but unlike FAT32, all of them offer the following points:&lt;br /&gt;
* Large files&amp;gt; 4GB&lt;br /&gt;
* Long file names with UTF16 up to 255 characters&lt;br /&gt;
* Rights management, ACL&lt;br /&gt;
* Journaling of metadata&lt;br /&gt;
* Compression, encryption, ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Currently there are some restrictions when using NTFS with Linux. If windows is suddenly switched off or goes into hibernating, the NTFS filesystem is left in a &amp;quot;dirty-state&amp;quot;. When Windows starts again, NTFS is the first to be cleaned. This operation is currently not supported by the Linux driver. Then Linux shows the NTFS filesystem as read-only to be on the safe side. The same thing may happen, when NTFS becomes damaged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/NTFS NTFS@ARCH-wiki], [https://en.wikipedia.org/wiki/NTFS NTFS@wikipedia]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
{{BoxWarning|If you regularly switch between Windows and Linux|You should switch off &amp;quot;hibernation&amp;quot;, &amp;quot;Hybrid Boot&amp;quot;, &amp;quot;Fast Boot&amp;quot; in Windows. Then Linux has always full (read / write) access to NTFS drives.&lt;br /&gt;
* [https://forum.manjaro.org/t/all-of-my-files-are-in-read-only-mode/83777/7 all-of-my-files-are-in-read-only-mode@forum]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{BoxDanger|If your NTFS file system becomes corrupted|It is strongly recommended that you only repair the file system using the original Windows tools. Anything else is highly risky.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd3&amp;gt;{{UserCmd|command=pamac install ntfs-3g}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DOS == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
filesystems under DOS and early windows on a lot of floppydisks and USB-sticks&lt;br /&gt;
&lt;br /&gt;
=== FAT16 → FAT32 (+VFAT) === &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
This is a traditional filesystem under DOS and early Windows versions. Even today it can be found on many floppy disks, USB sticks and hard drives. It is supported by all types of operating systems and is therefore often used to exchange files, to pass them on, or to keep them accessible to both operating systems in the case of dualboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
Even with FAT32, this comes not without its disadvantages.&lt;br /&gt;
* no support for user rights or xattr&lt;br /&gt;
* severely restricted file names (8.3 or LFN for VFAT, no distinction between lowercase and uppercase)&lt;br /&gt;
* no files over 2GB (FAT16) 4GB (FAT32)&lt;br /&gt;
* no journaling&lt;br /&gt;
* not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
{{warning | FAT Filesystems do not use journaling. Data on such filesystems is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/FAT FAT@ARCH-wiki], [https://en.wikipedia.org/wiki/File_Allocation_Table FAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd4&amp;gt;{{UserCmd|command=pamac install dosfstools}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== exFAT === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Microsoft developed the exFAT (Extended File Allocation Table) in 2006 and optimized it for flash memories such as USB sticks and SD cards. It can store large files and large numbers of files, and it can manage very large partitions. It is supported by Linux, Windows, macOS and many other devices and is one of the most compatible filesystems. ExFAT is included in Linux 5.4 and higher.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
* Flash friendly&lt;br /&gt;
* No support for user rights or xattr&lt;br /&gt;
* Files over 4 GB&lt;br /&gt;
* Checksums for metadata&lt;br /&gt;
* No journal&lt;br /&gt;
* Not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning | exFAT FS does not use journaling. Data on such a filesystem is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/ExFAT ExFAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd5&amp;gt;{{UserCmd|command=pamac install exfatprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== macOS == &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
Filesystems mostly used in macOS&lt;br /&gt;
&lt;br /&gt;
=== HFS → HFS+ === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/HFS_Plus HFSPlus@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install from AUR==== &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd6&amp;gt;{{UserCmd|command=pamac install hfsprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Others == &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XFS === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/XFS XFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
===ZFS=== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/ZFS ZFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
==Comparisions== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt; Possible usage of Filesystems&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Filesystem!!Manjaro!!Win10!!OSX!!Win9x, DOS&lt;br /&gt;
|-&lt;br /&gt;
|ext2||●||▷ ExtFS||●||&lt;br /&gt;
|-&lt;br /&gt;
|ext3/4||●||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|btrfs||● btrfs-progs||▷ ExtFS, WinBtrfs||-||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser3||● reiser4progs||▷ RFSTool||?||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser4||○ reiserfs||?||?||-&lt;br /&gt;
|-&lt;br /&gt;
|NTFS||○ ntfs-3g&amp;lt;br&amp;gt;▶ 5.15?? ntfs3||●||?||&lt;br /&gt;
|-&lt;br /&gt;
|FAT32||● dosfstools||●||●||●&lt;br /&gt;
|-&lt;br /&gt;
|exFAT||▶ 5.4 exfatprogs||●||?||?&lt;br /&gt;
|-&lt;br /&gt;
|HFS||○ hfsprogs (AUR)||?||●||&lt;br /&gt;
|-&lt;br /&gt;
|XFS||?||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|ZFS||?||?||?||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
● = fully supported, additional tools to install&lt;br /&gt;
 ▶ = included since kernel x.x.x &lt;br /&gt;
 ○ = partially supported&lt;br /&gt;
 ▷ = possible via external tools&lt;br /&gt;
 ? = feel free to extend ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Some important properties&lt;br /&gt;
|-&lt;br /&gt;
! Properties !!ext2!!ext3!!ext4!!btrfs||reiserfs(3)||XFS&lt;br /&gt;
|-&lt;br /&gt;
|journaling ||-||● ordered||● ordered||● full||▶ 2.6||●&lt;br /&gt;
|-&lt;br /&gt;
|barriers ||-||||●||●&lt;br /&gt;
|-&lt;br /&gt;
|checksum ||-||-||◎ metadata||● full||●&lt;br /&gt;
|-&lt;br /&gt;
|kompression||-||-||-||●,&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;zstd ▶ 4.14/5.1&amp;lt;/small&amp;gt;||&lt;br /&gt;
|-&lt;br /&gt;
|encryption||-||-||▶ 4.13||-&lt;br /&gt;
|-&lt;br /&gt;
|snapshots||-||-||-||●||-&lt;br /&gt;
|-&lt;br /&gt;
|TRIM possible||-||-||▶ 2.6.33||▶ 4.3&lt;br /&gt;
|-&lt;br /&gt;
|xattr, ACL||◎||?||ACL||ACL||ACL&lt;br /&gt;
|-&lt;br /&gt;
|small repair||● fsck||● fsck||● fsck||● auto||reiserfsck&lt;br /&gt;
|-&lt;br /&gt;
|journal repair||● fsck||● fsck||● fsck||● auto 3.2||&lt;br /&gt;
|-&lt;br /&gt;
|repair after power loss||-||?||● tune2fs, fsck||● auto, scrub||&lt;br /&gt;
|-&lt;br /&gt;
|since||1993||2001||2008||2009||2001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=See also= &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/ExFAT Wikipedia:exFAT]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/Comparison_of_file_systems Wikipedia:Comparison of filesystems]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://wiki.archlinux.org/index.php/Filesystems Archwiki:filesystems]&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:filesystems{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=53901</id>
		<title>File Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=File_Systems&amp;diff=53901"/>
		<updated>2024-12-30T06:02:05Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Repair NTFS only in windows&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This page provides information on some of the filesystems commonly used in Manjaro. It also shows where and how they are used. Further information on these and other filesystems can be found in the ARCH Wiki.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
A filesystem manages the space on a storage medium (hard disk, SSD ...). It makes this memory available to the operating system so that files can be saved and read again. Each of the following filesystems has advantages and disadvantages. They are mostly developed for a special purpose and are therefore used in a certain environment.&lt;br /&gt;
&lt;br /&gt;
== Linux == &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
filesystems that are mostly used under Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Note that many filesystem drivers are already included in the Linux kernel. You may not need anything else to mount, read, or write these filesystems. But there are packages with additional tools. You may need them to format, check, repair, modify, or optimize such filesystems. So if you regularly use a filesystem, it is a good idea to install the appropriate tools.&lt;br /&gt;
&lt;br /&gt;
=== Ext2 → Ext3 → Ext4 === &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Ext4 is the default filesystem in Manjaro at the moment. It is the evolution of the most used Linux filesystems (Ext3, Ext2) and promises improved design, better performance, reliability, and features over its predecessors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
If you are using Ext2 or Ext3, you can convert the partition to Ext4. Ext4 uses journaling, checksums and write barriers and is therefore more robust against damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Currently Ext4 is fully supported in Win10 and OsX. Support for ext4 has been built in since WSL is included in Win10 (2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
see [https://ext4.wiki.kernel.org/ Ext4@kernel.org], [https://wiki.archlinux.org/title/Ext4 Ext4@ARCH-wiki], [https://de.wikipedia.org/wiki/Ext4 Ext4@wikipedia] &lt;br /&gt;
&amp;lt;br&amp;gt;For advanced optimizations see  [https://wiki.archlinux.org/index.php/Ext4#Improving_performance Improving Ext4 performance@Archwiki].&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
In Manjaro, e2fsprogs is already installed&lt;br /&gt;
&lt;br /&gt;
===[[Btrfs]]=== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite filesystem for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. [[Btrfs]] not only is a filesystem, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Because [[Btrfs]] is different, some things seem unfamiliar and strange. Then [[Btrfs]] is a good starting point to search for answers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make a full copy of files&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Self-healing&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruptions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
see [[Btrfs]], [https://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs@kernel.org], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARCH-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd0&amp;gt;{{UserCmd|command=pamac install btrfs-progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReiserFS → reiser4 === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
ReiserFS was the first journaling filesystem to be included in the standard kernel. It was actively used by some distros some time ago, but is not currently widely used. Reiser4 is the successor to ReiserFS(3). However, Reiser4 seems not to be integrated in the kernel yet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/Reiser4 Reiser4@ARCH-wiki], [https://en.wikipedia.org/wiki/ReiserFS ReiserFS@wikipedia], [https://en.wikipedia.org/wiki/Reiser4 Reiser4@wikipedia], [https://reiser4.wiki.kernel.org/ Reiser4@kernel.org]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd2&amp;gt;{{UserCmd|command=pamac install reiserfsprogs reiser4progs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Windows == &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
filesystems mostly used in windows&lt;br /&gt;
&lt;br /&gt;
=== NTFS === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
It is the most widely used filesystem on windows these days. It does exist in different versions, but unlike FAT32, all of them offer the following points:&lt;br /&gt;
* Large files&amp;gt; 4GB&lt;br /&gt;
* Long file names with UTF16 up to 255 characters&lt;br /&gt;
* Rights management, ACL&lt;br /&gt;
* Journaling of metadata&lt;br /&gt;
* Compression, encryption, ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Currently there are some restrictions when using NTFS with Linux. If windows is suddenly switched off or goes into hibernating, the NTFS filesystem is left in a &amp;quot;dirty-state&amp;quot;. When Windows starts again, NTFS is the first to be cleaned. This operation is currently not supported by the Linux driver. Then Linux shows the NTFS filesystem as read-only to be on the safe side.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/NTFS NTFS@ARCH-wiki], [https://en.wikipedia.org/wiki/NTFS NTFS@wikipedia]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
{{BoxWarning|If you regularly switch between Windows and Linux|You should switch off &amp;quot;hibernation&amp;quot;, &amp;quot;Hybrid Boot&amp;quot;, &amp;quot;Fast Boot&amp;quot; in Windows. Then Linux has always full (read / write) access to NTFS drives.&lt;br /&gt;
* [https://forum.manjaro.org/t/all-of-my-files-are-in-read-only-mode/83777/7 all-of-my-files-are-in-read-only-mode@forum]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{BoxDanger|If your NTFS file system becomes corrupted|It is strongly recommended that you only repair the file system using the original Windows tools. Anything else is highly risky.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd3&amp;gt;{{UserCmd|command=pamac install ntfs-3g}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DOS == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
filesystems under DOS and early windows on a lot of floppydisks and USB-sticks&lt;br /&gt;
&lt;br /&gt;
=== FAT16 → FAT32 (+VFAT) === &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
This is a traditional filesystem under DOS and early Windows versions. Even today it can be found on many floppy disks, USB sticks and hard drives. It is supported by all types of operating systems and is therefore often used to exchange files, to pass them on, or to keep them accessible to both operating systems in the case of dualboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
Even with FAT32, this comes not without its disadvantages.&lt;br /&gt;
* no support for user rights or xattr&lt;br /&gt;
* severely restricted file names (8.3 or LFN for VFAT, no distinction between lowercase and uppercase)&lt;br /&gt;
* no files over 2GB (FAT16) 4GB (FAT32)&lt;br /&gt;
* no journaling&lt;br /&gt;
* not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
{{warning | FAT Filesystems do not use journaling. Data on such filesystems is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/FAT FAT@ARCH-wiki], [https://en.wikipedia.org/wiki/File_Allocation_Table FAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd4&amp;gt;{{UserCmd|command=pamac install dosfstools}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== exFAT === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Microsoft developed the exFAT (Extended File Allocation Table) in 2006 and optimized it for flash memories such as USB sticks and SD cards. It can store large files and large numbers of files, and it can manage very large partitions. It is supported by Linux, Windows, macOS and many other devices and is one of the most compatible filesystems. ExFAT is included in Linux 5.4 and higher.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
* Flash friendly&lt;br /&gt;
* No support for user rights or xattr&lt;br /&gt;
* Files over 4 GB&lt;br /&gt;
* Checksums for metadata&lt;br /&gt;
* No journal&lt;br /&gt;
* Not robust&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
{{warning | exFAT FS does not use journaling. Data on such a filesystem is vulnerable to irreparable corruption due to &amp;#039;&amp;#039;improper ejection or power outage&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/ExFAT ExFAT@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install==== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd5&amp;gt;{{UserCmd|command=pamac install exfatprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== macOS == &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
Filesystems mostly used in macOS&lt;br /&gt;
&lt;br /&gt;
=== HFS → HFS+ === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
see [https://en.wikipedia.org/wiki/HFS_Plus HFSPlus@wikipedia]&lt;br /&gt;
&lt;br /&gt;
====Install from AUR==== &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;tvar|usercmd6&amp;gt;{{UserCmd|command=pamac install hfsprogs}}&amp;lt;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Others == &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XFS === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/XFS XFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
===ZFS=== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
see [https://wiki.archlinux.org/title/ZFS ZFS@ARCH-wiki]&lt;br /&gt;
&lt;br /&gt;
==Comparisions== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt; Possible usage of Filesystems&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Filesystem!!Manjaro!!Win10!!OSX!!Win9x, DOS&lt;br /&gt;
|-&lt;br /&gt;
|ext2||●||▷ ExtFS||●||&lt;br /&gt;
|-&lt;br /&gt;
|ext3/4||●||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|btrfs||● btrfs-progs||▷ ExtFS, WinBtrfs||-||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser3||● reiser4progs||▷ RFSTool||?||-&lt;br /&gt;
|-&lt;br /&gt;
|reiser4||○ reiserfs||?||?||-&lt;br /&gt;
|-&lt;br /&gt;
|NTFS||○ ntfs-3g&amp;lt;br&amp;gt;▶ 5.15?? ntfs3||●||?||&lt;br /&gt;
|-&lt;br /&gt;
|FAT32||● dosfstools||●||●||●&lt;br /&gt;
|-&lt;br /&gt;
|exFAT||▶ 5.4 exfatprogs||●||?||?&lt;br /&gt;
|-&lt;br /&gt;
|HFS||○ hfsprogs (AUR)||?||●||&lt;br /&gt;
|-&lt;br /&gt;
|XFS||?||▷ ExtFS||?||&lt;br /&gt;
|-&lt;br /&gt;
|ZFS||?||?||?||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
● = fully supported, additional tools to install&lt;br /&gt;
 ▶ = included since kernel x.x.x &lt;br /&gt;
 ○ = partially supported&lt;br /&gt;
 ▷ = possible via external tools&lt;br /&gt;
 ? = feel free to extend ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Some important properties&lt;br /&gt;
|-&lt;br /&gt;
! Properties !!ext2!!ext3!!ext4!!btrfs||reiserfs(3)||XFS&lt;br /&gt;
|-&lt;br /&gt;
|journaling ||-||● ordered||● ordered||● full||▶ 2.6||●&lt;br /&gt;
|-&lt;br /&gt;
|barriers ||-||||●||●&lt;br /&gt;
|-&lt;br /&gt;
|checksum ||-||-||◎ metadata||● full||●&lt;br /&gt;
|-&lt;br /&gt;
|kompression||-||-||-||●,&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;zstd ▶ 4.14/5.1&amp;lt;/small&amp;gt;||&lt;br /&gt;
|-&lt;br /&gt;
|encryption||-||-||▶ 4.13||-&lt;br /&gt;
|-&lt;br /&gt;
|snapshots||-||-||-||●||-&lt;br /&gt;
|-&lt;br /&gt;
|TRIM possible||-||-||▶ 2.6.33||▶ 4.3&lt;br /&gt;
|-&lt;br /&gt;
|xattr, ACL||◎||?||ACL||ACL||ACL&lt;br /&gt;
|-&lt;br /&gt;
|small repair||● fsck||● fsck||● fsck||● auto||reiserfsck&lt;br /&gt;
|-&lt;br /&gt;
|journal repair||● fsck||● fsck||● fsck||● auto 3.2||&lt;br /&gt;
|-&lt;br /&gt;
|repair after power loss||-||?||● tune2fs, fsck||● auto, scrub||&lt;br /&gt;
|-&lt;br /&gt;
|since||1993||2001||2008||2009||2001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=See also= &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/ExFAT Wikipedia:exFAT]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://en.wikipedia.org/wiki/Comparison_of_file_systems Wikipedia:Comparison of filesystems]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://wiki.archlinux.org/index.php/Filesystems Archwiki:filesystems]&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:filesystems{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53823</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53823"/>
		<updated>2024-12-06T16:52:12Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Vorschlag compress volume&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make the full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use one volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume (or backups with send/receive) to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, or to restore one of the backups of this subvolume &amp;#039;&amp;#039;&amp;#039;without loosing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-5.10-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-5.10-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/5.10.59-1-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53822</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53822"/>
		<updated>2024-12-06T16:48:53Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Tabelle mit vorschlägen eingefügt&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make the full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use one volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume (or backups with send/receive) to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, or to restore one of the backups of this subvolume &amp;#039;&amp;#039;&amp;#039;without loosing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-5.10-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-5.10-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/5.10.59-1-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You can turn on compression at any time by changing the mount options in the fstab. After the next reboot, all newly written data from then on will be automatically compressed. Compression factors of 2:1 on average are not uncommon.&lt;br /&gt;
[[Btrfs#Mount_options|@see mount-options]]&lt;br /&gt;
 UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Which compression suits me best?&lt;br /&gt;
|-&lt;br /&gt;
! CPU !! rotating disk !! SSD&lt;br /&gt;
|-&lt;br /&gt;
| slow ||  zstd:1 ... 4 || zstd:1 ... 3 &lt;br /&gt;
|-&lt;br /&gt;
| medium ||  zstd:4 ... 7 || zstd:3 ... 5&lt;br /&gt;
|-&lt;br /&gt;
| fast ||  zstd:7 ... 10 || zstd:5 ... 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53821</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53821"/>
		<updated>2024-12-06T16:09:16Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: Vorschlag kompression einschalten&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make the full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use one volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume (or backups with send/receive) to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, or to restore one of the backups of this subvolume &amp;#039;&amp;#039;&amp;#039;without loosing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-5.10-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-5.10-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/5.10.59-1-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume &lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53820</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=53820"/>
		<updated>2024-12-06T16:01:23Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: 80% -&amp;gt; 90 %&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make the full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use one volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume (or backups with send/receive) to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, or to restore one of the backups of this subvolume &amp;#039;&amp;#039;&amp;#039;without loosing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-5.10-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-5.10-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/5.10.59-1-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then &amp;#039;&amp;#039;&amp;#039;90%&amp;#039;&amp;#039;&amp;#039; or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=52577</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=52577"/>
		<updated>2024-08-04T11:48:16Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: remove musage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make the full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use one volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume (or backups with send/receive) to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, or to restore one of the backups of this subvolume &amp;#039;&amp;#039;&amp;#039;without loosing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-5.10-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-5.10-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/5.10.59-1-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then 80% or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=52576</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=52576"/>
		<updated>2024-08-04T11:46:42Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: musage removed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make the full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use one volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume (or backups with send/receive) to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, or to restore one of the backups of this subvolume &amp;#039;&amp;#039;&amp;#039;without loosing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-5.10-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-5.10-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/5.10.59-1-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then 80% or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=50 -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=95 -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options === &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=52357</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=52357"/>
		<updated>2024-05-30T09:08:24Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: /* Mount options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make the full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use one volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume (or backups with send/receive) to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, or to restore one of the backups of this subvolume &amp;#039;&amp;#039;&amp;#039;without loosing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-5.10-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-5.10-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/5.10.59-1-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then 80% or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=50 -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=90 -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=50 -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=95 -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options ===&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=52356</id>
		<title>Btrfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Btrfs&amp;diff=52356"/>
		<updated>2024-05-30T09:04:01Z</updated>

		<summary type="html">&lt;p&gt;Andreas85: /* Mount options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=Btrfs is a modern CoW [[File_Systems|file system]]= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
A modern &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;opy &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;n &amp;#039;&amp;#039;&amp;#039;W&amp;#039;&amp;#039;&amp;#039;rite file system for Linux aimed at implementing advanced features while also focusing on &amp;#039;&amp;#039;&amp;#039;fault tolerance&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;repair&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;easy administration&amp;#039;&amp;#039;&amp;#039;. Btrfs not only is a file system, but also is partly a volume manager, software-raid, backup-tool, and it is flash-friendly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Because Btrfs is different, some things seem unfamiliar and strange. If you want to learn the details and the newest stuff, then [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs.wiki.kernel.org] is the place to go or [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io].&lt;br /&gt;
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development. The Btrfs code base and filesystem-layout is &amp;#039;&amp;#039;&amp;#039;[https://btrfs.wiki.kernel.org/index.php/Status stable] .&amp;#039;&amp;#039;&amp;#039; However, new features are still under development. Its main features and benefits are:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Snapshots&amp;#039;&amp;#039;&amp;#039; which do not make the full copy of files&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Volume Manager&amp;#039;&amp;#039;&amp;#039; join partitions, split into subvolumes&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RAID&amp;#039;&amp;#039;&amp;#039; - support for software-based RAID 0, RAID 1, RAID 10&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Auto-repair&amp;#039;&amp;#039;&amp;#039; - checksums for data and metadata, automatic detection of silent data corruption&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
(see [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs@kernel.org],&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/ btrfs.readthedocs.io], [https://wiki.archlinux.org/title/Btrfs Btrfs@ARC-wiki], [https://de.wikipedia.org/wiki/Btrfs Btrfs@wikipedia])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;!-- TOC shows contents of the page --&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Familiar with btrfs-slang ? === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Because Btrfs is different, you will find some words that do have a special meaning when used for btrfs. This may be a source of confusion. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is a pool of raw storage and consists of one or more &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;s. The size of the volume will be the addition of all devices that are part of this volume. In most cases you will only use one volume. You are able to add/remove devices at any time. &amp;#039;&amp;#039;Usually you do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; mount a Btrfs volume.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;chunk&amp;#039;&amp;#039;&amp;#039; is simply a piece of storage that Btrfs can use to put data on. Think of a chunk (usually 1GiB) as of a page in a book. The book is the &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039;, and the chunk is one page of it. When you start, all pages are empty. When you write data to the volume, one page (=&amp;quot;chunk&amp;quot;) after the other is written to. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;device&amp;#039;&amp;#039;&amp;#039; is some linux device. It may be &amp;#039;&amp;#039;&amp;#039;a partition&amp;#039;&amp;#039;&amp;#039; like &amp;#039;&amp;#039;&amp;#039;/dev/sdz1&amp;#039;&amp;#039;&amp;#039; or /dev/sdz2. Or it may be a raw disk device like /dev/sdz without any partitioning. A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;at least one device&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;subvolume&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; is an independently mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. By convention the names of subvolumes start with @ (&amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039; ...). All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes &amp;#039;&amp;#039;as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;default subvolume&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;The default subvolume of a Btrfs &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; is special. When you mount, you normally have to name a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolume]]&amp;#039;&amp;#039;&amp;#039; to mount. When you don&amp;#039;t name a subvolume, the default subvolume will be used. The default subvolume can be changed to any subvolume. It is advisable to set that subvolume as default, that is used for mounting linux &amp;#039;&amp;#039;&amp;#039;&amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039; this is often the subvolume with the name &amp;#039;&amp;#039;&amp;#039;&amp;quot;@&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root&amp;#039;&amp;#039;&amp;#039; &amp;quot;/&amp;quot;, Btrfs &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Btrfs_Volume|volume]]&amp;#039;&amp;#039;&amp;#039; contains one ore more &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But they are not stored in form of a simple list. These subvolumes are stored in a tree-like structure like in a filesystem.  Sometimes called the &amp;quot;top-level subvolume&amp;quot; or &amp;quot;root of the volume&amp;quot;. But be careful this is &amp;#039;&amp;#039;&amp;#039;not linux-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;, but Btrfs &amp;#039;&amp;#039;&amp;#039;volume-root &amp;quot;/&amp;quot;&amp;#039;&amp;#039;&amp;#039;. There are several basic schemas to &amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; subvolumes in a volume&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;snapshot&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#snapshot|snapshot]]&amp;#039;&amp;#039;&amp;#039; looks nearly the same as a &amp;#039;&amp;#039;&amp;#039;[[Btrfs#subvolume|subvolumes]]&amp;#039;&amp;#039;&amp;#039;. But don´t get confused. When we talk about snapshots we usually mean a &amp;quot;&amp;#039;&amp;#039;&amp;#039;Read-Only (ro) photograph&amp;#039;&amp;#039;&amp;#039; of a subvolume&amp;quot;. While the subvolume changes with time. A snapshot stays in the state of the subvolume at the time we made it. You can mount snapshots into your linux system, but you only can read the content. And the content will never change while this snapshot exists. When creating &amp;#039;&amp;#039;&amp;#039;snapshots&amp;#039;&amp;#039;&amp;#039; you have to watch out for the Btrfs-&amp;#039;&amp;#039;&amp;#039;layout&amp;#039;&amp;#039;&amp;#039; in use.&lt;br /&gt;
It is possible to make a writeable(rw) subvolume out of a ro-snapshot. This is the way &amp;#039;&amp;#039;&amp;#039;[[Btrfs#Rollback_to_a_snapshot|roll back]]&amp;#039;&amp;#039;&amp;#039; does work.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ Self-healing&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;This is no magic.&amp;#039;&amp;#039;&amp;#039; Because of the nature of Btrfs as &amp;#039;&amp;#039;&amp;#039;[[Btrfs#What.27s_this_.22Copy_on_Write.22|CopyOnWrite]]&amp;#039;&amp;#039;&amp;#039; filesystem and because of the checksums, it is possible to check the filesystem and repair some errors. This does happen silently. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* [[Btrfs#RAID_0_.28not_Just_a_Bunch_of_Disks.29|Without RAID]] it is possible to correct some small faults that happen because of power outage. (This is done when the filesystem is mounted again)&lt;br /&gt;
* [[Btrfs#RAID_1_.28mirrored.29.2C_1C3.2C_1C4|With RAID1]] it is possible to repair some parts of files that where damaged by faults on one device. (This is done when the file is read the next time)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;scrub&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#scrub|scrub]]&amp;#039;&amp;#039;&amp;#039; is like an inspection of your car. The mechanic will look at all parts, and will tell you if something is amiss. If he finds very small problems, he will repair this automatically without asking for permission, and with minimal extra cost. &lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-toggle&amp;quot; style=&amp;quot;float:none;&amp;quot;&amp;gt;▶ &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;A &amp;#039;&amp;#039;&amp;#039;[[Btrfs#balance|balance]]&amp;#039;&amp;#039;&amp;#039; is like renovating your home. Sometimes it is necessary to renovate a room, sometimes you will renovate your home completely. But you don&amp;#039;t do it once in every week ;-) With balance, the furniture will be transported around and rearranged. &amp;#039;&amp;#039;&amp;#039;You need to do this when changing RAID-levels.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
You may also have a look at [https://btrfs.readthedocs.io/en/latest/Glossary.html Btrfs Glossary]&lt;br /&gt;
&lt;br /&gt;
= Volume management [https://btrfs.readthedocs.io/en/latest/Volume-management.html ⇒] = &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A volume is a pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time to increase/decrease the size of the volume. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UUID).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume-root itself. Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When not otherwise specified, additional devices are handled as &amp;#039;&amp;#039;&amp;#039;J&amp;#039;&amp;#039;&amp;#039;ust a &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;unch &amp;#039;&amp;#039;&amp;#039;o&amp;#039;&amp;#039;&amp;#039;f &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;isks (JBOD)&lt;br /&gt;
{{BoxInfo|Tip|In most cases it is advisable to use &amp;#039;&amp;#039;&amp;#039;only one volume&amp;#039;&amp;#039;&amp;#039;}} &lt;br /&gt;
&lt;br /&gt;
=== Extend a volume === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
This is very easy because btrfs incorporates a volume manager. You only have to look for a free device. You may use a partition like &amp;#039;&amp;#039;/dev/sdz4&amp;#039;&amp;#039; or you may use a raw device like &amp;#039;&amp;#039;/dev/sdz&amp;#039;&amp;#039;. Then add this device to your existing volume with &amp;#039;&amp;#039;&amp;#039;btrfs device add&amp;#039;&amp;#039;&amp;#039;. You may need to do a &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; afterwards to redistribute some chunks.&lt;br /&gt;
{{RootCmd|command=btrfs device add [/dev/sdz4] /}}&lt;br /&gt;
{{BoxWarning|Dont´t format the partition!|To add a device it should have &amp;#039;&amp;#039;&amp;#039;NO filesystem&amp;#039;&amp;#039;&amp;#039; on it. The btrfs volume manager will include the  free storage of the device &amp;#039;&amp;#039;&amp;#039;into the existing filesystem&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Move a volume (to another disk) === &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
There are a lot of ways you can move a &amp;quot;normal&amp;quot; filesystem from one disk to another. But there are dangers with moving btrfs volumes that do not exist with other filesystems! &amp;#039;&amp;#039;&amp;#039;Don´t ever move a btrfs volume with a tool that does not say it is 100% btrfs-proof.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
When at any time there are 2 partitions in one computer that have the same filesystem UUID, one ore both filesystems &amp;#039;&amp;#039;&amp;#039;may be destroyed&amp;#039;&amp;#039;&amp;#039;. Under the topic &amp;#039;&amp;#039;&amp;#039;tips&amp;#039;&amp;#039;&amp;#039; you will find an easy way to do move a volume without any danger&lt;br /&gt;
{{BoxDanger|Do NOT|&lt;br /&gt;
* make a block-level copy of a Btrfs filesystem to another block device&lt;br /&gt;
* use LVM snapshots, or any other kind of block level snapshots&lt;br /&gt;
* turn a copy of a filesystem that is stored in a file into a block device with the loopback driver&lt;br /&gt;
* try to mount either the original or the copy while both are visible to the same kernel&lt;br /&gt;
See why at [https://btrfs.wiki.kernel.org/index.php/Gotchas Block-level copies of devices@btrfs.wiki.kernel.org]}}&lt;br /&gt;
{{BoxSuccess|Tip: move a volume|There is an easy and secure way to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this while the volume is in use. [[Btrfs#move_a_volume|See how to in &amp;quot;tips&amp;quot;]]}}&lt;br /&gt;
&lt;br /&gt;
== Subvolume [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] == &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A subvolume is an independent mountable POSIX file-tree and &amp;#039;&amp;#039;&amp;#039;not a block device&amp;#039;&amp;#039;&amp;#039;. It is the part of a volume that will be &amp;#039;&amp;#039;&amp;#039;mounted writeable&amp;#039;&amp;#039;&amp;#039; into your Linux system. If you dont´t care about snapshots, and you don´t care about backups, it would be possible to use only one subvolume for everything. But then you would not be able to use the powers of Btrfs. &amp;#039;&amp;#039;Lets assume you do care.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
All subvolumes share the space of the Btrfs volume. You may create subvolumes at will. (You may think of subvolumes as sort of &amp;quot;dynamic partitions&amp;quot; inside a Btrfs volume)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
When making snapshots (or send/receive) every subvolume will be handled separately. For example when you have 2 subvolumes(@, @home), and make a snapshot of one of them(@), this snapshot will contain every bit of data of all files in this subvolume(@), but none of the data from the other subvolume(@home). So if you make a few subvolumes, you are able to &amp;#039;&amp;#039;&amp;#039;follow different strategies for snapshots&amp;#039;&amp;#039;&amp;#039; of them. And you can &amp;#039;&amp;#039;&amp;#039;restore&amp;#039;&amp;#039;&amp;#039; each of them &amp;#039;&amp;#039;&amp;#039;separately&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
By convention the names of subvolumes start with &amp;#039;&amp;#039;&amp;#039;@ (@home, @snapshots&amp;#039;&amp;#039;&amp;#039; ...). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
This is the subvolume where your &amp;#039;&amp;#039;&amp;#039;complete manjaro system&amp;#039;&amp;#039;&amp;#039; will reside. It is mounted at &amp;quot;/&amp;quot; in your filesystem. You may take snapshots of this subvolume (or backups with send/receive) to secure a running manjaro system. When something bad happens, you are able to rollback to one of the snapshots, or to restore one of the backups of this subvolume &amp;#039;&amp;#039;&amp;#039;without loosing your data&amp;#039;&amp;#039;&amp;#039; at /home.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
In order to make a rollback possible, this has to contain all and every data that is needed for your manjaro to work properly! This includes:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039; of your bootloader (/boot/brub/grub.cfg)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;initramdisk&amp;#039;&amp;#039;&amp;#039; (/boot/initramfs-5.10-x86_64.img)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel&amp;#039;&amp;#039;&amp;#039; (/boot/vmlinuz-5.10-x86_64)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;kernel-modules&amp;#039;&amp;#039;&amp;#039; (/usr/lib/modules/5.10.59-1-MANJARO/*)&lt;br /&gt;
* programs (/usr/bin/*)&lt;br /&gt;
* configs (/etc/*)&lt;br /&gt;
* libraries (/usr/lib/*)&lt;br /&gt;
* your root account (/root/*)&lt;br /&gt;
* rest of system files (/usr/*)&lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This is the subvolume where all &amp;#039;&amp;#039;&amp;#039;user data&amp;#039;&amp;#039;&amp;#039; ist stored. When you rollback your &amp;quot;@&amp;quot;, this will not change at all. You may take snapshots of /home at a different rate and for different reasons. While snapshots of &amp;quot;@&amp;quot;  are good for rollback, snapshots of @home are good for &amp;#039;&amp;#039;&amp;#039;undeleting&amp;#039;&amp;#039;&amp;#039; accidentally by users deleted (or overwritten) files. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@snapshots&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;@home.snapshots&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
It is wise to &amp;quot;store&amp;quot; snapshots &amp;#039;&amp;#039;&amp;#039;NOT inside&amp;#039;&amp;#039;&amp;#039; the subvolume they where taken from. So this may be the right place to store your snapshots of &amp;#039;&amp;#039;&amp;#039;@&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;@home&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
=== Subvolume &amp;#039;&amp;#039;&amp;#039;@...&amp;#039;&amp;#039;&amp;#039; === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Sometimes it is desired to have other &amp;#039;&amp;#039;&amp;#039;special snapshot strategies&amp;#039;&amp;#039;&amp;#039; (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
To have access to the root(/) of your volume, you need to mount this separately. (Please do not confuse this with &amp;quot;/&amp;quot; of the file system) &lt;br /&gt;
{{RootCmd|command=mount -t btrfs -o subvol=/,defaults [/dev/sdz2] /mnt}} &lt;br /&gt;
Now you are able to create a new subvolume in a flat layout.&lt;br /&gt;
{{RootCmd|command=btrfs subvolume create [/mnt/@tests]}}&lt;br /&gt;
This will be shown by &lt;br /&gt;
{{RootCmd|command=ls -l /mnt}}&lt;br /&gt;
{{RootCmd|command=btrfs subvolume list /mnt}}&lt;br /&gt;
This subvolume &amp;#039;&amp;#039;&amp;#039;tests&amp;#039;&amp;#039;&amp;#039; is empty. And it is not mounted by default. So if you want to use it, you have to mount it by &amp;#039;&amp;#039;fstab&amp;#039;&amp;#039; or other means. &amp;#039;&amp;#039;&amp;#039;Now lets delete it again.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{RootCmd|command=btrfs subvolume delete [/mnt/@tests]}}&lt;br /&gt;
{{RootCmd|command=umount /mnt}}&lt;br /&gt;
&lt;br /&gt;
== Snapshot == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
A snapshot looks nearly the same as a subvolume. But snapshots really are &amp;quot;read-only photographs of a subvolume&amp;quot;. While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.&lt;br /&gt;
A snapshot is &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use. [https://github.com/jrabinow/snapper-rollback see@wiki.archlinux]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Snapshots (if regularly made) may be used for:&lt;br /&gt;
* Comparing config files from different &amp;quot;times&amp;quot;&lt;br /&gt;
* Merging config files&lt;br /&gt;
* Recovering accidentally deleted/overwritten files&lt;br /&gt;
* Rollback your system&lt;br /&gt;
* Anchor for a backup with send/receive&lt;br /&gt;
* Basis for a seed&lt;br /&gt;
* &amp;#039;&amp;#039;What do you use snapshots for ?&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Making and deleting snapshots is best done automatically:&lt;br /&gt;
* snapper [https://wiki.archlinux.org/title/snapper snapper@wiki.archlinux] [https://github.com/openSUSE/snapper snapper@github] [http://snapper.io/ snapper.io] &lt;br /&gt;
* timeshift [https://wiki.archlinux.org/title/Synchronization_and_backup_programs timeshift@wiki.archlinux] [https://github.com/teejee2008/timeshift timeshift@github]&lt;br /&gt;
&lt;br /&gt;
=== Taking snapshots === &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
Taking a snapshot is &amp;#039;&amp;#039;&amp;#039;very fast&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;nearly priceless&amp;#039;&amp;#039;&amp;#039;. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files, the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additionally all created or modified files since the last snapshot and so on. &amp;#039;&amp;#039;&amp;#039;If you don´t release&amp;#039;&amp;#039;&amp;#039;(delete) any snapshot &amp;#039;&amp;#039;&amp;#039;you will&amp;#039;&amp;#039;&amp;#039; eventually &amp;#039;&amp;#039;&amp;#039;run out of space&amp;#039;&amp;#039;&amp;#039; soon(disk full)&lt;br /&gt;
&lt;br /&gt;
=== Releasing snapshots === &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. To free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will become free.(This is greatly simplified) Therefore it is &amp;#039;&amp;#039;&amp;#039;costly to remove snapshots&amp;#039;&amp;#039;&amp;#039;. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be &amp;#039;&amp;#039;&amp;#039;no immediate gain in free space&amp;#039;&amp;#039;&amp;#039;. After a while you will notice that some space has become free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Don´t forget to remove snapshots, or you will get in &amp;#039;&amp;#039;&amp;#039;&amp;quot;out of space&amp;quot; -trouble soon&amp;#039;&amp;#039;&amp;#039;. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.&lt;br /&gt;
* ++++ &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; some partition/device to the volume&lt;br /&gt;
* +++ &amp;#039;&amp;#039;&amp;#039;Remove&amp;#039;&amp;#039;&amp;#039; some snapshots you don&amp;#039;t need&lt;br /&gt;
* + &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; some files (this does only help if they are not part of any snapshot)&lt;br /&gt;
&lt;br /&gt;
=== Rollback to a snapshot === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Make a snapshot(ro)&amp;#039;&amp;#039;&amp;#039; of the actual subvolume (for later reference)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Delete the subvolume&amp;#039;&amp;#039;&amp;#039; out of its actual place&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Create a new subvolume(rw)&amp;#039;&amp;#039;&amp;#039; out of the snapshot chosen for rollback&lt;br /&gt;
# Make this new subvolume the default (optional)&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Don&amp;#039;t forget&amp;#039;&amp;#039;&amp;#039; to remove the snapshot you made in a few days&lt;br /&gt;
see in forum: [https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 manual Rollback with btrfs]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Please also have a look at [https://github.com/jrabinow/snapper-rollback snapper-rollback@github] and at [https://wiki.archlinux.org/title/Snapper#Suggested_filesystem_layout snapshot-layout@wiki.archlinux] for the suggested flat layout and the reasoning. ([https://forum.manjaro.org/t/how-to-manual-rollback-with-btrfs/80230 Rollback example ])&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the &amp;quot;rest of the volume&amp;quot; for storing everything you change from this time on. At some point in time you have to release the snapshot. Don´t use your space up. Btrfs needs &amp;#039;&amp;#039;&amp;#039;space to breath.&amp;#039;&amp;#039;&amp;#039; Don&amp;#039;t use more then 80% or you will get into trouble.&amp;quot;}}&lt;br /&gt;
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using &amp;#039;&amp;#039;&amp;#039;quotas&amp;#039;&amp;#039;&amp;#039; together with snapshots (snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs RAID = &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
With Btrfs you no longer need to use &amp;#039;&amp;#039;mdadm&amp;#039;&amp;#039; to create mirrored volumes or to create RAIDs. This is already included in btrfs, and very easy to use. There are even advanced features bult in:&lt;br /&gt;
* Add devices to the volume This will integrate a device into the mounted volume {{RootCmd|command=btrfs device add [/dev/sdz7] /}}&lt;br /&gt;
* Remove devices from the volume. This will not delete any data, but remove the device from the volume. Bevorehand all data will be copied to the remaining devices of the volume.{{RootCmd|command=btrfs device delete [/dev/sdz8] /}} &lt;br /&gt;
* Use devices with different sizes in one volume&lt;br /&gt;
* Switch the volume between RAID levels &lt;br /&gt;
* Convert data to different RAID levels &lt;br /&gt;
* Do this while the volume is mounted and being used&lt;br /&gt;
{{BoxInfo|Raid Levels|There’s some similarity with traditional RAID levels, but this could be confusing to users familiar with the traditional meaning. Due to the similarity, the RAID terminology is widely used in the documentation (of btrfs). See [https://en.wikipedia.org/wiki/RAID RAID@wikipedia],[https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#profiles RAID profiles@btrfs.readthedocs]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid0 RAID 0] (not Just a Bunch of Disks)== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Using one ore more devices to build a volume. This volume has the &amp;#039;&amp;#039;&amp;#039;capacity of all the used devices together(1+2+3+4...)&amp;#039;&amp;#039;&amp;#039;. This is an very easy way to expand your volume when you need more space.  You even can add 2 or 3 devices at a time. When you want to replace a device, you can add the new device, then remove the old device. Btrfs will move all data as necessary. &amp;#039;&amp;#039;To distribute all data to all devices you may want to &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; the volume.&amp;#039;&amp;#039; Btrfs will stripe the data to all devices.&lt;br /&gt;
{{BoxWarning|If one device fails, everything is lost|Be aware that when one of the devices fails your complete volume may be lost if you use RAID 0}}&lt;br /&gt;
&lt;br /&gt;
=== 1 device === &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
In most setups you will start a volume with 1 device. If only one device is present, &amp;#039;&amp;#039;&amp;#039;metadata will be duplicated&amp;#039;&amp;#039;&amp;#039; on that device. Even with this simple setup you benefit from most features of Btrfs.&lt;br /&gt;
&lt;br /&gt;
=== 2 or more devices === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
By default, &amp;#039;&amp;#039;&amp;#039;metadata will be mirrored&amp;#039;&amp;#039;&amp;#039; across two devices and &amp;#039;&amp;#039;&amp;#039;data will be striped&amp;#039;&amp;#039;&amp;#039; across all of the devices present. But if you have 2 or more devices in your volume you should consider using RAID 1.&lt;br /&gt;
&lt;br /&gt;
== [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1 RAID 1] (mirrored), [https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html#raid1c3 1C3], [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles 1C4] == &amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
When using Raid 1 btrfs mirrors data and metadata. This way it is possible to repair data when one copy gets damaged. This could happen when one device fails, when power was lost while writing, ... &amp;#039;&amp;#039;&amp;#039;After enabling RAID1&amp;#039;&amp;#039;&amp;#039; all new data and metadata is automatically mirrored. To mirror your existing data and metadata, &amp;#039;&amp;#039;&amp;#039;you have to balance your complete volume&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Automatic repair === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
In order to preserve the integrity of the volume, Btrfs does separate CRC-checksums of metadata blocks and of data blocks. Every time a data block is read, the checksum is verified. When the checksum shows that the data is not good, Btrfs tries to get a good copy from the mirrored block. Then the bad block is written again with the good data from the mirrored block. This happens in background. The filesystem has been repaired, and this is logged into syslog. This can be forced by using btrfs scrub.&lt;br /&gt;
&lt;br /&gt;
=== [https://btrfs.readthedocs.io/en/stable/mkfs.btrfs.html#man-mkfs-profiles RAID 10] (automatic) === &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
When using enough devices(4...) with RAID 1, Btrfs will distribute all data, so that it not only is mirrored but also striped.&lt;br /&gt;
&lt;br /&gt;
== RAID 5 == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
== RAID 6 == &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
{{BoxDanger|Not save yet|This is not recommended [https://btrfs.wiki.kernel.org/index.php/Gotchas see Parity RAID@btrfs.wiki.kernel.org]}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs maintenance = &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance. Please also have a look at [[Btrfs Maintenance|Btrfs_Maintenance]]&lt;br /&gt;
=== Fragmentation ===&lt;br /&gt;
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). &lt;br /&gt;
&lt;br /&gt;
When the files are only written to, or are only read seldom, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t worry&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
==== Databases ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
It may be good to defragment a database if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when using it.&lt;br /&gt;
==== Logfiles ====&lt;br /&gt;
It may be good to defragment a logfile, if there is a &amp;#039;&amp;#039;noticeable&amp;#039;&amp;#039; slowdown when booting your system.&lt;br /&gt;
&lt;br /&gt;
== Balance [https://btrfs.readthedocs.io/en/latest/Balance.html ⇒] == &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
When adding devices or changing the RAID-level of your volume, it may be necessary to balance your volume. While balancing, btrfs will read ALL (or a subset of all) &amp;#039;&amp;#039;&amp;#039;chunks&amp;#039;&amp;#039;&amp;#039; in, and write them out again using the actual RAID-level. It will stripe these files over all available devices equally. While this happens, the volume will keep being usable, but you may see some &amp;#039;&amp;#039;&amp;#039;heavy load&amp;#039;&amp;#039;&amp;#039; on it. Also &amp;#039;&amp;#039;&amp;#039;this may take a very long time&amp;#039;&amp;#039;&amp;#039; because &amp;#039;&amp;#039;&amp;#039;ALL data must be&amp;#039;&amp;#039;&amp;#039; read AND &amp;#039;&amp;#039;&amp;#039;written&amp;#039;&amp;#039;&amp;#039; again.&lt;br /&gt;
Don´t worry about shutdown. When you shutdown your computer while the balance is running, the balance will pause. After you restart the computer the balance will restart and continue until it is finished.&lt;br /&gt;
{{BoxDanger|Possible bug when using a swap file:|  Never use a full-balance on a machine with a swapfile, since it will ignore +C Attributes. You may also have a look at [https://forum.manjaro.org/t/howto-enable-and-configure-hibernation-with-btrfs/51253/36] }}&lt;br /&gt;
&lt;br /&gt;
=== Filters === &amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Because a complete balance may take &amp;#039;&amp;#039;&amp;#039;a long time&amp;#039;&amp;#039;&amp;#039;, there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 50% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=50 -dusage=50 /}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; all chunks that are less than 90% full. This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=90 -dusage=90 /}}&lt;br /&gt;
{{BoxWarning|Don&amp;#039;t use filters higher than 90%|This is unnecessary on an SSD drive. On a hard drive, this will put a lot of strain on the disk. Even with today&amp;#039;s hard drives (&amp;gt;2TB), it may take a very long time. (e.g. 24 hours or more)}}&lt;br /&gt;
&lt;br /&gt;
=== Merging chunks === &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (&amp;gt; 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.&lt;br /&gt;
&lt;br /&gt;
=== After removing a device === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
When you remove a device from a volume, btrfs will automatically balance all &amp;quot;chunks&amp;quot; that where on the removed device. These chunks are placed on another device of the volume. So you don&amp;#039;t need to balance by yourself after removing a device.&lt;br /&gt;
&lt;br /&gt;
=== After adding a device === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
When you add a device there will be no automatic balance. Only when further using the volume, btrfs will use the additional free space according to the actual RAID-level. &lt;br /&gt;
&lt;br /&gt;
=== After changing RAID-level === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
When you changed RAID-levels (for example from RAID 0 to RAID 1) there is no automatic duplication of the chunks. Only when writing further, btrfs will respect the changed RAID-level. This may not be what you intended. To complete the conversion to another RAID-level you need to tell btrfs to rewrite chunks where needed. You do this with a manual balance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
see: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]&lt;br /&gt;
&lt;br /&gt;
== Scrub [https://btrfs.readthedocs.io/en/latest/Scrub.html ⇒] == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
A scrub of a btrfs volume is like inspecting your home. Does the light work in every room? Is the battery of a smoke alarm empty? Does the fire extinguisher need to be replaced? Is any faucet dripping?&lt;br /&gt;
Every now and then it is advisable to look for such things. And fix it right away!&lt;br /&gt;
&lt;br /&gt;
==== Check &amp;amp; repair on the fly ==== &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Every time btrfs reads a file, it checks the corresponding checksums. When btrfs is in RAID 0 and detects a &amp;#039;damaged&amp;#039; file, it only can tell you that the file is damaged. You may delete it, or replace it from your backup.&lt;br /&gt;
When running in RAID 1 btrfs has 2 copies of every file. So if one file seems to be damaged, btrfs will read the other copy. If this other copy is ok, btrfs will automatically create another good copy of the file, and then afterwards delete the defect copy. You won&amp;#039;t even notice this &amp;#039;&amp;#039;&amp;#039;&amp;#039;automatic&amp;#039; repair.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Full check ==== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Sometimes you may want to check ALL files, and to get a report of defects, because:&lt;br /&gt;
* Some files are read very seldom, and you don&amp;#039;t want &amp;quot;bitrott&amp;quot;&lt;br /&gt;
* You want to check your data completely for any faults&lt;br /&gt;
* Once in a while you want to make sure all is well&lt;br /&gt;
* You want to force your disk/device to verify all data&lt;br /&gt;
* ...&lt;br /&gt;
This is when you use btrfs scrub. Scrub will read ALL data of your complete volume. While this is done, all files and metadata will be checked by the checksums and all problems will be reportet. Because this will read and verify your complete volume (eventually a few Terra-byte), it may take some time. Scrub will not waste time in checking unused chunks. &lt;br /&gt;
While checking you can enable automatic repair for RAID 1 or disable it. If you disable automatic repair, scrub will work completely readonly, and will change nothing on your volume.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Scrub can be done automatically (for example every month), or manually. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
{{BoxInfo|Notice| Be aware, that Scrub does not structurally check the filesystem, but only checksums data and tree blocks. You may also have a look at [https://btrfs.readthedocs.io/en/latest/Tree-checker.html tree checker] }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
A manual scrub is done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs scrub start -Bd /}}&lt;br /&gt;
&lt;br /&gt;
= Solving Problems = &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Out of space == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Avoid to get out of space with btrfs! ==== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Don&amp;#039;t be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full.  Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. &lt;br /&gt;
{{BoxWarning|Don&amp;#039;t forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}&lt;br /&gt;
{{BoxInfo|Tip: Check how close you are to &amp;quot;out of space&amp;quot;.| Look at &amp;#039;&amp;#039;&amp;#039;Device unallocated:&amp;#039;&amp;#039;&amp;#039; (not at &amp;#039;&amp;#039;Free (estimated):&amp;#039;&amp;#039;) [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]&lt;br /&gt;
{{RootCmd|command=btrfs filesystem usage /}}&lt;br /&gt;
}}&lt;br /&gt;
=== Get out of jail ===&lt;br /&gt;
This said, there is an &amp;#039;&amp;#039;&amp;#039;easy way out&amp;#039;&amp;#039;&amp;#039;: Give btrfs more space ;-)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add a partition&amp;#039;&amp;#039;&amp;#039; (for example a extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}&lt;br /&gt;
* From now on this usb-partition belongs to your volume! Do not boot without it. &amp;#039;&amp;#039;&amp;#039;Do not reboot&amp;#039;&amp;#039;&amp;#039; at all in this stage! This stick has to stay until btrfs device remove has completed.&lt;br /&gt;
* look for old snapshots you don´t need, remove them &amp;#039;&amp;#039;&amp;#039;now&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;or delete some files&amp;#039;&amp;#039;&amp;#039; you do not need &lt;br /&gt;
* Do this until your disk will be not more then 95% full&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(50%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=50 -dusage=50 /}}&lt;br /&gt;
{{BoxSuccess|Tip: Want to watch the volume clean up ?|&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}}}&lt;br /&gt;
{{BoxSuccess|After that inside a terminal:|&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}} &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;balance&amp;#039;&amp;#039;&amp;#039; your volume with a filter(95%) This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some more time !&lt;br /&gt;
{{RootCmd|command=btrfs balance start -musage=95 -dusage=95 /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove the added partition&amp;#039;&amp;#039;&amp;#039; from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}}&lt;br /&gt;
* This &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; take some time ! &amp;#039;&amp;#039;&amp;#039;Do not reboot until this step is complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Now you may remove the USB-Stick.&lt;br /&gt;
&lt;br /&gt;
=== Stay out of jail === &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Think about how to extend the btrfs volume to &amp;#039;&amp;#039;&amp;#039;double size&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* seek if there is a program filling your disk&lt;br /&gt;
* look for snapshots !&lt;br /&gt;
* don’t forget to remove old snapshots (best done automatically)&lt;br /&gt;
&lt;br /&gt;
== Corrupted checksums == &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
 [ 9364.354241] BTRFS error (device nvme0n1p3): block=58469742080 write time tree block corruption detected&lt;br /&gt;
This ERROR or similar may lead to Messages like:&lt;br /&gt;
 Configuration file &amp;quot;/home/user/.config/dolphinrc&amp;quot; not writable. Please contact your system administrator.&lt;br /&gt;
because btrfs does mount this partition &amp;#039;&amp;#039;&amp;#039;readonly&amp;#039;&amp;#039;&amp;#039; when it detects corrupted blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Now you have to investigate WHY a checksum of a btrfs block says it is corrupted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
* In some cases the underlying device may beginn to fail ! =&amp;gt; replace it (consider using RAID10)&lt;br /&gt;
* In other cases a corruption may have happened even before the block had been written to disk&lt;br /&gt;
** corruption in RAM&lt;br /&gt;
** some software-bug ???&lt;br /&gt;
** ssd gone bad ??? [https://forum.manjaro.org/t/update-ended-in-readonly-filesystem/154442/34 example]&lt;br /&gt;
[https://btrfs.readthedocs.io/en/latest/Hardware.html What the Btrfs developers say:] If you use unreliable hardware and don’t know about that, don’t blame the filesystem when it tells you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
Also see: [https://btrfs.readthedocs.io/en/latest/Tree-checker.html Tree-ckecker]&lt;br /&gt;
&lt;br /&gt;
== Tips == &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move a volume === &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
There is an &amp;#039;&amp;#039;&amp;#039;easy and secure way&amp;#039;&amp;#039;&amp;#039; to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this &amp;#039;&amp;#039;&amp;#039;while the volume is in use&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Create the partition you want to use as &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;without formatting&amp;#039;&amp;#039;&amp;#039; it. Or remove the filesystem when one is present&lt;br /&gt;
* Add the &amp;#039;&amp;#039;destination&amp;#039;&amp;#039; device to your volume by {{RootCmd|command=btrfs device add /dev/[destination] [path to filesystem]}}&lt;br /&gt;
* Remove the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; device from your volume by {{RootCmd|command=btrfs device remove /dev/[source] [path to filesystem]}}&lt;br /&gt;
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want. &lt;br /&gt;
* Empty Blocks will not be moved&lt;br /&gt;
* Compressed data will remain compressed&lt;br /&gt;
* All Snapshots will remain&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The UUID of the filesystem will remain the same&amp;#039;&amp;#039;&amp;#039;, but btrfs will be aware of this&lt;br /&gt;
* If you used the UUID to identify your volume, you even wont´t need to edit &amp;#039;&amp;#039;&amp;#039;/boot/grub/grub.cfg&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/etc/fstab&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* Only, &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t shutdown while the move of the volume is not complete&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
If you want to watch the volume move, inside a terminal:&lt;br /&gt;
{{UserCmd|command=pamac install procps-ng}}&lt;br /&gt;
{{RootCmd|command=watch -n 60 btrfs filesystem show /}}&lt;br /&gt;
&lt;br /&gt;
=== Resize a btrfs filesystem/device === &amp;lt;!--T:130--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
When you resize a file system, you also need to resize the partition (device) it resides on. You cannot resize a mounted partition using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;! So you need to unmount it beforehand or use a live manjaro from USB to resize the partition and file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
When resizing existing file systems, it is strongly advisable to have current backups. However, resizing is possible without any problems when using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== shrink ==== &amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
What you need to understand is that you can only safely shrink a file system if it is &amp;#039;&amp;#039;not too full&amp;#039;&amp;#039;. Shrinking a file system can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; because BTRFS may need to move data that was in the area to be freed to the remaining area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039; you can safely shrink a BTRFS file system. All necessary steps are taken such as:&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Shrink file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
* Shrink partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
see@ https://forum.manjaro.org/t/howto-resize-a-btrfs-filesystem/152999&lt;br /&gt;
&lt;br /&gt;
==== expand ==== &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
A BTRFS file system can also be safely expanded with &amp;#039;&amp;#039;&amp;#039;gparted&amp;#039;&amp;#039;&amp;#039;. All necessary steps are taken such as:&lt;br /&gt;
* Extend partition&lt;br /&gt;
* Mount file system&lt;br /&gt;
* Expand file system&lt;br /&gt;
* Unmount file system&lt;br /&gt;
&lt;br /&gt;
=== Mount options ===&lt;br /&gt;
The default mount settings chosen by btrfs are really optimal in most cases! There are only a few options to think about. Current and accurate information can also be found at: https://btrfs.readthedocs.io/en/latest/Administration.html&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;,discard&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,ssd&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;,space_cache&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;automatic !)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{BoxInfo|,noatime|Under read intensive work-loads, specifying noatime significantly improves performance because no new access time information needs to be written. Default is &amp;#039;&amp;#039;relatime&amp;#039;&amp;#039;. ( &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;,lazytime &amp;#039;&amp;#039;[https://github.com/kdave/btrfs-progs/issues/377 may not help, however]&amp;#039;&amp;#039;&amp;#039;)}}&lt;br /&gt;
{{BoxInfo|,compress&amp;amp;#61;zstd:7| Enables automatic and transparent compression. If compression is enabled, &amp;#039;&amp;#039;nodatacow&amp;#039;&amp;#039; and &amp;#039;&amp;#039;nodatasum&amp;#039;&amp;#039; are disabled. The compression level is adjustable, with higher levels trading off speed and memory for higher compression rates. ZLIB accepts the range [1, 9] and ZSTD accepts [1, 15]. &amp;#039;&amp;#039;&amp;#039;Default is 3&amp;#039;&amp;#039;&amp;#039; each}}&lt;br /&gt;
You can always test what btrfs uses with:  {{UserCmd|command=mount -t btrfs}}&lt;br /&gt;
&lt;br /&gt;
= Btrfs options = &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] == &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Compression can only be set &amp;#039;&amp;#039;&amp;#039;per volume&amp;#039;&amp;#039;&amp;#039;. So if you set different &amp;quot;levels&amp;quot; of compression for different mounts in the fstab, only the first &amp;quot;level&amp;quot; will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]&lt;br /&gt;
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, &amp;#039;&amp;#039;&amp;#039;grub&amp;#039;&amp;#039;&amp;#039; needs to decompress these files. Otherwise you will &amp;#039;&amp;#039;&amp;#039;not be able to boot&amp;#039;&amp;#039;&amp;#039;. GRUB introduced &amp;#039;&amp;#039;&amp;#039;zstd&amp;#039;&amp;#039;&amp;#039; support in &amp;#039;&amp;#039;&amp;#039;2.04.&amp;#039;&amp;#039;&amp;#039; Maybe you need to update grub &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; reinstall it}}&lt;br /&gt;
&lt;br /&gt;
== Encryption == &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
May be in the future.&lt;br /&gt;
&lt;br /&gt;
== Send + receive = backup [https://btrfs.readthedocs.io/en/latest/Send-receive.html ⇒] == &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Some wiki-posts in the forum:&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-copy-move-a-subvolume-from-one-partition-to-another/135166 move a subvolume to another volume]&lt;br /&gt;
* [https://forum.manjaro.org/t/howto-use-btrfs-send-receive/135808 backup snapshots]&lt;br /&gt;
&lt;br /&gt;
== Quota groups [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Quota support in Btrfs is implemented at the subvolume level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]&lt;br /&gt;
{{BoxDanger|Reports about problems|There are reports about massive problems when using quotas (especially together with snapshots, snapper, timeshift). Please have a look at: [https://btrfs.wiki.kernel.org/index.php/Quota_support#Known_issues Known_issues@btrfs.kernel.org]}}&lt;br /&gt;
* [https://forum.manjaro.org/t/freeze-issues-with-btrfs-and-timeshift/22005/10 freeze-issues-with-btrfs-and-timeshift 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/cannot-clone-btrfs-boot-drive-with-clonezilla/78836/10 cannot-clone-btrfs-boot-drive-with-clonezilla 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/btrfs-qgroups-warning-error/64029 btrfs-qgroups-warning-error 2021]&lt;br /&gt;
* [https://forum.manjaro.org/t/files-disappearing-in-btrfs-and-ssd/28991 files-disappearing-in-btrfs-and-ssd 2020]&lt;br /&gt;
&lt;br /&gt;
== Zoned mode [https://btrfs.readthedocs.io/en/latest/Zoned-mode.html ⇒] == &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
Beginning with version 5.12&lt;br /&gt;
&lt;br /&gt;
= Btrfs Tools = &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
For complete info an all tools for btrfs please do an actual search at the arch wiki and at the manjaro forum for &amp;quot;btrfs&amp;quot;. In the following section only a few commands are described. Especially those commands that are often misinterpreted. Commands described earlier are omitted.&lt;br /&gt;
&lt;br /&gt;
== btrfs (the command) [https://btrfs.readthedocs.io/en/latest/man-index.html ⇒] == &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
Be aware that some sub-commands of btrfs will not work as normal user. Other sub-commands do work but will give only partial info. So best use them as &amp;#039;&amp;#039;root&amp;#039;&amp;#039; or with &amp;#039;&amp;#039;sudo&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==== help, version ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;help&amp;#039;&amp;#039;&amp;#039; together with &amp;#039;&amp;#039;&amp;#039;man btrfs&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;info btrfs&amp;#039;&amp;#039;&amp;#039; will get you an overview over the usable options on your install. {{UserCmd|command=btrfs help}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
With the &amp;#039;&amp;#039;&amp;#039;version&amp;#039;&amp;#039;&amp;#039; of btrfs given here you can look at [https://btrfs.wiki.kernel.org/index.php/Changelog changelog].{{UserCmd|command=btrfs version}}&lt;br /&gt;
&lt;br /&gt;
==== device ==== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;scan&amp;#039;&amp;#039;&amp;#039; will give no visible results 😜&lt;br /&gt;
{{RootCmd|command=btrfs device scan}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;stats&amp;#039;&amp;#039;&amp;#039; will give a list of errors detected in the past. This all should be 0, or you may be in trouble.&lt;br /&gt;
{{RootCmd|command=btrfs device stats /}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
What to look for in device &amp;#039;&amp;#039;&amp;#039;usage&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* RAID-level of Data, Metadata and System&lt;br /&gt;
* Unalocated:&lt;br /&gt;
Don&amp;#039;t ever let &amp;#039;&amp;#039;Unalocated:&amp;#039;&amp;#039; get below 5% of your volume (or double the size you need for your next update)! If this goes too low, you will get into &amp;quot;out of space&amp;quot; trouble&lt;br /&gt;
{{RootCmd|command=btrfs device usage /}}&lt;br /&gt;
Without sudo this will give very wrong results for everything displayed. &amp;#039;&amp;#039;&amp;#039;Dont´t use this without sudo !&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem df / === &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem du === &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
Here the full scope of btrfs&amp;#039; difference becomes visible. When btrfs takes snapshots, many files are contained unchanged in several snapshots, but only take up space in the file system once. At the same time, there can be the same(!) file with different content and size in different snapshots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
It is therefore not enough to simply add up the size of all files in a path to determine the &amp;#039;&amp;#039;&amp;#039;space consumption&amp;#039;&amp;#039;&amp;#039; in the file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
For each file, it must be determined how large it is and whether all or part of it is shared with other subvolumes. Since btrfs has to read a lot of metadata for this, it can take a &amp;#039;&amp;#039;&amp;#039;long time&amp;#039;&amp;#039;&amp;#039; to display the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
{{RootCmd|command=btrfs filesystem du -s /home}}&lt;br /&gt;
     Total   Exclusive  Set shared  Filename&lt;br /&gt;
   8.11TiB     6.23GiB   215.76GiB  /home&lt;br /&gt;
{{BoxInfo|Total|The sum of all files, as &amp;quot;du&amp;quot; would display them in a conventional file system. This is how much space a conventional file system would use to store these files (and all the necessary copies).}}&lt;br /&gt;
{{BoxInfo|Exclusive|The sum of the files that &amp;quot;only&amp;quot; occur in one of the subvolumes and are not shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Set shared|The sum of files shared with other subvolumes}}&lt;br /&gt;
{{BoxInfo|Exclusive + Set shared|This is the actual space used in the file system}}&lt;br /&gt;
&lt;br /&gt;
=== btrfs filesystem show === &amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
=== btrfs filesystem usage ===&lt;br /&gt;
=== btrfs scrub status ===&lt;br /&gt;
&lt;br /&gt;
==btrfsck== &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
This is not what you may think it is 😜&lt;br /&gt;
&lt;br /&gt;
== Recomendations == &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ We recommend using Btrfs with UEFI and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 || Fat32 || 1GiB || EFI system partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ IF you don&amp;#039;t have UEFI, you may use Btrfs with BIOS and GPT&lt;br /&gt;
|-&lt;br /&gt;
! Partition !! Filesystem !! Size !! Partition type&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda1 ||(bootloader)|| 4MiB || BIOS boot partition&lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda2 || Btrfs || 1Gib - 8EiB || Btrfs Volume &lt;br /&gt;
|-&lt;br /&gt;
| /dev/sda3 || swap [https://btrfs.readthedocs.io/en/latest/Subvolumes.html ⇒] || 4GiB, at least your RAM-size || Swap partition (optional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Don&amp;#039;t forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Information = &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
=== Why not btrfs ? ===&lt;br /&gt;
A lot of people say: &amp;quot;&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t use btrfs because&amp;#039;&amp;#039;&amp;#039; it is experimental and is &amp;#039;&amp;#039;&amp;#039;not stable&amp;#039;&amp;#039;&amp;#039;. You can´t use it in production. It is not safe!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Not stable ? ==== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
The status of btrfs was experimental for a long time, but the core functionality is considered &amp;#039;&amp;#039;&amp;#039;good enough for daily use&amp;#039;&amp;#039;&amp;#039;. &amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs&lt;br /&gt;
&lt;br /&gt;
==== Experimental ? ==== &amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.&amp;lt;small&amp;gt;(from kernel.org)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
Some features are &amp;#039;&amp;#039;&amp;#039;not implemented yet&amp;#039;&amp;#039;&amp;#039;. Others are only &amp;#039;&amp;#039;&amp;#039;partly implemented&amp;#039;&amp;#039;&amp;#039;. Some are &amp;#039;&amp;#039;&amp;#039;experimental&amp;#039;&amp;#039;&amp;#039; and not suggested for production use. As is always the case in Linux-land &amp;#039;&amp;#039;you&amp;#039;&amp;#039; decide what to use, and so you are responsible for your own decisions.&lt;br /&gt;
&lt;br /&gt;
==== Not usable for production ? ==== &amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem &lt;br /&gt;
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org&lt;br /&gt;
* Some manufacturers do deploy devices where Btrfs is installed by default.&lt;br /&gt;
&lt;br /&gt;
==== Difficult to repair ? ==== &amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don&amp;#039;t find good information about repairing btrfs. This is not because it is difficult to repair Btrfs, but because repairing Btrfs &amp;#039;&amp;#039;&amp;#039;does work very differently&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== What&amp;#039;s this &amp;quot;Copy on Write&amp;quot; == &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.&lt;br /&gt;
&lt;br /&gt;
=== Write in place (FAT32) === &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
Most older file systems do write &amp;quot;in place&amp;quot;. This means that some data or metadata will be written &amp;quot;over&amp;quot; the previous data at the same place. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
For example this is the case for FAT32 file systems. The &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;ile &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;llocation &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;able is at a fixed place on this file system. When the &amp;quot;FAT&amp;quot; changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.&lt;br /&gt;
&lt;br /&gt;
=== Write to a metadata-log (Ext4) === &amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
There is a solution to this with newer file systems like Ext4. Instead of writing metadata &amp;quot;in place&amp;quot;, metadata is written into an &amp;quot;endless&amp;quot; log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
There has to be an additional mechanism to make this safe. Sometimes this is called &amp;quot;barriers&amp;quot;, and there have to be checksums that tell when a part of the log is corrupted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely.&lt;br /&gt;
&lt;br /&gt;
=== Copy on Write! (Btrfs)=== &amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
Copy on Write is a &amp;quot;new&amp;quot; concept. It means the file system will try to &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; write over existing data. &amp;#039;&amp;#039;&amp;#039;How is this even possible?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Files are appended at the end of a &amp;quot;data page&amp;quot;&lt;br /&gt;
* Metadata is appended at a &amp;quot;metadata page&amp;quot;&lt;br /&gt;
* Inside a page &amp;#039;&amp;#039;&amp;#039;nothing is ever overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When a page is full the file system will use the next free page&lt;br /&gt;
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted&lt;br /&gt;
* Overwriting a file does first append the new file to the actual &amp;quot;data page&amp;quot;, then appends the metadata for this file to the &amp;quot;metadata page&amp;quot;.&lt;br /&gt;
* Changing small parts of a file will write only the new parts, then &amp;#039;&amp;#039;link&amp;#039;&amp;#039; the rest to the old file&lt;br /&gt;
* there are checksums for data and metadata&lt;br /&gt;
&lt;br /&gt;
==== Downsides ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
* Management of space is complex&lt;br /&gt;
* There are 2 sorts of pages (data / metadata)&lt;br /&gt;
* There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages&lt;br /&gt;
* It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive&lt;br /&gt;
&lt;br /&gt;
==== Advantages ==== &amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
* It is possible to &amp;#039;&amp;#039;&amp;#039;detect&amp;#039;&amp;#039;&amp;#039; nearly any &amp;#039;&amp;#039;&amp;#039;corruption&amp;#039;&amp;#039;&amp;#039; because of the checksums&lt;br /&gt;
* When the power is lost, or the disk is disconnected, all old data is save. WHY?&lt;br /&gt;
** Every bit of &amp;quot;old&amp;quot; data from before the power loss or the disconnection is present because it is &amp;#039;&amp;#039;&amp;#039;NOT overwritten&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** Only the newly written data may be partly damaged&lt;br /&gt;
** The metadata may also be partly damaged&lt;br /&gt;
** When mounting the volume it is possible by analyzing checksums and metadata to find the point in the filesystem where all was good&lt;br /&gt;
** Btrfs will &amp;#039;&amp;#039;&amp;#039;automatically roll back&amp;#039;&amp;#039;&amp;#039; to this point, then it can mount the file system writable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
* CoW is a sound foundation to build upon&lt;br /&gt;
** Snapshots&lt;br /&gt;
** RAID&lt;br /&gt;
** Volume management&lt;br /&gt;
** Compression&lt;br /&gt;
** Encryption (maybe some time in the future)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you &amp;#039;&amp;#039;&amp;#039;loose all benefits&amp;#039;&amp;#039;&amp;#039; of Btrfs. It won´t even make checksums. If you don&amp;#039;t like CoW, then you better use another filesystem}}&lt;br /&gt;
&lt;br /&gt;
= Use the Forum! = &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
It is a good Idea to [https://forum.manjaro.org/search?q=btrfs search the forum] for posts related to btrfs. &lt;br /&gt;
&lt;br /&gt;
= Btrfs is fast moving! See Also:= &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* [https://btrfs.readthedocs.io/en/latest/index.html btrfs.readthedocs.io]&lt;br /&gt;
* [https://wiki.archlinux.org/title/btrfs btrfs@ARCH-wiki]&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;!--Category or categories should have a translation extension below example--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Category:Boilerplate{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Andreas85</name></author>
	</entry>
</feed>