LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 09-27-2019, 09:35 PM   #1
Tukatz
Member
 
Registered: Apr 2014
Location: B.C. Canada
Distribution: Ubuntu14.04Trusty, Ubuntu 16.04.1
Posts: 80

Rep: Reputation: Disabled
SSD Defrag concerns


will defragging an ssd destroy it and if so, is there a way to prevent that with a linux OS? I am running Mint 18.3 Cinnamon 64bit. I was told a while back that Linux systems auto-defrag either on start-up or shut-down. I was also told I should try to disable the auto-defrag or at least see if my system recognises the ssd and prevents auto-defrag. I am a bit over my head here...
 
Old 09-27-2019, 09:58 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,806

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Quote:
Originally Posted by Tukatz View Post
will defragging an ssd destroy it and if so, is there a way to prevent that with a linux OS? I am running Mint 18.3 Cinnamon 64bit. I was told a while back that Linux systems auto-defrag either on start-up or shut-down. I was also told I should try to disable the auto-defrag or at least see if my system recognises the ssd and prevents auto-defrag. I am a bit over my head here...
Defrag and trim are file system driver features, not a linux core feature. Drivers for file systems that properly detect and adjust to SSD devices will not defrag, as there is no advantage to defrag a ssd device. There is some advantage to trim, but that is a different subject.

Defrag is not the only issue, any operation that does lots of unnecessary writes will age an SSD device. The very latest SSD devices are very good, and should last longer than a rotational device despite a few defrag operation. Best practice is still to avoid those extra writes.

Before deciding on your storage plan it is best to research the SSD detection, automatic adjustments, and setting options for the available file systems and how they will affect your hardware and software behavior. ZFS, BTRFS, and newer XFS drivers are of interest. EXT4 does NOT auto adjust, but is actively being improved to make proper management of SSD devices better easier.
 
Old 09-27-2019, 10:02 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,418
Blog Entries: 28

Rep: Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167
What file system is on the SSD?

If it's a Linux file system such as ext4, defragging should not be necessary, as most Linux file systems in current use manage fragmentation dynamically (that is, not on startup or shutdown, but in regular usage). A web search leads me to believe that most of the concern about defragging SSD drives relates to systems using Windows file systems.

I never encountered a "defragmentation setting" on a Linux distro. Methinks your acquaintance was in error.

You may find this article helpful: https://www.howtogeek.com/115229/htg...defragmenting/

If I am mistaken, I am certain that someone will correct me.
 
Old 09-28-2019, 01:24 PM   #4
Tukatz
Member
 
Registered: Apr 2014
Location: B.C. Canada
Distribution: Ubuntu14.04Trusty, Ubuntu 16.04.1
Posts: 80

Original Poster
Rep: Reputation: Disabled
Thanks guys, I am afraid I have gotten behind on keeping up with the latest tech issues as such. To explain briefly what happened: I have been experiencing lately an anomaly in my computer where occasionally when I try to boot up, the unit does power up but the screen stays blank...nothing. I was sure it wasn't a power supply issue but after asking a few (supposed) techies as to the cause, they all said it appeared to be a failing HDD which in this case was a 1TB physical which was only about 3 years old and by the way I had only used about 21%. It was suggested I install an SSD and was told the old issues of "losing usable space" on an SSD due to deleting or un-installing software or files was no longer a problem. Later on another source stated defragging an SSD could be destructive and that he had never seen a hard drive cause the boot-up issue I had (or have which as yet has not reoccurred) He stated it may be more likely to be a CPU or motherboard problem, difficult to tell for sure since the problem is or was very inconsistent. So far my computer (ASUS K 20) is running well, a bit faster on start-up, but as yet no sign of start-up issues. If anyone has any further comments regarding this I would welcome them. Thanks again, Tukatz
 
Old 09-28-2019, 01:44 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
You never defragment a file system that resides on an SSD, regardless of type. Period.

Defragmentation is something one does to improve performance. Fragmentation, meaning different parts of a file is spread across non-contiguous sectors on a drive, affects performance if, and only if, accessing contiguous sectors is faster than seeking to and accessing non-contiguous sectors. This is indeed true for mechanical drives that have to move physical read/write heads. It is however not true for SSDs, since each sector in an SSD is just a piece of memory with an address, like any other, in NVRAM.

