As of May 31, 2023, we have updated our Code of Conduct.

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
-2 votes
0 answers
39 views

FSTRIM for USB-SSD boot drive [migrated]

I would put my Ubuntu 22.04 NVME disk into this USB 3.2 20Gbps M.2 NVMe SSD Enclosure and boot it from a USB 3.2x2 port. I know that a SSD needs to be trimmed by FSTRIM, but I also read that ...
Antonio Petricca's user avatar
2 votes
0 answers
278 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 "...
Ahmet Sait's user avatar
3 votes
1 answer
176 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 ...
Alfred.37's user avatar
  • 257
3 votes
1 answer
1k 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=, ...
RTC222's user avatar
  • 213
0 votes
0 answers
291 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[...
Aleksandar Pavić's user avatar
0 votes
0 answers
818 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 ...
digolira2's user avatar
  • 133
7 votes
1 answer
8k 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 ...
Johnnii360's user avatar
1 vote
1 answer
634 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 ...
yota's user avatar
  • 141
6 votes
1 answer
6k 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 ...
user avatar
10 votes
1 answer
19k 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 ...
Christian's user avatar
  • 1,631
2 votes
0 answers
349 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 ...
Christian's user avatar
  • 1,631
0 votes
1 answer
673 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 ...
Christian's user avatar
  • 1,631
2 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 ...
Thomas's user avatar
  • 51
1 vote
1 answer
447 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 ...
listenlight's user avatar
0 votes
1 answer
4k 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 ...
d84_n1nj4's user avatar
  • 101
2 votes
1 answer
6k 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 ...
MadHatter's user avatar
  • 431
4 votes
1 answer
9k 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 ...
vidyadhara buddhiraju's user avatar
69 votes
2 answers
66k 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 ...
m.umar's user avatar
  • 805
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 ...
Sina Madani's user avatar
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 ...
joeubuntu's user avatar
  • 143
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 ...
Juraj Oršulić's user avatar
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 ...
Lenny's user avatar
  • 51
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 ...
griest's user avatar
  • 103
0 votes
1 answer
535 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? ...
Michael S.'s user avatar
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. ...
Jonathan Gallagher's user avatar
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: ...
Luckyrings's user avatar
21 votes
4 answers
24k 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: ...
d0c_s4vage's user avatar
1 vote
1 answer
212 views

How do I disable Trim so I may have a shot at recovering a doc on my SSD?

I had a libre document that autosaved when my computer shut off unexpectedly. Later someone exited from it and hit don't save. I checked the backup folder located in .config/libreoffice/4/user/backup ...
user588641's user avatar
0 votes
1 answer
81 views

Notebook with two hard disk (SSD and mechanical)

I have a Notebook with two hard disk (one SSD and other mechanical). How can I divide partition? I think swap could go on mechanical one. Will Ubuntu see that one is SSD and other no? I know SSD has ...
Teo's user avatar
  • 41
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 ...
Byte Commander's user avatar
  • 105k
0 votes
1 answer
880 views

LVM encrypted LUKS on SSD - issue reverting to snapshots

Ubuntu 14.04.4 LTS SSD is only drive (/dev/sda) /dev/sda1 is boot partition /dev/sda5 is encrypted LUKS partition logical volumes sit on top of the LUKS partition Reverting to snapshots seems to work ...
jub's user avatar
  • 141
1 vote
1 answer
832 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 ...
kmotoko's user avatar
  • 148
1 vote
1 answer
3k 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. ...
AlexN's user avatar
  • 383
0 votes
1 answer
578 views

Very large TRIM amounts

Something is wrong with my system setup on SSD. During the installation of Ubuntu 14.04 I selected "use entire disc" for my 256 GB SSD. Now after reload fstrim shows 200 GB trimmed and just after ...
Gerolf's user avatar
  • 21
2 votes
1 answer
1k 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) ...
Emil Zahariev's user avatar
1 vote
0 answers
46 views

