During scheduled maintenance on a Linux server that uses an NVMe SSD for its root filesystem, the administrator wants to help the drive's controller reclaim unused flash cells. Which maintenance action should be scripted to run weekly so the operating system informs the drive which logical blocks no longer contain valid data?
Defragment the filesystem to consolidate files
Perform a surface scan with badblocks
Resize the partition to increase free space
Run a TRIM command (for example, fstrim) against the filesystem
Issuing a TRIM command-typically via the fstrim utility or by enabling the discard mount option-sends "discard" hints to the SSD. These hints mark blocks as no longer in use, allowing the controller's garbage-collection logic to erase them in advance. This reduces write-amplification, preserves performance, and extends the flash's program/erase life. Defragmentation adds unnecessary writes, partition resizing only alters layout, and surface scans do not convey discard information.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the trim command and how does it work for SSDs?
Open an interactive chat with Bash
Why is defragmentation harmful to solid-state drives (SSDs)?