8,595
edits
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 154: | Line 154: | ||
* ++++ '''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) | ||
Line 167: | Line 168: | ||
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 | {{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]}} | ||
Line 226: | Line 227: | ||
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 | {{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 | {{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)}} | ||
Line 292: | Line 293: | ||
* '''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 | {{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 298: | Line 299: | ||
{{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 | {{RootCmd|command=btrfs balance start -dusage=95 /}} | ||
* '''remove the added partition''' from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}} | * '''remove the added partition''' from the volume with {{RootCmd|command=btrfs device remove /dev/[sdz4] /}} | ||
Line 309: | Line 310: | ||
* 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 | |||
== Corrupted checksums == | == Corrupted checksums == | ||
Line 384: | Line 386: | ||
== 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 | |||
{| 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 | |||
|} | |||
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}} |