Then there's the wear issue: A mechanical hard drive works until its mechanical or electronic components wear out. An SSD, on the other hand, has only electronic components. The SSD lacks the physical, rotating platters, meaning no seek time and no platter/head that can wear out, but instead it has non-volatile memory chips (flash memory), which are not present at all in mechanical drives. This introduces an entirely new wear issue.

NVRAM chips only last for a limited number of erase/write cycles. Hence, the less re-writing of data, the better. Unfortunately, the defragmentation process consists of nothing but the moving around and re-writing of data.

Conclusion: Defragmentation will not affect the performance of a file system stored on an SSD device, and is likely to severely reduce the lifetime of the device.
 
2 members found this post helpful.
Old 09-28-2019, 03:45 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Tukatz View Post
I have been experiencing lately an anomaly in my computer where occasionally when I try to boot up, the unit does power up but the screen stays blank...nothing. I was sure it wasn't a power supply issue ... difficult to tell for sure since the problem is or was very inconsistent. So far my computer (ASUS K 20) is running well, a bit faster on start-up, but as yet no sign of start-up issues.
I think we should stick to what is actually happening, not to what "could" be the reason for your problems.
Intermittent problems are the hardest to diagnose.
At what point does the screen go blank? Before the OS loads, or after? In other words, how long does it take, and can you see anything before the blank screen?
 
Old 09-28-2019, 10:29 PM   #7
Tukatz
Member
 
Registered: Apr 2014
Location: B.C. Canada
Distribution: Ubuntu14.04Trusty, Ubuntu 16.04.1
Posts: 80

Original Poster
Rep: Reputation: Disabled
Hi Ondoho, the blank screen issue is right from boot-up. No Bios screen or anything, the computer is powered up but nothing happens. So far, with the new SSD it hasn't happened but of course I have no way of knowing if the problem will occur and it was very random. Re-booting always worked but obviously there is or was a problem, the question is what caused it?
 
Old 09-28-2019, 11:13 PM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Quote:
Originally Posted by Tukatz View Post
No Bios screen or anything, the computer is powered up but nothing happens.
A PSU that's about to go bad could indeed cause symptoms like these. It could also be faulty capacitors on the motherboard, typically related to the CPU voltage regulator circuitry. I've never seen a hard drive cause anything like this, though.

When this happened, did the computer fans run? Did the power light come on and stay on? Do you remember if the keyboard lights flashed briefly?

Should this happen again, you might want to make notes regarding the following:
  • Does the system emit any sounds/beeps?
  • If you just leave the computer in this condition for a few minutes, are there any signs that something might be happening even though there's no picture on the screen? Such as the drive activity light flashing?
  • If your system has a reset button, will pressing it briefly when the system is "frozen" make it start booting normally?
  • Can you get the computer to boot by turning it off and then on again using the power button (which you might have to press and hold for up to 10 seconds), or do you have to pull the plug?
  • Does this only happen when you physically turn the computer on, or might the system also hang upon reboot?
Knowing the answers to the above would be really useful in narrowing down the underlying cause.

FWIW, a while back my main system exhibited the exact behaviour you''re describing. I noticed that it would boot normally if I disconnected my USB hubs, but a few months later it wouldn't boot no matter what I did. The cause turned out to be a leaky capacitor inside the PSU, one related to the 5V standby power circuit.
 
Old 09-29-2019, 07:25 AM   #9
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,806

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Quote:
Originally Posted by Ser Olmy View Post
A PSU that's about to go bad could indeed cause symptoms like these. It could also be faulty capacitors on the motherboard, typically related to the CPU voltage regulator circuitry. I've never seen a hard drive cause anything like this, though.
.
I am not saying this is the case, but I have seen industrial hard drives that pull quite a significant startup current make a power related problem much worse on startup. It is possible that the rotational drive he replaced was PART of the problem and that whatever failing or underperforming part CAUSES the problem will behave differently under the more stable load represented by the SSD.

Last edited by wpeckham; 09-29-2019 at 07:27 AM.
 
Old 09-29-2019, 10:16 PM   #10
Tukatz
Member
 
Registered: Apr 2014
Location: B.C. Canada
Distribution: Ubuntu14.04Trusty, Ubuntu 16.04.1
Posts: 80

