Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:files [2024/04/19 15:07]
cyril [Maintenance]
software:files [2024/05/14 21:43] (current)
cyril [Creation]
Line 25: Line 25:
   * If you want to use LVM and don't need to boot on the disk, not much to do in this section, just remove all the existing partitions with ''gparted'', then go directly to the next one to create the LVM volumes directly on the raw device.   * If you want to use LVM and don't need to boot on the disk, not much to do in this section, just remove all the existing partitions with ''gparted'', then go directly to the next one to create the LVM volumes directly on the raw device.
   * Otherwise, create a ''gpt'' partition table with ''gparted''   * Otherwise, create a ''gpt'' partition table with ''gparted''
-  * If you need to boot on the disk, create the required ''boot'' and ''grub'' partitions with ''gparted''+  * If you need to boot on the disk, with ''gparted'': 
 +    * create the EFI partition: set size around 200-400MB, format it to fat32, set ''boot'' and ''esp'' flags 
 +    * create the boot partition: set size around 300-500MB, format it to ext2 
 +    * mount everything: root partition to /mnt, boot partition to /mnt/boot, efi partition to /mnt/boot/efi, ''mount --bind'' /mnt/{dev,proc,sys}, ''mount -t efivarfs efivarfs /mnt/sys/firmware/efi/efivars'' 
 +    * chroot to the new root: ''chroot /mnt'' 
 +    * install grub''grub-install --root-directory=/ --boot-directory=/boot --efi-directory=/boot/efi --bootloader-id=<os-name>'' 
 +    * you can check the EFI install with ''efibootmgr -v'' (and remove an entry with ''efibootmgr -b <0005> -B'' 
 +    * grub-mkconfig -o /boot/grub/grub.cfg
   * If you want to use LVM, create a single large partition with the remaining space with ''gparted'' to create the LVM volumes on this partition.   * If you want to use LVM, create a single large partition with the remaining space with ''gparted'' to create the LVM volumes on this partition.
   * Otherwise create the required system and data partitions with ''gparted''   * Otherwise create the required system and data partitions with ''gparted''
Line 31: Line 38:
 === LVM === === LVM ===
  
-  * create physical volume: ''pvcreate <device-name>''.+  * create physical volume: ''pvcreate <device-name>'' (device can be the whole device if not a boot device, or a partition).
     * Check with ''pvdisplay'' or ''pvs''.     * Check with ''pvdisplay'' or ''pvs''.
     * if it complains with the error ''Cannot use <device-name>: device is partitioned'', you need to remove existing traces of partition table or filesystem with the command ''wipefs --all <device-name>''      * if it complains with the error ''Cannot use <device-name>: device is partitioned'', you need to remove existing traces of partition table or filesystem with the command ''wipefs --all <device-name>'' 
Line 171: Line 178:
 === Borg Backup === === Borg Backup ===
  
-  * Create a Borg repository in the current folder: <code>borg init -e <encryption> [--append-only]</code>+  * Create a Borg repository in the current folder: <code>borg init -e <encryption> [--append-only] .</code>
     * ''<encryption>'' can be:     * ''<encryption>'' can be:
       * ''none'' to disable it, for instance on an already encrypted volume       * ''none'' to disable it, for instance on an already encrypted volume
Line 178: Line 185:
     * ''--append-only'' means that no data can be removed with borg, archives can only be added. It can be used to protect an online repository against malware.     * ''--append-only'' means that no data can be removed with borg, archives can only be added. It can be used to protect an online repository against malware.
   * 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 --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. 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.     * ''--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''.
Line 186: Line 193:
  
 === Restic === === Restic ===
 +
 +  * Create a Restic repository in the current folder: <code>restic init --repo .</code>
 +    * Note that encryption **and** password are mandatory, [[https://github.com/restic/restic/issues/4326|because]]. However you can store the password in a file in the repository, or use the a password file with ''--password-file''.
 +  * Create snapshots: <code>restic --repo <repo> --verbose --compression auto --ignore-ctime backup <path></code>
 +    * The chunker cannot be configured, contrary to Borg. It is equivalent to [[https://restic.readthedocs.io/en/stable/100_references.html#backups-and-deduplication|19,23]],[[https://restic.net/blog/2015-09-12/restic-foundation1-cdc/|21,512]], similarly to Borg's default [[https://borgbackup.readthedocs.io/en/stable/internals/data-structures.html#buzhash-chunker|19,23,21,4095]], but unlike my chosen values.
 +    * ''--compression'': unlike Borg, there is only choicies ''auto'', ''max'' and ''off''
 +
  
 === BTRFS snapshots === === BTRFS snapshots ===
software/files.1713539242.txt.gz · Last modified: 2024/04/19 15:07 by cyril
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0