Questions tagged [trim]

The trim command is only used on SSDs (Solid State Drives); it must be supported by the host OS as that informs the drive to perform safe 'garbage collection' on blocks of data that are unused and so can be wiped.

Filter by
Sorted by
Tagged with
7 votes
1 answer
503 views

What's the difference between '/sbin/fstrim' and '/sbin/zpool trim [pool]' which trim ZFS pools?

I'm running Ubuntu 19.10 on ZFS and all works good. I know that Ubuntu has fstrim scheduled on a weekly basis by default but ZFS also supports trim through '/sbin/zpool trim [pool]'. What's the ...
8 votes
1 answer
2k views

How to know if my NVMe SSD needs TRIM

Running Ubuntu 22.04 on my main laptop. I am using 4TB TEAMGROUP MP34 NVMe as my main drive. The file system is ext4. Yesterday (Nov 16), while downloading some large files (about 300 files, 600GB ...
2 votes
1 answer
106 views

`fstrim` service reports strange values

I have two SSD disks on my system and three filesystems: $ lsblk | grep -v '^loop' NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 465.8G 0 disk /home sdb 8:16 0 238.5G 0 disk ...
3 votes
1 answer
2k views

Large amount of data trimmed after running fstrim

Each time after I restart my computer I run fstrim. And each time this is the output I receive: emil@emil-Lenovo-G580 ~> sudo fstrim -v / [sudo] password for emil: /: 84.2 GiB (90372820992 bytes) ...
1 vote
1 answer
5k views

Installing Ubuntu 18.04 on NVMe SSD and using SATA SSD for storage

I'm building a deep learning desktop and will be using Ubuntu 18.04. I currently have a Crucial MX500 2TB SATA SSD. I may get a Samsung 970 NVMe SSD to install the system on for faster loading (if ...
4 votes
0 answers
811 views

System hangs/breaks when fstrim runs (dual boot on SSD setup)

I have a Windows 10 / Kubuntu 22.04 dual boot setup with both OS partitions on the same SSD drive. Every week fstrim.timer triggers fstrim.service to run in background and as a result my system "...
4 votes
1 answer
13k views

fstrim fails with "thediscard operation is not supported"

I am running ubuntu 18.04. No lvm or encryption. I am attempting to run trim on a brand new external sdd, western digital wd green 120 gb in a usb external case ADATA ED600 that shows trim available ...
9 votes
2 answers
23k views

TRIM on an encrypted SSD

wiki.ubuntuusers.de says if I want to use TRIM on an encrypted SSD, I need at least cryptsetup 1.4 and kernel 3.1. Do I need this, when creating the partitions and setting up encryption, or is ...
1 vote
1 answer
4k views

Can I enable TRIM for SD card as if it was a SSD?

I have two old laptops that run Ubuntu / Arch (I am not an expert linux user, just learning), and they have: 1) 1.8 inches hard drive with a (flat thin) ZIF connector. 2) 2.5 inches IDE hard drive. ...
3 votes
2 answers
3k views

fstrim not supported on USB flashdrive?

Not sure this has already been properly sorted (but I am a noob) New install of 14.04 server installed on a brand new SanDisk 16Gb USB stick mounted on the internal USB connector of a HP Proliant ...
4 votes
1 answer
362 views

How to get on ubuntu terminal a progressbar for fstrim

Sometime if you run the follow on terminal, it can take some time, depend on the space which will be trimmed. sudo fstrim -v / How to get a progressbar for this. Result of my research: Progressbar ...
9 votes
3 answers
7k views

Does TRIM work with FAT32?

I used this WebUpd8 guide to help me trim my SSD on Ubuntu 13.10. The guide says that you must make sure the partition(s) are EXT4 or BTRFS. Unfortunately, I stupidly assumed the HD was formatted to ...
5 votes
1 answer
3k views

Error message enabling fstrim.service

