Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fstrim or discard?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sat Mar 08, 2014 6:50 pm    Post subject: fstrim or discard? Reply with quote

I had a system that was running on a SSD, I say had as for some reason the whole system become borked, nothing would work, and seeing as I needed the processing power of the system I put Windows back on it, now that I have calmed down and am willing to give Gentoo another try on there I am wondering if it was because I had discard in fstab, and had fstrim as a cronjob, which never worked, so I would run it manually.

Could this have been what caused the system to throw a major league fit and crap out?

Which is the better of the two to go with, fstrim or discard?
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43586
Location: 56N 3W

PostPosted: Sat Mar 08, 2014 6:53 pm    Post subject: Reply with quote

FizzyWidget,

Its unlikely either of those options messed up your Gentoo
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sat Mar 08, 2014 6:56 pm    Post subject: Reply with quote

Well nice to know that me doing either didnt lead to the system going read only and me having to do a fsck which found issues, but I did run revdep-rebuild and a few other tools to look and see if any files needed to be replaced/were missing, all came back clean.

I thought by me using both commands I may have messed something up, but going back to the original question, which is the better option of the two to use?
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2542
Location: Near Toronto

PostPosted: Sat Mar 08, 2014 7:23 pm    Post subject: Reply with quote

you say your system "went read only"

I've seen the same thing on my thinkpad t440s - caused by
bugs in the Aggressive Sata Power Management (probably
some interaction between the ssd firmware and ahci
controller ???)

anyway - the problem goes away if I use only medium_power
ASPM setting rather than min_power

you might consider if you are also a victim of this
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sat Mar 08, 2014 7:31 pm    Post subject: Reply with quote

Would that be in the kernel or the desktop?

Edit: Just checked for an update to firmware - wasn't last time I looked, although there is now, things fixed/improved :-

Optimize TRIM completion behavior
Optimize unsafe shutdown
Optimize SATA stability

Hoping the last one might help my issue


Don't feel like starting a fresh install at 9pm so will have to wait till tomorrow, would still like to know which way people would advise to issue the trim command to it:(
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2971
Location: Germany

PostPosted: Sun Mar 09, 2014 1:30 am    Post subject: Reply with quote

I prefer fstrim on a weekly basis. In most cases it doesn't really matter if a free block is trimmed instantly, or a week afterwards. fstrim does not suffer from the performance issues discard still imposes on you when deleting a lot of files. with fstrim, you have better chances to recover from an idiotic messup, like an accidental rm -rf photos/. with discard, they're gone instantly, with fstrim (if you disable the cronjob immediately), you can still get the photos back using photorec.
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sun Mar 09, 2014 10:47 am    Post subject: Reply with quote

I tried using cronie to add a cronjob to run fstrim - but for some reason I never managed to get it working, any advise on how I can get it to run via cronjob?
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2971
Location: Germany

PostPosted: Sun Mar 09, 2014 7:05 pm    Post subject: Reply with quote

I just put it in /etc/cron.weekly
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sun Mar 09, 2014 7:48 pm    Post subject: Reply with quote

I have never had to use cron so i really dont have a clue about it, do you mean make a .sh file and add it to that dir, or a normal file with

fstrim -v /boot
fstrim -v /
fstrim -v /home

in it?
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum