Skip to main content

Questions tagged [fstrim]

A tool that "trims" (discards) the unused blocks in a filesystem. It is part of util-linux suite.

Filter by
Sorted by
Tagged with
1 vote
1 answer
197 views

fstrim doesn't appear to have any timers, how do I make sure it works?

"The util-linux package provides fstrim.service and fstrim.timer systemd unit files. Enabling the timer will activate the service weekly. The service executes fstrim(8) on all mounted filesystems ...
AlphaCentauri's user avatar
0 votes
0 answers
274 views

How do fstrim and BTRFS SSD optimizations work for both SSD's in a RAID1?

First apologies if this has been asked before, but I could not find any link with any combination of keywords. My question is - How do SSD optimisations work in BTRFS in a RAID1 where both devices are ...
Vijay Gill's user avatar
2 votes
1 answer
736 views

Disable allow-discards on encrypted partition

I have the following partition table: NAME nvme0n1 ├─nvme0n1p1 part /boot └─nvme0n1p2 part └─crypt crypt ├─crypt-swap lvm [SWAP] ├...
BiagioF's user avatar
  • 151
1 vote
1 answer
1k views

fstrim: /: FITRIM ioctl failed: Structure needs cleaning

On my Debian sid with custom 5.17.0-rc1 kernel installed on my new (< 1 month) SSD nvme WD SN850 my root partition is formatted as f2fs(v 1.14) I get fstrim: /: FITRIM ioctl failed: Structure needs ...
Jean Molinier's user avatar
1 vote
1 answer
2k views

How to disable TRIM on SSD(s) under Linux Mint?

I rarely ever write anything (large) to SSDs on many machines of my own, an example could be the use of one laptop as a TV viewer only, another my mother's laptop, which she uses just for banking. (If ...
Vlastimil Burián's user avatar
1 vote
0 answers
409 views

LVM SSD cachepool how to trim (Debian 10)

I was playing with LVM and I was setting up a volume with ext4 on an HDD and I want to use an SSD as a cache. What I first done was lvcreate --type cache-pool -l 100%FREE -n datacache SSD /dev/sda3 ...
Ruggero's user avatar
  • 11
1 vote
1 answer
356 views

fstrim.service blocks trim of /home in Ubuntu/Mint v20, but not in v18

In troubleshooting why my /home partition (ext4, luks-encrypted) wasn't being trimmed by the weekly fstrim service, I discovered that Ubuntu made a major change in the service file: On Ubuntu/Mint 18 [...
ajgringo619's user avatar
  • 3,384
-1 votes
1 answer
4k views

"systemctl start fstrim.timer" for ssd optimization not working on Debian 10

i just installed a 1TB kingston SSD, i cloned my HDD (with Debian 10) so nothing changed besides the performance, i want to set up TRIM for this SSD. So i've done this: $ sudo hdparm -I /dev/sda | ...
Marco's user avatar
  • 3
2 votes
0 answers
162 views

Does Linux fstrim.service conflict with Windows 10 optimization?

I have the following disk setup, a dual-boot with Windows 10 and Linux Mint 19.3: NAME LABEL SIZE FSTYPE MOUNTPOINT UUID sda 477G ...
ajgringo619's user avatar
  • 3,384
4 votes
1 answer
585 views

How does fstrim interact with dd

I'd like to understand the interaction between fstrim and a file system driver (such as ext4). More precisely I'd like to understand whether dd interfere with this. I've queried elsewhere about how ...
Philip Couling's user avatar
8 votes
3 answers
5k views

How do I check if my ssd supports fstrim?

I'm working with a linux server and wanted to know if there is a way that I can find out that my SSD supports fstrim or not. I tried hdparm -I /dev/sda, but it's not available and I can't install it. ...
Yong zhu's user avatar
3 votes
1 answer
7k views

How to enable discards on encrypted root

I have installed system on ext4 filesystem on lvm (vg name encrypted, root is called encrypted-root) on luks. When I'm trying to run fstrim /, I get fstrim: /: the discard operation is not supported. ...
user224348's user avatar
2 votes
1 answer
1k views

Does fstrim have the same effect as overwriting the disk space with zeros?

I create compressed backup images using dd and lzop on a regular basis. In the past I've created a large file beforehand with zeros using head -c xxG /dev/zero > zeros.tmp && rm zeros.tmp (...
lmoly's user avatar
  • 407
0 votes
1 answer
224 views

How/why did fstrim trim more space than I have free?

