LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-25-2019, 08:56 AM   #1
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
does trim on a ssd screw up os'es now?


This happened twice now, on two different Linux Distors.

I ran trim on my drives, and the first one Void Linux, it basically destroyed my OS to where I just got rid of it and installed Arco Linux, and just a minute ago I ran trim on it and was sitting here doing things then it went black screen little cursor in upper left hand cornet then shut down and running jobs on my sdd partitions whatever systemD does 2 minutes to do them so i walked away and when I cam back it was still doing something to it, another 3 minutes and it just stuck so I forced shutdown, reboot.

image says it fails to unmount drive partitons now. even on a second reboot off cli.

Though this being a second time I got a system crash on a trim to the ssds, it sends a red flag to me.

So I am wondering if anyone knows anything about this phenomena.

this is the script I use
Code:
#!/bin/bash
echo "*** $(date -R) ***"
sudo fstrim -v /
sudo fstrim -v /home
[[ -d /media/data1 ]] && sudo fstrim -v /media/data1
[[ -d /media/ntfs1 ]] && sudo fstrim -v /media/ntfs1

echo "***** END TRIMMING **********"
the only actions being performed on the drives where qbittorrent was doing a check on its files.


the ssd drives are a
Code:
  
  /dev/sdb             CHN NGFFSA2242 2
  /dev/mmcblk0         Disk
  /dev/sda             Samsung SSD 860
sda is the reg ssd
the sdb is a PCIe M.2 ssd.
Attached Thumbnails
Click image for larger version

Name:	IMG_20190525_090533.jpg
Views:	16
Size:	250.2 KB
ID:	30643  

Last edited by BW-userx; 05-25-2019 at 09:09 AM.
 
Old 05-25-2019, 01:52 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,597

Rep: Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616
Do we have valid backups here? Sounds like the time for one.

I would never trim root from root, because files are open and Murphy's Law applies, as well as Mrs. Murphy's Corollary (Don't take my husband seriously - he's a total optimist).

I keep a 'get out of jail free' distro just for this sort of occasion. I have Mint-19.0, and the default install only took 6-7 Gig. Personally, I've a 250G ssd, never run trim, and if you run out of space, you can update your backup, delete the lot, and restore again From a look at your options, my guess is you're trimming too much. In my game (Electronics) rule #1 is: "If it ain't broke, don't fix it!"

What size is your ssd, your partitions? If you get a situation where your backup is 6G and your / is showing 10G, then you have a problem. You probably deserve a slightly larger ssd.
 
Old 05-25-2019, 02:26 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,820

Rep: Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239
There are known issues with queued TRIM on certain devices, Samsung 8xx SSDs in particular, causing data coruption. Supposedly, that has been fixed in the Linux kernel by blacklisting queued TRIM on affected devices. See https://lkml.org/lkml/2015/6/10/642 and related searches for "fstrim queued" and "fstrim data corruption" (without the quotes).

Another link: https://wiki.debian.org/SSDOptimization

and https://bugs.launchpad.net/ubuntu/+s...m/+bug/1449005 see comment 16.

Last edited by rknichols; 05-25-2019 at 02:48 PM. Reason: another link
 
1 members found this post helpful.
Old 05-25-2019, 05:01 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
Quote:
Originally Posted by business_kid View Post
Do we have valid backups here? Sounds like the time for one.

I would never trim root from root, because files are open and Murphy's Law applies, as well as Mrs. Murphy's Corollary (Don't take my husband seriously - he's a total optimist).

I keep a 'get out of jail free' distro just for this sort of occasion. I have Mint-19.0, and the default install only took 6-7 Gig. Personally, I've a 250G ssd, never run trim, and if you run out of space, you can update your backup, delete the lot, and restore again From a look at your options, my guess is you're trimming too much. In my game (Electronics) rule #1 is: "If it ain't broke, don't fix it!"

What size is your ssd, your partitions? If you get a situation where your backup is 6G and your / is showing 10G, then you have a problem. You probably deserve a slightly larger ssd.
I've never had an issue with running that trim until recently. if I remember correctly Slackware never does/did this, just other ones. I've been in the others one lately. this arcolinux puts discard in the fstab. so does that take presidents over trim?


Code:
[userx@archooo ~]$ sudo fdisk -l 
Disk /dev/sdb: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Disk model: CHN NGFFSA2242 2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3a883dd5

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1  *         2048  80167362  80165315  38.2G  7 HPFS/NTFS/exFAT
/dev/sdb2        80168960  81919999   1751040   855M 27 Hidden NTFS WinRE
/dev/sdb3        81922048 500117503 418195456 199.4G  5 Extended
/dev/sdb5        81924096 164868095  82944000  39.6G 83 Linux
/dev/sdb6       164870144 350214143 185344000  88.4G 83 Linux
/dev/sdb7       350216192 391380991  41164800  19.6G 83 Linux
/dev/sdb8       391383040 500117503 108734464  51.9G 83 Linux


Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 860 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x28da7fc5

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048 428099583 428097536 204.1G 83 Linux
/dev/sda2       428099584 976773119 548673536 261.6G  7 HPFS/NTFS/exFAT


Disk /dev/mmcblk0: 59.5 GiB, 63864569856 bytes, 124735488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd09b8eb7

Device         Boot Start       End   Sectors  Size Id Type
/dev/mmcblk0p1       2048 124735487 124733440 59.5G 83 Linux

Last edited by BW-userx; 05-25-2019 at 05:05 PM.
 
Old 05-25-2019, 09:51 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,361

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
I assume this is still possible.
Not sure what the state is for Linux kernel 5.x
"
WARNING

Some firmware versions on some SSD models have bugs that result in data corruption when used in certain ways. For this reason the Linux ata driver maintains a "blacklist" of certain things it shouldn't do on certain drive/firmware combinations. This list is in the linux source at drivers/ata/libata-core.c. If you have a blacklisted controller/drive combination, you are at risk until a newer kernel avoids the problem. "

https://wiki.debian.org/SSDOptimization

Last edited by jefro; 05-25-2019 at 10:01 PM.
 
Old 05-26-2019, 04:48 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,597

Rep: Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616
Do I see 204G on / ?

df -h or even the /etc/fstab or /etc/mtab file would give me mount points. I very much doubt if you're short of space, wherever you stuck /. You'll solve this by [U]not[U] running trim.
 
Old 06-04-2019, 10:06 AM   #7
galen
Member
 
Registered: Sep 2003
Location: Halifax, Nova Scotia, Canada
Distribution: MX, Xubuntu, Zorin. BOYCOTTING: Vector, Beatrix, BLAG, Slackware. Life banned from: Facebook, Yahoo!
Posts: 191
Blog Entries: 1

Rep: Reputation: Disabled
don't forget about reserved space
sudo tune2fs -m 0 /dev/sd[drive]
reduces reserved space to 0%
eg.
sudo tune2fs -m 2 /dev/sd[drive]
sets reserved space to 2%
 
Old 06-04-2019, 10:25 AM   #8
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Been trimming my Samsung 850 Pro SSds for 3 years on both Linux and FreeBSD with zero issues. Haven't run Linux in about 6 months, so can't speak to any recent kernel changes but on FreeBSD, UFS2 on my drives has trim enabled and file systems are healthy.
 
Old 06-04-2019, 10:30 AM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
I've had to redo everything, format and starting over, and now I am totally gun shy about using trim on anything of my sdd's.

so it does raise a question about discard in fstab.
id it harmful and what does it really do in reference to instead of using trim
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: JFS File-System Can Now Handle SSD TRIM Discard LXer Syndicated Linux News 4 10-04-2012 06:23 PM
[SOLVED] RAID 1 SSD drives with TRIM grolendaves Linux - Hardware 2 06-05-2011 08:44 AM
[SOLVED] TRIM on SSD mira.mikes Linux - Kernel 8 01-08-2011 06:36 PM
[SOLVED] Fedora 13 SSD TRIM Support Potatos Linux - Hardware 6 06-14-2010 03:17 PM
SSD TRIM support on Linux Thoreau Linux - Kernel 2 03-25-2009 04:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration