Both sides previous revision
Previous revision
Next revision
|
Previous revision
Next revision
Both sides next revision
|
software:files [2024/04/13 15:03] cyril [Tools] borg usage |
software:files [2024/04/19 14:27] cyril [Maintenance] |
| |
* With ''btrfs'': | * With ''btrfs'': |
* ''compsize <subvolume-path>'' in order to get statistics about quantity of compressed files, and compression ratio | * ''compsize <subvolume-path>'' in order to get statistics about quantity of compressed files, and compression ratio. |
| * ''compsize <file-path>'' in order to get compression details about a specific file. |
| |
| === SSD TRIM === |
| |
| * TRIM (or discard) operation means informing the SSD drive about the unused memory, so that it can perform efficiently wear leveling. |
| * Checking TRIM support: run ''lsblk --discard'', and check for non-zero values in columns DISC-GRAN (DISCard GRANularity) and DISC-MAX |
| * Each layer must forward the TRIM commands to the layer above, until it reaches the drive: |
| * dm-crypt. Depending on how the encrypted volume is mounted, different possibilities: |
| * ''cryptsetup <...> --allow-discards'' |
| * set option ''discard'' in ''/etc/crypttab'' |
| * set option ''cryptdevice=<device>:root:allow-discards'' in kernel parameters for root partition |
| * LVM |
| * Two options are available: |
| * Continuous TRIM, i.e. configuring the filesystem to notify instantly each block that is freed. |
| * It is not advised because can cause issues. |
| * Periodic TRIM, i.e. explicitly notifying the free blocks periodically. |
| * Using the ''fstrim'' utils from the util-linux package. |
| |
| |
| Source : https://wiki.archlinux.org/title/Solid_state_drive |
| |
=== Resizing === | === Resizing === |
* Create archives: <code>borg create <repo>::<!archive> <path> --stats --progress | * Create archives: <code>borg create <repo>::<!archive> <path> --stats --progress |
--compression auto,zstd,12 --chunker-params 15,23,19,4095 --noatime --noctime -x --exclude-caches</code> | --compression auto,zstd,12 --chunker-params 15,23,19,4095 --noatime --noctime -x --exclude-caches</code> |
* ''--compression'': it can make sense to adjust the compression level depending on your computer speed and your storage speed, so that compression does not slow down the backup, but still save as much space as possible under this constraint. You have roughly the choice between LZ4 (very quick), LZMA (very high compression ratio), and ZSTD (wide-range) in between. | * ''--compression'': it can make sense to adjust the compression level depending on your computer speed and your storage speed, so that compression does not slow down the backup, but still save as much space as possible under this constraint. However it is not always easy to find an universal value (data that compress very well are mostly limited by the input storage speed, while data that compress less well are mostly limited by the output storage speed). You have roughly the choice between LZ4 (very quick), LZMA (very high compression ratio), and ZSTD (wide-range) in between. |
* ''--chunker-params'': this is also an important but a bit complicated tuning. Originally default value was creating small chunks causing huge cache and memory usage, so they switched to much larger chunks, but which can be too large for some applications (for instance when modifying only metadata of an image file, we want to deduplicate the data), so I came with this compromise ''15,23,19,4095''. | * ''--chunker-params'': this is also an important but a bit complicated tuning. Originally default value was creating small chunks causing huge cache and memory usage, so they switched to much larger chunks, but which can be too large for some applications (for instance when modifying only metadata of an image file, we want to deduplicate the data), so I came with this compromise ''15,23,19,4095''. |
* ''borg info <repo>'' | * ''borg info <repo>'' |
| |
| |
| |
| ===== Container files ===== |
| |
| Sources: |
| * [[https://serverfault.com/questions/696554/creating-a-grow-on-demand-encrypted-volume-with-luks|Excellent demonstration]] for creating a growing container file with LUKS and EXT4 using sparse files. |
| |
===== Digital Will ===== | ===== Digital Will ===== |