a35c94e2d9
Files changed: - kb/concepts/Ambient Environment Dependency.md - kb/concepts/Anti-Cramming Heuristic.md - kb/concepts/Audit Trail.md - kb/concepts/BM25.md - kb/concepts/Bulk Operations.md - kb/concepts/CI Integration.md - kb/concepts/CPPC.md - kb/concepts/Checkpoint Audit.md - kb/concepts/Claude Code Auto Mode.md - kb/concepts/Command Round-Trip Integrity.md - kb/concepts/Confidence Scoring.md - kb/concepts/Consolidation Tiers.md - kb/concepts/Content Quality Control.md - kb/concepts/Context Isolation.md - kb/concepts/Contradiction Resolution.md - kb/concepts/Cross-platform Agent Skills.md - kb/concepts/Crystallization.md - kb/concepts/Delete Rather Than Anonymize.md - kb/concepts/Denylist over Allowlist.md - kb/concepts/Detect-Repair Asymmetry.md - kb/concepts/Diff-Reviewable Agent Edits.md - kb/concepts/Dual Licensing by File Plan.md - kb/concepts/Entity Extraction.md - kb/concepts/Episodic Memory.md - kb/concepts/Event-Driven Automation.md - kb/concepts/Filter on Ingest.md - kb/concepts/Forgetting.md - kb/concepts/Graph Traversal.md - kb/concepts/Green Suite Blind Spot.md - kb/concepts/Hooks.md - kb/concepts/Hybrid Search.md - kb/concepts/Implementation Spectrum.md - kb/concepts/Index Scaling.md - kb/concepts/Issue Label Scheme.md - kb/concepts/Iteration and Cost Limits.md - kb/concepts/KB Migration.md - kb/concepts/KB Stack Versioning.md - kb/concepts/Knowledge Compounding.md - kb/concepts/Knowledge Graph.md - kb/concepts/LLM Wiki Pattern.md - kb/concepts/Lint Workflow.md - kb/concepts/MCP-Leseserver.md - kb/concepts/Mass-Update Gate.md - kb/concepts/Memory Lifecycle.md - kb/concepts/Mesh Sync.md - kb/concepts/Modbus.md - kb/concepts/Multi-Agent Collaboration.md - kb/concepts/Naming Convention Conflict.md - kb/concepts/OKF Compatibility.md - kb/concepts/Optional Instance Context File.md - kb/concepts/Personalization Plane.md - kb/concepts/Privacy and Governance.md - kb/concepts/Procedural Memory.md - kb/concepts/Publish-Remote Gate.md - kb/concepts/Quality Scoring.md - kb/concepts/Quality and Self-Correction.md - kb/concepts/RAG.md - kb/concepts/Reciprocal Rank Fusion.md - kb/concepts/SSD TRIM.md - kb/concepts/Scale Ceiling.md - kb/concepts/Self-Healing.md - kb/concepts/Semantic Lint Automation.md - kb/concepts/Semantic Memory.md - kb/concepts/Session Orientation.md - kb/concepts/Shared vs Private.md - kb/concepts/Split Merge Reclassify.md - kb/concepts/Split Threshold.md - kb/concepts/Structural Enforcement over Documented Rule.md - kb/concepts/Stub Threshold.md - kb/concepts/Supersession.md - kb/concepts/Three-Layer Architecture.md - kb/concepts/Token Economics.md - kb/concepts/Typed Relationships.md - kb/concepts/User Management.md - kb/concepts/Vector Search.md - kb/concepts/Work Coordination.md - kb/concepts/Workflow Extraction.md - kb/concepts/Workflow Orchestration.md - kb/concepts/Working Memory.md - kb/concepts/Write-Once Frontmatter Fields.md - kb/log.md - work/link-taxonomy-migration/glossary.md
5.3 KiB
5.3 KiB
type, concept_type, tags, created, modified, related, sources, confidence, confidence_base, provenance, summary
| type | concept_type | tags | created | modified | related | sources | confidence | confidence_base | provenance | summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| types/concept.md | protocol |
|
2026-07-31 | 2026-08-29 |
|
|
0.90 | 0.90 | sourced | Datenträgerbefehl, mit dem SSDs ungenutzte Blöcke zurückgewinnen - für gleichbleibende Leistung und längere Lebensdauer. |
SSD TRIM
Typ: protocol
Definition
TRIM (oder Discard) ist ein Befehl, der einem Betriebssystem ermöglicht, eine Solid-State Drive (SSD) darüber zu informieren, welche Datenblöcke nicht mehr in Gebrauch sind und intern gelöscht werden können. Dies ist entscheidend für die Erhaltung der SSD-Leistung und Lebensdauer, da es der Garbage Collection der SSD ermöglicht, ungenutzte Blöcke freizugeben.
Kernpunkte
- Zweck: Erhaltung der SSD-Leistung und Verlängerung der Lebensdauer
- Mechanismus: OS benachrichtigt SSD über ungenutzte Blöcke
- Vorteil: Verhindert Schreibverstärkung und Leistungsabbau
- Protokoll: Teil des ATA- und SCSI-Befehlssatzes
Wie TRIM funktioniert
Ohne TRIM
- SSD schreibt Daten in einen Block
- Block wird „belegt"
- Datei wird vom OS gelöscht
- OS markiert Block als „frei", aber SSD weiß das nicht
- Nächster Schreibvorgang erfordert: alte Daten lesen → ändern → löschen → neue Daten schreiben
- Leistung verschlechtert sich im Laufe der Zeit
Mit TRIM
- SSD schreibt Daten in einen Block
- Block wird „belegt"
- Datei wird vom OS gelöscht
- OS sendet TRIM-Befehl: „Block X wird nicht mehr verwendet"
- SSD markiert Block intern als „veraltet"
- Nächster Schreibvorgang: SSD kann direkt in vorgelöschten Block schreiben
- Leistung bleibt konsistent
TRIM unter Linux aktivieren
TRIM-Unterstützung überprüfen
# Check if SSD supports TRIM
lsblk -D | grep -i discard
# Check if filesystem supports TRIM
lsblk -f | grep -i discard
Manuelles TRIM
# Run TRIM manually on a mount point
fstrim /mount/point
# Run TRIM on all mounted filesystems
fstrim -a
# Verbose output
fstrim -v /mount/point
Automatisches TRIM
systemd-Timer (empfohlen):
# Enable weekly TRIM timer
systemctl enable fstrim.timer
systemctl start fstrim.timer
# Check status
systemctl status fstrim.timer
# Manual trigger
systemctl start fstrim.service
Cron-Job (Alternative):
# Add to root's crontab
0 3 * * 0 fstrim -a
TRIM mit Verschlüsselung
Beim Einsatz von Laufwerksverschlüsselung (dm-crypt/LUKS) erfordert TRIM-Unterstützung besondere Aufmerksamkeit wegen Sicherheitsauswirkungen.
Sicherheitsaspekte
Warnung: Das Zulassen von Discard (TRIM) auf verschlüsselten Geräten kann Informationen offenlegen über:
- Welche Blöcke in Gebrauch sind
- Dateisystem-Nutzungsmuster
- Potenziell vertrauliche Metadaten
Optionen für verschlüsselte SSDs
Option 1: Discard auf LUKS-Ebene zulassen
# For new encryption
cryptsetup luksFormat --allow-discards /dev/sdX
# For existing encryption (requires reencryption)
cryptsetup reencrypt --encrypt --reduce-device-size 16M --allow-discards /dev/sdX
Option 2: Periodisches fstrim (Empfohlen für Sicherheit)
# Disable discard in crypttab
# /dev/sdX1 /mnt/crypt ext4 defaults 0 2
# Manually run fstrim after unlocking
fstrim /mnt/crypt
# Or use systemd timer (runs after boot)
systemctl enable fstrim.timer
Option 3: Hybrid-Ansatz
- Discard für unverschlüsselte Metadatenbereiche zulassen
- Periodisches fstrim für Datenbereiche verwenden
TRIM-Status überprüfen
# Check if discard is enabled for device
lsblk -D /dev/sdX
# Check mount options
mount | grep discard
# Check filesystem support
lsblk -o NAME,FSTYPE,DISC-GRAN,DISC-MAX
Dateisystem-Unterstützung
| Dateisystem | TRIM-Unterstützung | Hinweise |
|---|---|---|
| ext4 | Ja | Standard in modernen Kerneln |
| XFS | Ja | Online-Discard unterstützt |
| Btrfs | Ja | Subvolume-fähig |
| NTFS | Ja | Via ntfs-3g |
| FAT32 | Nein | Keine TRIM-Unterstützung |
Leistungsauswirkung
- Ohne TRIM: Leistung kann sich nach längerer Verwendung um 30-50 % verschlechtern
- Mit TRIM: Leistung bleibt nah bei Neu-Niveau
- Overhead: TRIM-Befehle verursachen minimalen Overhead (~1-2%)
Wann zu verwenden
- Immer: Auf SSD-Speichergeräten
- Empfohlen: Auf NVMe-Laufwerken (TRIM ist noch kritischer)
- Erwägen: Auf Hybrid-SSHD-Laufwerken
- Nicht nötig: Auf HDD (rotierenden) Laufwerken
Wann NICHT zu verwenden
- Auf HDD (rotierenden) Laufwerken - kein Nutzen
- In hochsicheren Umgebungen, in denen Informationsverlust inakzeptabel ist (Kompromisse erwägen)
- Auf Dateisystemen, die TRIM nicht unterstützen
Beziehungen
(dm-crypt/LUKS)
- Wirkt sich aus auf: Speicherleistung SSD-gestützter Systeme
Siehe auch
- Source - Arch Linux Cheat Sheet
- https://wiki.archlinux.org/title/Solid_State_Drives
- https://wiki.archlinux.org/title/Dm-crypt/Specialties#Discard/TRIM_support_for_solid_state_drives_(SSD)
Beziehungen
- see-also: LVM
- see-also: Arch Linux