How/why did fstrim trim more space than I have free? $ df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/drystone_2019-debian 93G 84G 4.6G 95% / $ sudo ...
sourcejedi's user avatar
9 votes
3 answers
8k views

Does VirtIO storage support discard (fstrim)?

$ uname -r 5.0.9-301.fc30.x86_64 $ findmnt / TARGET SOURCE FSTYPE OPTIONS / /dev/vda3 ext4 rw,relatime,seclabel $ sudo fstrim -v / fstrim: /: the discard operation is not supported Same VM, ...
sourcejedi's user avatar
2 votes
0 answers
215 views

Find all blocks on device not used by the filesystem

How can I list all blocks on a device that are currently not being used by the filesystem? The filesystem in question is a btrfs RAID1 with two LUKS encrypted harddrives an Arch Linux. I have tried ...
Curly060's user avatar
3 votes
2 answers
3k views

nvme fstrim causing crash on linux, disabling with systemctl doesn't help

I have a Linux (Ubuntu 18, kernel 4.15) desktop booting from an M2 nvme disk. Once a week, it will crash around midnight. The relevant log file output from /var/log/syslog.* is below: Jul 16 00:00:00 ...
kipp's user avatar
  • 33
-1 votes
1 answer
280 views

Fstrim version and usage [closed]

I have one fstrim executable file and need a way of finding that executable file version.
user256935's user avatar
1 vote
0 answers
651 views

How does fstrim keep finding bytes to trim on a Xen PV dom0?

I have a Xen PV node running RHEL6 on the 3.10 kernel. This node has mdadm RAID1 and the following partitions: [root@node ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/md1 ...
Elliot B.'s user avatar
  • 203
2 votes
1 answer
3k views

Sensible mount options for SSD that does not support trim?

I've got an older SSD drive in a secondary computer (operating system is Void Linux, ext 4 file system, no swap) that doesn't see a whole lot of use. I want to take reasonable steps to extend the life ...
MJiller's user avatar
  • 381
1 vote
1 answer
480 views

SSD: trim on different filesystems

Some days ago I've bought an SSD: Samsung 850 EVO 250 GB; on this drive I made two 125 GB partitions: on the first partition I installed Windows 7 on NTFS; on the second partition I installed Haiku (...
Giova84's user avatar
  • 11
14 votes
4 answers
4k views

independently verify that TRIM indeed works on SSD

I have a LUKS partition /dev/sda1 which I luksOpen with --allow-discards: cryptsetup --allow-discards luksOpen /dev/sda1 root I then mount the ext4 filesystem with discard option: grep /dev/mapper/...
Martin Vegter's user avatar
5 votes
1 answer
3k views

Why fstrim appears not to trim data blocks on btrfs (+ecrypts)?

I have an SSD disk with several partitions. One of them is has a btrfs volume, mounted as /home, which holds an ecryptfs home directory. When I trim the volumes, it seems that fstrim doesn't trim ...
Marcus's user avatar
  • 961
11 votes
1 answer
7k views

fstrim doesn't seem to trim a partition that uses lvm and dm-crypt

I try to setup Fedora 25 with dm-crypt and LVM, but struggle to make TRIM work. $ sudo fstrim -av /boot: 28.6 MiB (30003200 ...
NefariousOctopus's user avatar
3 votes
1 answer
1k views

How to perform fstrim on a loop device?

I have LVM with thin-provisioning enabled. I have two almost identical thin logical volumes with ext4 file systems that slightly differs. The first volume is used entirely for storing file system. On ...
ayvango's user avatar
  • 377
7 votes
2 answers
32k views

How do I check TRIM?

I have Linux installed on a Dell XPS 9343 with an Samsung PM851 SSD. I recently read that many SSDs don't support TRIM operations. So I'd like to check if discard option effectively works on my system....
mattia.b89's user avatar
  • 3,268
1 vote
1 answer
695 views

fstrim cronjob not working on Linux Mint 17.2

My /etc/cron.daily/fstrim looks like this: #!/bin/sh # call fstrim-all to trim all mounted file systems which support it set -e # This only runs on Intel and Samsung SSDs by default, as some SSDs ...
KingOfTheMountain's user avatar
2 votes
1 answer
7k views

fstrim "the discard operation is not supported" with ext4 on LVM

Attempting to run fstrim on my root partition (which is ext4 on a LVM logical volume, single physical volume—an SSD supporting TRIM) produces an error: fstrim -v / fstrim: /: the discard operation is ...
derobert's user avatar
  • 110k