Questions tagged [fstrim]

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

27 questions
13
votes
4 answers

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/root /proc/mounts /dev/mapper/root / ext4…
Martin Vegter
  • 69
  • 66
  • 195
  • 326
11
votes
1 answer

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 bytes) trimmed /: 56.5 GiB (60672704512 bytes)…
NefariousOctopus
  • 491
  • 6
  • 22
9
votes
3 answers

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, but after switching the disk from VirtIO to…
sourcejedi
  • 48,311
  • 17
  • 143
  • 296
7
votes
3 answers

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. Is there any other way I can do it? Any help is…
Yong zhu
  • 71
  • 1
  • 2
6
votes
2 answers

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. At first step, I tried to simply run sudo…
mattia.b89
  • 3,142
  • 2
  • 14
  • 39
5
votes
1 answer

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 data blocks on such volume - why? Below you can see…
Marcus
  • 869
  • 2
  • 8
  • 22
4
votes
1 answer

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 the file system informs an SSD when a block is not…
Philip Couling
  • 17,591
  • 5
  • 42
  • 82
3
votes
1 answer

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. My /etc/crypttab contains cryptroot …
user224348
  • 406
  • 5
  • 12
3
votes
2 answers

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 rabbitcruncher systemd[1]: Starting Discard…
kipp
  • 33
  • 3
3
votes
1 answer

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 the second volume file system is stored with a…
ayvango
  • 367
  • 2
  • 9
2
votes
1 answer

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] ├─crypt-root lvm / └─crypt-home …
BiagioF
  • 141
  • 5
2
votes
0 answers

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 ├─sda1 100M vfat /boot/efi …
ajgringo619
  • 3,113
  • 1
  • 11
  • 37
2
votes
1 answer

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 (xxG was the empty space available) to clean out deleted…
lmoly
  • 407
  • 1
  • 4
  • 12
2
votes
0 answers

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 fstrim /path/to/fs and log everything with…
Curly060
  • 21
  • 3
2
votes
1 answer

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 of that drive, a drive which, unfortunately does…
MJiller
  • 381
  • 2
  • 13
1
2