Difference between revisions of "Btrfs/ru"

968 bytes added ,  4 months ago
Updating to match new version of source page
(Created page with "== Группы квот [https://btrfs.readthedocs.io/en/latest/Qgroups.html ⇒] == Поддержка квот в Btrfs реализована на подтомном ур...")
(Updating to match new version of source page)
 
Line 175: Line 175:
* Если создали их вручную - удалите их вручную.
* Если создали их вручную - удалите их вручную.


<div class="mw-translate-fuzzy">
Не забывайте удалять моментальные снимки, иначе скоро у вас возникнут '''проблемы - [[Btrfs#Out_of_space|нехватка места]]'''. Btrfs необходимо некоторое свободное пространство для управления своей работой. Если ваш том заполнен более чем на 85%, то нужно быстро сообразить, что делать.
Не забывайте удалять моментальные снимки, иначе скоро у вас возникнут '''проблемы - [[Btrfs#Out_of_space|нехватка места]]'''. Btrfs необходимо некоторое свободное пространство для управления своей работой. Если ваш том заполнен более чем на 85%, то нужно быстро сообразить, что делать.
* ++++ '''[[Btrfs#Extend_a_volume|Добавить]]''' какой-нибудь раздел/устройство на том.
* ++++ '''[[Btrfs#Extend_a_volume|Добавить]]''' какой-нибудь раздел/устройство на том.
Line 180: Line 181:
* ++ [[Btrfs#Compression_.E2.87.92|Сжать]] ваш том
* ++ [[Btrfs#Compression_.E2.87.92|Сжать]] ваш том
* + '''Удалить''' некоторые файлы (это поможет только в том случае, если они не являются частью '''какого-либо''' моментального снимка)
* + '''Удалить''' некоторые файлы (это поможет только в том случае, если они не являются частью '''какого-либо''' моментального снимка)
</div>


=== Откат к снапшоту ===
=== Откат к снапшоту ===
Line 193: Line 195:
<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 '''90%''' or you will get deep into trouble."}}
{{BoxWarning|Don't forget to delete snapshots before you run out of space|Each time you create a snapshot, you only use the '''rest of the volume''' to save all changes. Eventually, you'll need to free the snapshot. Don't overuse the space. Btrfs needs '''breathing room.''' Don't use more than '''95%''' and leave at least '''5 GB free''', or you'll be in big 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 269: Line 271:
* '''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 -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 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's hard drives (>2TB), it may take a very long time. (e.g. 24 hours or more)}}
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
=== Merging chunks ===
=== Merging chunks ===
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 (> 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.
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 (> 85% full), it is advisable to merge free areas together. This can be done by using balance with a filter.
</div>
</div>


Line 287: Line 289:
=== После смены RAID-уровня ===
=== После смены RAID-уровня ===
При смене RAID-уровня (например, с RAID 0 на RAID 1) автоматического дублирования чанков не происходит. Только при дальнейшей записи btrfs будет учитывать измененный RAID-уровень. Возможно, это не то, что вы хотели. Чтобы завершить преобразование в другой RAID-уровень, вам нужно указать btrfs переписать чанки там, где это необходимо. Это можно сделать с помощью ручной балансировки:
При смене RAID-уровня (например, с RAID 0 на RAID 1) автоматического дублирования чанков не происходит. Только при дальнейшей записи btrfs будет учитывать измененный RAID-уровень. Возможно, это не то, что вы хотели. Чтобы завершить преобразование в другой RAID-уровень, вам нужно указать btrfs переписать чанки там, где это необходимо. Это можно сделать с помощью ручной балансировки:
<div lang="en" dir="ltr" class="mw-content-ltr">
=== Metadata ===
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:
You can check with:
{{RootCmd|command=sudo btrfs fi us /|grep 'Meta.*Size'}}
{{ic|Metadata,RAID1: Size:9.00GiB, Used:6.58GiB (73.09%)}}
* Several GB of metadata are present in your filesystem (''6.6 GB present, 9 GB used'')
* This metadata is poorly distributed (''73%'')
* Significantly more than one full GB could become free (9 GB - 6.6 GB ==> ''2.4 GB could become free'')
The command is then:
{{RootCmd|command=btrfs balance start -musage=95 /}}
Btrfs had to move 9 GB of metadata to free up 1 GB !
{{ic|Metadata,RAID1: Size:8.00GiB, Used:6.58GiB (82.20%)}}
</div>


смотри: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]
смотри: [https://btrfs.readthedocs.io/en/latest/Balance.html btrfs filesystem balance]
Line 326: Line 344:
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
==== Avoid to get out of space with btrfs! ====
==== Avoid to get out of space with btrfs! ====
Don'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.  
Don't skimp on storage space when creating a Btrfs volume. A Btrfs volume should normally be less than 90% full. Then it's recommended to adjust the volume. In an emergency, 95% (plus at least 5 GB free) is fine. However, this isn't beneficial for neither the Btrfs volume nor an SSD.
{{BoxWarning|Don't forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}
{{BoxWarning|Don't forget to include the snapshots in the bill|Manjaro is a rolling release distribution. There will be a lot of changes over time.}}
{{BoxInfo|Tip: Check how close you are to "out of space".| Look at '''Device unallocated:''' (not at ''Free (estimated):'') [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]
{{BoxInfo|Tip: Check how close you are to "out of space".| Look at '''Device unallocated:''' (not at ''Free (estimated):'') [https://forum.manjaro.org/t/could-not-boot-due-to-brfs-no-space-condition-how-should-i-keep-using-btrfs/92922/7 1]
{{RootCmd|command=btrfs filesystem usage /}}
{{RootCmd|command=btrfs filesystem usage /}}
}}
}}
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
=== Get out of jail ===
=== Get out of jail ===
This said, there is an '''easy way out''': Give btrfs more space ;-)
This said, there is an '''easy way out''': Give btrfs more space ;-)
* '''add a (unformatted) partition''' (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}
* '''add a (unformatted) partition''' (for example a fast extern USB-Stick with 8GB) to the btrfs-volume with{{RootCmd|command=btrfs device add /dev/[sdz4] /}}
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! '''Do not boot without it'''. If possible do not reboot at all in this stage! This USB-stick has to stay until '''btrfs device remove''' has '''completed'''.}}
{{BoxDanger|Do NOT remove this USB-Stick|From now on this partition belongs to your volume! '''Do not boot without it'''. If possible do not reboot at all in this stage! This USB-stick has to stay until '''btrfs device remove''' has '''completed'''.}}
* look for old snapshots you don´t need, remove them '''now'''
* look for old snapshots you don´t need, remove them '''now''' (starting with the oldest one)
* '''or delete some files''' you do not need  
* '''or delete some files''' you do not need  
* Do this until your disk will be not more then 95% full
* Do this until your disk will be not more then 95% full (plus 5 GB free space)
</div>
</div>


Line 346: Line 367:
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}
{{BoxSuccess|Tip: Want to watch the volume clean up ?|{{UserCmd|command=pamac install procps-ng}}}}
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}}  
{{BoxSuccess||After that inside a terminal: {{RootCmd|command=watch -n 60 btrfs filesystem usage -h / }}}}  
* If neccesary '''balance''' your volume with a filter(90%) This '''will''' take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}
* If neccesary '''balance''' your volume with a filter(90-95 %) This '''will''' take some more time !{{RootCmd|command=btrfs balance start -dusage=95 /}}
</div>
</div>


8,826

edits