Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Hardware] Why isn't SSD optimization enabled by default in Debian?

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Sifat Ullah
Posts: 2
Joined: 2023-03-27 18:02
Has thanked: 3 times

[Hardware] Why isn't SSD optimization enabled by default in Debian?

#1 Post by Sifat Ullah »

I'm new to Debian (Linux in general). I have used Linux Mint before, but there I find no guide about SSD optimization. But in this forum I found SSD optimization guide which is very useful.

But my question is, why aren't these optimizations made by default rather than the user doing them manually? Do they cause problems sometimes? If I don't follow the guide & make those optimizations, will there be any problem in my SSD? Sorry for such an awkward question :|

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2029
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 139 times
Been thanked: 206 times

Re: [Hardware] Why isn't SSD optimization enabled by default in Debian?

#2 Post by Hallvor »

I understand that trying to limit the number of writes can help minimize write operations that aren't necessary and thereby increasing the SSDs longevity. Take atime, for instance, where any disk read is followed by a write to disk.

But is is a mistake if one believes that SSD optimizations are necessary to prevent them from going down in flames. They have a long lifespan even without any optimization.

As far as I know, a feature like fstrim isn't enabled because not all SSDs support the TRIM command, and noatime will cause issues for some users who need file access times recorded.

I have enabled fstrim and noatime, and I threw out an SSD from 2014 a few days ago - not because it didn't work, but because I wanted more space. That's a longer life than any of my HDDs.

Whatever you choose to do, don't blindly copy and paste advice online.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: [Hardware] Why isn't SSD optimization enabled by default in Debian?

#3 Post by sunrat »

There is a systemd fstrim service and timer set up automatically if an SSD is detected. Check if it is present:

Code: Select all

systemctl status fstrim
It runs once a week so this will show loaded/inactive and list the last time it ran fstrim.

noatime is easy to add to /etc/fstab if you wish. IIRC relatime is default anyway.

I wrote a guide last week on how to move browser profile and cache to RAM, that saves a lot of writes and access - viewtopic.php?t=154253

As Hallvor said, it's not really something to worry about these days. My current SSD has 27,000 hours uptime and one in a computer I retired last year is 12 years old.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
BBQdave
df -h | participant
df -h | participant
Posts: 152
Joined: 2011-09-25 03:38
Location: North Carolina
Has thanked: 9 times
Been thanked: 14 times

Re: [Hardware] Why isn't SSD optimization enabled by default in Debian?

#4 Post by BBQdave »

sunrat wrote: 2023-03-27 21:53There is a systemd fstrim service and timer set up automatically if an SSD is detected.
+1

Debian 11 install detected my SSD and fstrim is on a timer to run once a week. All automatic :)
On quest for blue smoke and red rings!
Debian 12 Toshiba Satellite C655 | i3 2.3Ghz | Intel HD Graphics 3000 | 8GB RAM | 65GB SSD

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2029
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 139 times
Been thanked: 206 times

Re: [Hardware] Why isn't SSD optimization enabled by default in Debian?

#5 Post by Hallvor »

sunrat wrote: 2023-03-27 21:53 There is a systemd fstrim service and timer set up automatically if an SSD is detected.
Nice.

It looks like it's time to update the Wiki, then.

https://wiki.debian.org/%20SSDOptimization
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

Sifat Ullah
Posts: 2
Joined: 2023-03-27 18:02
Has thanked: 3 times

Re: [Hardware] Why isn't SSD optimization enabled by default in Debian?

#6 Post by Sifat Ullah »

Thank you everyone who replied. My confusion is over now. :D

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2082
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 225 times

Re: [Hardware] Why isn't SSD optimization enabled by default in Debian?

#7 Post by FreewheelinFrank »

Sifat Ullah wrote: 2023-03-28 07:41 Thank you everyone who replied. My confusion is over now. :D
Glad you found an answer, but there is really no need for oversize and coloured fonts.

You can use the thumbs up button to thank those who helped you.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: [Hardware] Why isn't SSD optimization enabled by default in Debian?

#8 Post by sunrat »

Hallvor wrote: 2023-03-28 07:38
sunrat wrote: 2023-03-27 21:53 There is a systemd fstrim service and timer set up automatically if an SSD is detected.
Nice.

It looks like it's time to update the Wiki, then.

https://wiki.debian.org/%20SSDOptimization
Indeed. The wiki has some very outdated information. The discard option in particular has been discouraged for a long time and may even be detrimental. It does hint not to use it but probably shouldn't even be mentioned.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
BBQdave
df -h | participant
df -h | participant
Posts: 152
Joined: 2011-09-25 03:38
Location: North Carolina
Has thanked: 9 times
Been thanked: 14 times

Re: [Hardware] Why isn't SSD optimization enabled by default in Debian?

#9 Post by BBQdave »

I am probably stating the obvious for most, but I will offer the thought that systemd fstrim service is kernel level and (given you have a SSD) will function on a timer on any GNU Linux install.

You can check the services on timer with:

$ sudo systemctl list-timers

Edit: You may want to stretch your terminal window wide, the output is a lot of information per listed service. And you strike the q key to exit out of the command above.
On quest for blue smoke and red rings!
Debian 12 Toshiba Satellite C655 | i3 2.3Ghz | Intel HD Graphics 3000 | 8GB RAM | 65GB SSD

CwF
Global Moderator
Global Moderator
Posts: 2638
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: [Hardware] Why isn't SSD optimization enabled by default in Debian?

#10 Post by CwF »

BBQdave wrote: 2023-03-28 13:45 $ sudo systemctl list-timers
Perhaps we need make the user a member of adm, but sudo is not needed.

Post Reply