Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung | Nächste Überarbeitung Beide Seiten, nächste Überarbeitung | ||
admin_grundlagen:ssd [2019/01/03 12:10] michael_gisbers |
admin_grundlagen:ssd [2021/12/22 10:31] ingo_wichmann [kontinuierlich freie Bereiche im LVM "trimmen"] |
||
---|---|---|---|
Zeile 115: | Zeile 115: | ||
====== kontinuierlich freie Bereiche im LVM "trimmen" ====== | ====== kontinuierlich freie Bereiche im LVM "trimmen" ====== | ||
- | Beim löschen und verkleinern von Logical Volumes frei werdende Bereiche "trimmen": TODO: warum ist das nicht default? | + | Beim Löschen und verkleinern von Logical Volumes frei werdende Bereiche "trimmen": (( |
+ | warum ist das nicht default? | ||
+ | |||
+ | Aus https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717313 : | ||
+ | "Even with the automatic backups of the lvm metadata, it is impossible to recover from the wrongly removed LV. This is the reason why this feature is off by default." und "The discards commands will also be issued when shrinking or moving a LV to an other PV, if something is going wrong during these operations, the data will be lost. So it's not only when explicitly removing an LV." | ||
+ | |||
+ | Alternative: so ähnlich wie man regelmäßig fstrim aufruft, kann man die leeren Blöcke einer Volume Group behandeln: | ||
+ | |||
+ | <file txt /etc/systemd/system/fstrim.service.d/vg.conf> | ||
+ | [Service] | ||
+ | ExecStart=lvcreate -l100%FREE -n trim your_volume_group | ||
+ | ExecStart=blkdiscard /dev/your_volume_group/trim | ||
+ | ExecStart=lvremove your_volume_group/trim | ||
+ | </file> | ||
+ | )) | ||
<file txt /etc/lvm/lvm.conf> | <file txt /etc/lvm/lvm.conf> | ||
… | … |