Original Poster
Rep: Reputation: Disabled
Ser Olmy: No bells, whistles, flashing lights etc. And there is no reset button on my computer. Just a totally black screen, no cursor, nothing, but I can tell the computer is powered up since I can hear the CPU fan. Nothing at all unusual other than a blank screen. Re-booting by using the power button always fixed the problem giving a normal boot-up. So far since installing the SSD the problem has not reoccurred, but it was so random that i don't know if it will happen again.
I also once experienced a faulty PSU on a previous computer, in that case it would just quit, at first it could be minutes or longer, but as time went on it finally got to where it would quit almost as soon as the desktop appeared.
I've had my current computer for about 3 years, it's a slim tower, and for the 1st 2 years it gave me no problem and otherwise still performs fine.

What about RAM, could it cause this?
 
Old 09-30-2019, 07:13 AM   #11
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,806

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Quote:
Originally Posted by Tukatz View Post
Ser Olmy: No bells, whistles, flashing lights etc. And there is no reset button on my computer. Just a totally black screen, no cursor, nothing, but I can tell the computer is powered up since I can hear the CPU fan. Nothing at all unusual other than a blank screen. Re-booting by using the power button always fixed the problem giving a normal boot-up. So far since installing the SSD the problem has not reoccurred, but it was so random that i don't know if it will happen again.
I also once experienced a faulty PSU on a previous computer, in that case it would just quit, at first it could be minutes or longer, but as time went on it finally got to where it would quit almost as soon as the desktop appeared.
I've had my current computer for about 3 years, it's a slim tower, and for the 1st 2 years it gave me no problem and otherwise still performs fine.

What about RAM, could it cause this?
While a failing part (including RAM) COULD cause this, it is more likely to be a thermal related issue. When you swapped in the SSD drive did you clean?
 
Old 09-30-2019, 02:40 PM   #12
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Tukatz View Post
the blank screen issue is right from boot-up. No Bios screen or anything, the computer is powered up but nothing happens.
This could have a dozen different reasons, but since it happens before the OS loads it has nothing to do with the OS!

One good troubleshooting step is to boot from a known good live medium - if that boots OK, it could be the hard drive.
Or start disconnecting things from your mobo until it boots up again.
Or look for loose screws or loose connections.
Or.... or ....
 
Old 09-30-2019, 04:00 PM   #13
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,027

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
I'd pull the power plug when I turn it off and see if a full cold power up solves the issue. (worth a try)

If you are planning to power up in the next few minutes then be sure to press the power button a few times while plug is out.

However if this system is old and you put a ssd in that would have never been shipped then we might expect that the ssd has some compatibility issue. Would be nice if you has a bios option to see start up or verbose display.

I think what they told you is some filesystems do a filesystem check. As noted a defrag on ssd is useless. Won't hurt but does nothing. Bits will just be in new places and access speed will be the same.
 
Old 09-30-2019, 07:25 PM   #14
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,806

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Quote:
Originally Posted by jefro View Post
I'd pull the power plug when I turn it off and see if a full cold power up solves the issue. (worth a try)

If you are planning to power up in the next few minutes then be sure to press the power button a few times while plug is out.

However if this system is old and you put a ssd in that would have never been shipped then we might expect that the ssd has some compatibility issue. Would be nice if you has a bios option to see start up or verbose display.

I think what they told you is some filesystems do a filesystem check. As noted a defrag on ssd is useless. Won't hurt but does nothing. Bits will just be in new places and access speed will be the same.
From what he says, putting the SSD in made the problem either go away, or become lass common. Etiher way, I do not think we can blame the SSD: the problem started before the SSD was installed.
 
Old 09-30-2019, 09:07 PM   #15
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,027

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Doh! "So far, with the new SSD it hasn't happened"
 
  


Reply



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
[SOLVED] I have a SSD a 500GB drive and a 2TB drive and want to move Ubuntu from 500GB to SSD greatormesby Linux - Newbie 12 07-06-2015 09:58 AM
SSD defrag qrange Linux - Software 18 11-09-2014 08:41 AM
To SSD or not to SSD jlinkels Linux - Hardware 14 10-02-2012 07:36 AM
SSD raid1 vs SSD raid10 advice ? wonker Linux - Hardware 8 05-23-2012 01:46 AM

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

All times are GMT -5. The time now is 02:50 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