I have been running Ubuntu 20.04 desktop since last February. Today I issued sudo systemctl enable fstrim.service and I got this message: The unit files have no installation config (WantedBy=, ...
75 votes
6 answers
67k views

What is the recommended way to empty a SSD?

I've just received my new SSD since the old one died. This Intel 320 SSD supports TRIM. For testing purposes, my dealer put Windows on it, but I want to get rid of this and install Kubuntu on it. It ...
2 votes
0 answers
5k views

Unsure about TRIM enabled on my SSD

I have a SSD OCZ Vertex4 installed on my laptop. I'm running Ubuntu 12.04 LTS. I have enable TRIM by adding "discard" to my fstab file. (also added option noatime). I rebooted my Ubuntu and ...
1 vote
0 answers
492 views

Is it safe tu turn off fstrim service because of possible data loss due to fstrim

So, on one of our servers (and we have 154), we saw this log entry: Feb 21 00:00:03 vps-442 fstrim[3162507]: /boot/efi: 97.8 MiB (102542848 bytes) trimmed on /dev/sda15 Feb 21 00:00:03 vps-442 fstrim[...
9 votes
5 answers
16k views

Trim and SSD with USB 3.0 enclosure does not work - UASP not supported?

I have installed one SSD disk (Micron C400-MTFDDAC128MAM) in an external USB 3.0 enclosure. Now I want use this disk as a second disk in my laptop with Ubuntu 12.04. The disk is working, but I want to ...
1 vote
0 answers
941 views

Changing SATA Mode from RST to AHCI, impact on TRIM?

So, I've bought a laptop, and I have windows installed on the SSD and I wanna install Ubuntu 20.04 on the HDD. The Linux installer presented an error "This computer uses Intel RST (Rapid Storage ...
9 votes
1 answer
9k views

No SSD TRIM script in Ubuntu 20.04 LTS

I figured out that there is no fstrim script in /etc/cron.weekly. I've read that TRIM is automatically enabled for SAMSUNG SSD. I'm using Ubuntu 20.04 LTS and there is no fstrim script in all cron ...
2 votes
1 answer
920 views

Is it normal to have HDD fstrimed?

I have heavy boot issues on my new setting (more than 10 min to boot). While investigating, I found that: $ journalctl -u fstrim -- Reboot -- déc. 05 10:31:09 orphu systemd[1]: Starting Discard unused ...
72 votes
2 answers
69k views

Is TRIM enabled on my Ubuntu 18.04 installation?

I know that weekly TRIM is enabled by default from 14.10 onwards. Source: How to enable TRIM? But running sudo nano /etc/cron.weekly/fstrim returns an empty file. Also tail -n1 /etc/cron.weekly/fstrim ...
2 votes
4 answers
8k views

Can Ubuntu TRIM another (NTFS) partition?

I have three questions for Ubuntu and TRIM/SSD experts. I've got SSD drive (SanDisk SDSSDP128G 128Gb). Currently, it is the only hard drive. Connected via SATA cable however in BIOS using IDE mode ...
3 votes
1 answer
2k views

What is so dangerous about --trim-sector-ranges?

I have an SSD that I want to TRIM before installing Ubuntu on it. It has been suggested to me, that I leave some unpartitioned space, such that the wear leveling will have free blocks to work with. ...
9 votes
1 answer
9k views

How to run fstrim -a regularly automatically?

I noticed that manual seldom invocations of fstrim -av take a lot of time (over 10 minutes) and report a lot of free space to the SSD: # /usr/bin/time -p fstrim -av /boot/efi: 503,2 MiB (527671296 ...
7 votes
1 answer
5k views

fstrim is taking too long

I'm running Ubuntu 13.10. I'm running manual SSD TRIM fstrim -v /, and it's added to my /etc/rc.local. Recently I realized that the command is taking too long to finish execution. It finishes after I ...
1 vote
0 answers
199 views

large amount of data TRIMMed on SSD

I just recently set up a new PC with an SSD/HDD combo; my Linux partition on my SSD is mounted as / with /home mounted on my HDD. I have the noatime and discard flags set for my SSD in /etc/fstab, ...
0 votes
1 answer
85 views

TRIM for SSD in 14.04

I have 4 partitions in Trusty: on the SSD there are 3: 'boot/EFI', Swap & one mounted at / which contains all other directories except /home. On the HDD there is one mounted at /home containing /...
13 votes
1 answer
23k views

Should I turn on zfs-trim on my pools or should I trim on a schedule using systemd timers or cron?

I run Ubuntu 19.10 installed on ZFS through the new ZFS install option on 19.10. This is on a Thinkpad X1 Carbon 7th which is in heavy daily use. No dualboot so it's Ubuntu all the time. The laptop ...
10 votes
1 answer
5k views

fstrim on external SSD drives don't work

I have two external USB 3.0 SSD drives from Samsung (one is Model T1, other T3). I would like to trim them with my Ubuntu 16.04.1 LTS. While doing that I receive a error message. Here an example: ...
1 vote
1 answer
699 views

No trim necessary or possible on a Ubuntu 19.10 with ZFS?

I've installed 19.10 with ZFS on one of my laptops because I want to learn the file system and under the impression it's "the file system of the future" (let's not discuss that here). Since I'm new ...
3 votes
1 answer
3k views

TRIM on Samsung NVMe

Not sure if I properly unterstand they way TRIM on SSD is supposed to work. According to lspci I've got the following device: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981. It shows up as ...
2 votes
1 answer
548 views

Enable TRIM on secondary, encrypted ssd

I have a smaller, LUKS-encrypted ssd. I want to help get longevity if I can. I'm not sure how TRIM comes into play for an encrypted drive. I've looked at this Q&A on TRIM, and my main drive is ...
3 votes
1 answer
7k views

How to properly TRIM an ssd (18.04)

I want to do what follows: set (via systemctl) a trim timer which would trim more than once a week but less than daily. Say every three days. I want to be sure that if the system is turned off or ...
201 votes
2 answers
231k views

How to enable TRIM?

I know that the Linux kernel supports TRIM as of version 2.6.33, so there should be TRIM support in ubuntu. Is TRIM enabled by default or do I need to change some settings or install additional ...
6 votes
3 answers
10k views

A command which checks that trim is working?

I have installed Ubuntu 14.04 LTS 64bit, and would like to make sure that TRIM is enabled (as much as I know - it is enabled by default). Is there some sort of command which would help me to find out ...
9 votes
1 answer
22k views

On ubuntu 14.04 how do you check if TRIM is on for an SSD drive

On ubuntu 14.04 how do you check if TRIM is on for an SSD drive? Other settings worth verifying for an SSD drive?
21 votes
4 answers
27k views

Ubuntu SSD - Was fast, is now extremely slow

This is what I'm getting now, with a Crucial MX300 750GB SSD (with latest firmware [there are no firmware updates yet]). lptp [ blah ]: sudo hdparm -Tt /dev/sda /dev/sda: Timing cached reads: ...
4 votes
1 answer
3k views

Why does Ubuntu enable TRIM for certain brands only?

So I've been reading that for SSDs, weekly TRIM is enabled by default only for some brands like Samsung and Intel,but not others like Hynix. What's the rationale for this? Should I not enable TRIM on ...
1 vote
0 answers
2k views

Trim supports for Kington SSD is in default or not? [duplicate]

I have just installed Ubuntu 17.10 on a Kington SSD. I heard that Ubuntu enables Trim by default, but it is only for some brands like Intel and Samsung while Sandisk and Kingston are not included in ...
3 votes
1 answer
6k views

Are features like Trim for SSD's Included for 16.04?

I am new to Ubuntu and I am wondering what to do for Sandisk SSDs? Questions I have looked up are from many years ago and I am wondering if things like Trim are now included in 16.04 and I should not ...
2 votes
0 answers
455 views

Full disk encryption with SSD

I'm about to reinstall Ubuntu 14.04 on my laptop. If I use full encryption, which I desire, how will this impact performance of the SSD and FSTRIM? Will I still be able to use it or will it be ...
7 votes
1 answer
2k views

Why does fstrim not seem to be thorough?

I tried the command fstrim to manually TRIM my SSD drive, i.e. to discard unused blocks. I know this is done automatically by a weekly cronjob, but I wanted to try it myself once. However, running ...
5 votes
0 answers
1k views

fstrim for SSD in Ubuntu 15.04, --no-model-check no longer necessary?

I have SSD on my computer. before when I use Ubuntu I always do : sudo nano /etc/cron.weekly/fstrim And add this command: exec fstrim-all --no-model-check The description in this file states that ...
4 votes
1 answer
7k views

Where can the last FSTrim be seen as successful or not? (log files)

I recently installed an SSD and AFAIK Ubuntu makes a weekly FSTrim on SSD's that support it. Is there a log file of this trims?
1 vote
1 answer
893 views

How to use TRIM on encrypted home folder

I've installed Ubuntu 16.04 LTS. During the installation, I've checked 'encrypted home' but home folder is in the same partition as the root (i.e in '/'). I know that the usage of TRIM on LUKS devices ...
4 votes
1 answer
1k views

SSD features (rotational/discard) not detected properly via USB

I am using Ubuntu 16.04 on a Thinkpad W520, with kernel 4.10.0-20-generic (hwe-edge). I have two SSD drives: a flash USB 3.0 stick, and a SATA Samsung 850 EVO SSD. When I connect them to USB (the ...
0 votes
1 answer
3k views

Can I use a Samsung 840 EVO with Ubuntu 16.04?

From some internet research, it looks like the TRIM command has bugs with the Samsung 8 series SSDs. I don't know if this info is still current or if it was specific to 14.04. Can I use the 840 as my ...
5 votes
1 answer
8k views

On Ubuntu 16.04, with Samsung 850 EVO SSD, is any post configuration needed?

The Samsung Evo 850 http://www.samsung.com/semiconductor/minisite/ssd/product/consumer/850evo.html The following post suggests that with Ubuntu 16.04 and the 850 EVO, TRIM is enabled by default. ...
0 votes
1 answer
574 views

Run e2fsck automatically to fix all errors during boot with Samsung SSD 850 EVO 500GB

Almost each time that I switch from Windows 10 to Ubuntu 16.10 which I installed on a dual boot laptop Ubuntu wants me to e2fsck -b 32768 /dev/sdb5 Can I automate this during startup? If yes, how? ...
1 vote
1 answer
347 views

TRIM on encrypted device with Precise

I have migrated the main data to a new SSD. (Samsung 840 EVO, 120GB.) My ~ is an encrypted partition automounted by pam_mount. That is, there is a record in /etc/security/pam_mount.conf.xml for this ...