Difference between revisions of "Btrfs/tr"

Updating to match new version of source page
(Updating to match new version of source page)
Tags: Mobile web edit Mobile edit
(Updating to match new version of source page)
 
Line 237: Line 237:
* ++++ '''Add''' some partition/device to the volume
* ++++ '''Add''' some partition/device to the volume
* +++ '''Remove''' some snapshots you don't need
* +++ '''Remove''' some snapshots you don't need
* ++ [[Btrfs#Compression_.E2.87.92|Compress]] your volume
* + '''Delete''' some files (this does only help if they are not part of any snapshot)
* + '''Delete''' some files (this does only help if they are not part of any snapshot)
</div>
</div>
Line 256: Line 257:
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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 ])
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 ])
{{BoxWarning|Don't forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the "rest of the volume" 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 '''space to breath.''' Don't use more then 80% or you will get into trouble."}}
{{BoxWarning|Don't forget to remove snapshots before you run out of space|Every time you take a snapshot you only use the "rest of the volume" 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 '''space to breath.''' Don't use more then '''90%''' or you will get into trouble."}}
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using '''quotas''' 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]}}
{{BoxDanger|NO Snapshots together with quotas|There are reports about massive problems when using '''quotas''' 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]}}
</div>
</div>
Line 341: Line 342:
Because a complete balance may take '''a long time''', there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.
Because a complete balance may take '''a long time''', there is the possibility of filters in balance. When using a filter only those chunks will be balanced, that are named by the filter.
* '''balance''' all chunks that are less than 50% full. This '''will''' take some time !
* '''balance''' all chunks that are less than 50% full. This '''will''' take some time !
{{RootCmd|command=btrfs balance start -musage=50 -dusage=50 /}}
{{RootCmd|command=btrfs balance start -dusage=50 /}}
* '''balance''' all chunks that are less than 90% full. This '''will''' take some time !
* '''balance''' all chunks that are less than 90% full. This '''will''' take some time !
{{RootCmd|command=btrfs balance start -musage=90 -dusage=90 /}}
{{RootCmd|command=btrfs balance start -dusage=90 /}}
{{BoxWarning|Don'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's hard drives (>2TB), it may take a very long time. (e.g. 24 hours or more)}}
{{BoxWarning|Don'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's hard drives (>2TB), it may take a very long time. (e.g. 24 hours or more)}}
</div>
</div>
Line 441: Line 442:
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
* '''balance''' your volume with a filter(50%) This '''will''' take some time !
* '''balance''' your volume with a filter(50%) This '''will''' take some time !
{{RootCmd|command=btrfs balance start -musage=50 -dusage=50 /}}
{{RootCmd|command=btrfs balance start -dusage=50 /}}
{{BoxSuccess|Tip: Want to watch the volume clean up ?|
{{BoxSuccess|Tip: Want to watch the volume clean up ?|
{{UserCmd|command=pamac install procps-ng}}}}
{{UserCmd|command=pamac install procps-ng}}}}
Line 447: Line 448:
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}}  
{{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}}  
* '''balance''' your volume with a filter(95%) This '''will''' take some more time !
* '''balance''' your volume with a filter(95%) This '''will''' take some more time !
{{RootCmd|command=btrfs balance start -musage=95 -dusage=95 /}}
{{RootCmd|command=btrfs balance start -dusage=95 /}}
</div>
</div>


Line 462: Line 463:
* look for snapshots !
* look for snapshots !
* don’t forget to remove old snapshots (best done automatically)
* don’t forget to remove old snapshots (best done automatically)
* [[Btrfs#Compression_.E2.87.92|use compression]] on this volume
</div>
</div>


Line 573: Line 575:
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] ==
== Compression [https://btrfs.readthedocs.io/en/latest/Compression.html ⇒] ==
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.
[[Btrfs#Mount_options|@see mount-options]]
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / btrfs rw,noatime,compress=zstd,subvol=@ 0 0
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
{| class="wikitable"
|+ Which compression suits me best?
|-
! CPU !! rotating disk !! SSD
|-
| slow ||  zstd:1 ... 4 || zstd:1 ... 3
|-
| medium ||  zstd:4 ... 7 || zstd:3 ... 5
|-
| fast ||  zstd:7 ... 10 || zstd:5 ... 10
|}
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
Compression can only be set '''per volume'''. So if you set different "levels" of compression for different mounts in the fstab, only the first "level" will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]
Compression can only be set '''per volume'''. So if you set different "levels" of compression for different mounts in the fstab, only the first "level" will be applied. [https://btrfs.readthedocs.io/en/latest/Compression.html#how-to-enable-compression see@btrfs.readthedocs.io]
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, '''grub''' needs to decompress these files. Otherwise you will '''not be able to boot'''. GRUB introduced '''zstd''' support in '''2.04.''' Maybe you need to update grub '''and''' reinstall it}}
{{BoxWarning|Grub needs to load the kernel and initrd|When you use compression on kernel, initrd, or grub config files, '''grub''' needs to decompress these files. Otherwise you will '''not be able to boot'''. GRUB introduced '''zstd''' support in '''2.04.''' Maybe you need to update grub '''and''' reinstall it}}
8,595

edits