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/05/14 21:43]
cyril [Creation]
software:files [2026/04/24 22:23] (current)
cyril
Line 53: Line 53:
  
   * Encrypt the volume/partition/device: ''cryptsetup luksFormat -c aes-xts-plain64 -h sha256 -s 512 <volume-name>''   * Encrypt the volume/partition/device: ''cryptsetup luksFormat -c aes-xts-plain64 -h sha256 -s 512 <volume-name>''
-    * ''<volume-name>>'' is the device or partition name if not using LVM, or ''/dev/mapper/<vgroup-name>-<lvolume-name>'' if using it.+    * ''<volume-name>'' is the device or partition name if not using LVM, or ''/dev/mapper/<vgroup-name>-<lvolume-name>'' if using it.
     * Choose a strong passphrase as it can be brute-forced (at least 80 bits of entropy)     * Choose a strong passphrase as it can be brute-forced (at least 80 bits of entropy)
     * By default it will configure the key derivation take 2 seconds     * By default it will configure the key derivation take 2 seconds
   * Open (decrypt) the volume: ''cryptsetup luksOpen <volume-name> <evolume-name!>''   * Open (decrypt) the volume: ''cryptsetup luksOpen <volume-name> <evolume-name!>''
-  * If using an SSD drive, you probably should enable [[#ssd_trim|TRIM-forwarding]]: ''cryptsetup --allow-discards --persistent refresh <evolume-name>'' (check [[https://wiki.archlinux.org/title/Solid_state_drive#dm-crypt|security implications]] though)+  * If using an SSD drive, you probably should enable [[#ssd_trim|TRIM-forwarding]]: ''cryptsetup --allow-discards --persistent refresh <evolume-name>'' (check [[https://wiki.archlinux.org/title/Solid_state_drive#dm-crypt|security implications]] though). Check with ''cryptsetup luksDump <volume-name>''. If you enabled it by mistake (for instance on a non-SSD), you can disable it with ''cryptsetup --persistent refresh <evolume-name>'' (it resets flags).
  
 === Filesystem === === Filesystem ===
Line 103: Line 103:
     * Create a read-only snapshot: ''btrfs subvolume snapshot -r <input-subvolume-path> <output-snapshot-path>'' (<output-snapshot-path> is typically <input-subvolume-path>/.snapshots/<date>) (just remove ''-r'' for a read-write snapshot).     * Create a read-only snapshot: ''btrfs subvolume snapshot -r <input-subvolume-path> <output-snapshot-path>'' (<output-snapshot-path> is typically <input-subvolume-path>/.snapshots/<date>) (just remove ''-r'' for a read-write snapshot).
     * Delete a snapshot: ''btrfs subvolume delete <snapshot-path>''     * Delete a snapshot: ''btrfs subvolume delete <snapshot-path>''
-    * Analyze snapshot disk usage: ''btrfs quota enable <subvolume>'' and then ''btrfs qgroup show <subvolume>'' [[[https://unix.stackexchange.com/questions/188315/how-to-check-simulate-how-much-space-will-be-freed-after-i-remove-a-btrfs-sub|source]]]+    * Analyze snapshot disk usage
 +      * ''btrfs filesystem du -s <subvolume>'' shows shared and exlusive storage  
 +      * Alternative:''btrfs quota enable <subvolume>'' and then ''btrfs qgroup show <subvolume>'', but enabling quotas makes the FS slower and a bit more unstable [[[https://unix.stackexchange.com/questions/188315/how-to-check-simulate-how-much-space-will-be-freed-after-i-remove-a-btrfs-sub|source]]]
   * ZFS snapshots:   * ZFS snapshots:
     * They can be recursive.     * They can be recursive.
Line 159: Line 161:
  
 === Resizing === === Resizing ===
 +
 +==== Extending ====
 +
 +* Resize the LVM logical volume: ''lvresize -L <absolute-size> <lvolume-name>''
 +  * ''<absolute-size>'' can also be an increment, e.g. ''+50G''
 +* Open the volume with Luks: ''cryptsetup luksOpen <lvolume-name> <evolume-name>''
 +* Resize the filesystem:
 +  * ext4: ''e2fsck -f <evolume-name> ; resize2fs <evolume-name>''
 +  * btrfs: mount the filesystem then ''btrfs filesystem resize max /mnt/<evolume-name>''
 +
 +
 +==== Reducing ====
  
 TODO TODO
Line 191: Line 205:
   * ''borg list <repo>''   * ''borg list <repo>''
   * ''borg info <repo>::<archive>''   * ''borg info <repo>::<archive>''
 +  * ''borg diff <repo>::<archive1> <archive2>''
 +  * ''borg mount <repo>::<archive> <mountpoint>''
 +
  
 === Restic === === Restic ===
Line 199: Line 216:
     * 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.     * 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''     * ''--compression'': unlike Borg, there is only choicies ''auto'', ''max'' and ''off''
 +  * ''restic --repo <repo> snapshots'' to list snapshots
  
  
software/files.1715723006.txt.gz · Last modified: 2024/05/14 21:43 by cyril
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0