I Keep Getting DIfferent Large Numbers When Trimming SSD

Each time I type the command "sudo fstrim / -v", I keep getting large numbers like 9 digits. It should say 0, since I haven't deleted anything? Are my deleted files actually trimmed? Blossom
The Powerpuff Girls's user avatar
2 votes
0 answers
800 views

Ubuntu 14.04 installed on Samsung 850 Pro 512GB results in data corruption [duplicate]

In short: Does anybody know why running Ubuntu 14.04.3 LTS on Samsung 850 Pro 512GB drive results in corrupted file system and random files disappearing? Here is the long story: In 2013 I got ...
Svetoslav Trochev's user avatar
1 vote
0 answers
387 views

14.04 LTS Trim problem on an SSD

I own a Lenovo laptop with an M.2 NGFF slot. I put a 128 GB ZTC SSD card. This card is GPT partitioned and seen as sdb. I use it for the / which is EXT4 formated. Then I did a fresh install of Ubuntu ...
GeorgesGiralt's user avatar
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. ...
kasperd's user avatar
  • 1,659
1 vote
0 answers
303 views

SSD - Trim - trimmed a lot of data

I have a Xubuntu distribution and a new SSD (Plextor 128GB) Partitions scheme: 16GB / 52GB home rest free Every day Cron runs script: #!/bin/sh LOG=/var/log/trim.log echo "*** $(date -R) ***" >...
Jarek's user avatar
  • 11
0 votes
1 answer
2k views

How is trim enabled in Ubuntu 15.04? [duplicate]

Does it work once a week or does it continually trim the system? I have seen answers for this but they refer to Ubuntu 14.04 but not to Ubuntu 15.04
Ervin Dine's user avatar
4 votes
1 answer
6k 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?
userDepth's user avatar
  • 1,940
0 votes
1 answer
643 views

TRIMming shared partition in dual-boot on SSD

In a couple of days, I'm going to buy a new notebook (Asus N551, should it matter), tending to replace the HDD with a Samsung EVO 500GB SSD. I'll set it up in a dual-boot configuration of Windows 8/...
haemi's user avatar
  • 187
2 votes
2 answers
6k views

Disable TRIM to avoid file system corruption

I read the following article on a problem with TRIM and Samsumg. I am running Ubuntu 14.04.1 and I have a Samsung PRO 850 of 250GB. I am worried to get my file system damaged due to same firmware ...
Simone Pernice's user avatar
3 votes
0 answers
3k views

Samsung SSD, TRIM and Ubuntu 15.04

In light of a recent issue raised in regards to Samsung SSD firmware relating to TRIM and the related launchpad bugs for Ubuntu.. Bug# 1465663 'libata Samsung SSD 8 series TRIM blacklist' and the ...
Parrameister's user avatar
0 votes
1 answer
262 views

About TRIM command execution

I have some question about TRIM command for SSDs. First of all, mounting partitions with discard option vs. trim in crontab. I'm aware discard option forces immediate trim after every single file ...
MadHatter's user avatar
  • 431
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 ...
joks's user avatar
  • 51
2 votes
1 answer
413 views

Is it possible to use a dedicated parity drive without striping?

I'm setting up a log server. I'd like to set them up so that each disk is independent of the next, but the last disk is parity of all the rest. The reason why I want this is because: You can't enable ...
Joseph Odell's user avatar
1 vote
1 answer
336 views

Ubuntu 14.10 does trim SSD RAID 0 discs?

I've got Ubuntu 14.10 in a RAID 0 set up with 2 x Samsung Evo 840 SSD 256Mb, for performance reasons while acessing/modificating very large files. I've also got a schedule backup to another HDD for ...
lourencosm's user avatar
1 vote
2 answers
2k views

convert with bash - trim/crop and center

i need a fast and reliable way to modify a lot of images. There is a lot of white around my pictures i want to get rid about. The problem is, it is a number of similar pictures, but they have ...
ano302's user avatar
  • 11