HDD has severely decreased performance

Hello nice community! I have a strange issue with my HDD (/dev/sdc) and would like some help in investigating/fixing it. (Warning, wall of text incoming...)

Setup

  • Zorin is installed on a 50GB partition on an NVME drive, however, /home, and a separate /Games partition, are on a HDD (/dev/sdc3 and /dev/sdc6, respectively).
  • I also have a Nobara installation, this one installed on the HDD in question (/dev/sdc5).
  • I am using Plasma desktop on both distros.
  • (I also have Windows, on a completely different disk, an SSD, but this is probably not very relevant.)

Problem: the HDD on which my /home partition became very, very slow. Symptoms include

  • heavily I/O intensive work, e.g. Steam patching, became a nightmare (even a small-ish game like Euro Truck Simulator 2 takes 15+ minutes to patch /not to download the patch but to install it/, during which time all other applications become almost unresponsive)
  • file operations take way too long (e.g. I have a 3.1 GB file I was trying to copy to an external HDD, which took more than four minutes -- doing the same thing, from the same source to the same destination, from live USB Zorin took only about half a minute)
  • while Zorin boots up quite fast, it takes considerable time for it to start up after logging in in the GUI. If I have applications in autostart, those open very slowly and I can't use them until all of them are open as they appear frozen. (Because of this, I took outt everything I had in Autostart for now.)
  • if I try to log in to Nobara, the screen remains black for several minutes before the desktop GUI appears

I did some investigations using hdparm and sysbench's fileio module (using the default 128 files of 16 MiB each and rndrw file test mode) and found some curious results. (I see I cannot upload extensionless text files here, so I put the output files on Google Drive here.)

hdparm

  1. For my other HDDs, hdparm gives a result of about 170 MB/sec, so I am taking this as a point of reference (even knowing that they not being in use gives them an advantage).
  2. running it from a terminal before logging in, it already shows much lower speeds, 63-66 MB/sec, see hdparm_Zorin_nologin.
  3. After logging in in the GUI, running it again on tty2, it produces even worse results, 18-41 MB/sec (see hdparm_Zorin_after_login).
  4. When launching Nobara, before logging in, it gives a solid 167-169 MB/s, as seen in hdparm_nobara_nologin.
  5. However, after starting the login on Nobara, it drops a little, to 88-121 MB/sec (hdparm_nobara_after_login). Still, as stated above, Nobara starts up very slowly.

sysbench

  1. On Zorin, Throughput starts already low before logging in, at 0.37-0.44 (see sysbench_Zorin_nologin).
  2. After logging in, it drops to 0.11/0.07-0.07/0.05 (sysbench_Zorin_after_login).
  3. On Nobara, it is considerably higher before GUI login (2.49/1.66-2.5/1.70, which is comparable to that of my other HDDs), as seen in sysbench_nobara_nologin.
  4. However, after starting the GUI login, it drops to 0.11/0.07-0.15/0.10 (sysbench_nobara_after_login).

First, I thought it was a hardware issue, but when testing from a live USB (or, as per the above, before logging in to Nobara), the measurements are what I would expect, so now I doubt it is hardware-related.
Further, I already ran fsck on the drive, it reported no issues, so, allegedly, there are no logical errors, either.

I get the feeling that maybe there is some process that uses too much i/o and slows down everything else to a crawl. Looking at iotop -o on either system, however, I don't see any heavy processes wasting my I/O bandwidth, in fact, only 1-2 processes are running (such as baloo or tracker-store).
I am also including the results of ps -ely on both systems; I cannot see any suspicious processes, but maybe someone has an idea what might be slowing down the system?

Now, I'm obviously not expecting my HDD to have SSD speeds :smiley: but I know even a HDD should do better than this.
Also, I have tried to search for such an issue here with the keywords hdparm, HDD performance and HDD slow but got nothing that I could identify as being the same problem as mine.
Does anyone have an idea what to do to fix my HDD's performance or how to troubleshoot this further?

This is a longshot, but maybe it's starting to went south your HDD. It happens to hardware more often than you know.

It's only a few months old, which I know doesn't mean much, but still, it's my newest HDD.
That said, first, I also thought it might be a hardware issue, but then I realized it works just fine if I copy files from it from a live USB (that is, with the OS that normally uses it for /home and /Games not running), and also, the part that's also accessible to Windows shows no degradation, so now I doubt it's the hardware itself.

Given that the slow down appears to happen when you access the HDD, I would check what is in the HDD partitions for anything amiss.
If you could please clarify - are you seeing Normal Speeds when logged in on Nobara?

If so, have you examined ~/.config for anything that may create a hitch?
Clear ~/.cache

1 Like

Not really, maybe somewhat better than Zorin, but it's still slow, although I rarely use it, so I can't clearly state this. I might do some more extensive testing, but it does load very, very slowly.

They both use the same /home, so it would make sense that if there's something wrong there, it would impact both.

What should I look for in .config?

[quote="Dr.Istvaan, post:5, topic:22704"]
They both use the same /home, so it would make sense that if there's something wrong there, it would impact both.[/quote]
That is what I was checking.

You would know better than I as to what configurations you have made but... What you can test is to back up your config directory:

mv ~/.config ~/.config-bk

Reboot and test your speeds. If no change at all, you know it is not that.
If you see a speed change - then we have a good idea where to start.

Also, check how much total data you have stored on Home. It may be Bulky.

Renaming .config sounds like an excellent idea, thanks for the suggestion, I think I'll try that.
And I know for a fact my /home is very bulky (252 GB bulky :eyes: ); except for my games, everything is there, including a VM and its backup. Should I consider creating extra partitions for bulky stuff and keeping only light things there?

1 Like

It may help.
I usually suggest keeping the Home Directory under half of the partition capacity at all times. I personally prefer it to be well under half.

1 Like

Some updates...

  1. Even just cleaning .cache made my Zorin much snappier, now it doesn't lock up anymore, thanks for that!
  2. On the other hand, I'm back to "it will be a hardware issue". Now I realized even on Windows, in certain cases, there are access issues and chkdks takes way longer than it should. Also, checking dmesg -l err on Zorin produces such results...

[h nov 21 08:27:34 2022] ata5.00: status: { DRDY }
[h nov 21 08:27:34 2022] ata5.00: failed command: READ FPDMA QUEUED
[h nov 21 08:27:34 2022] ata5.00: cmd 60/08:98:38:08:32/00:00:2f:00:00/40 tag 19 ncq dma 4096 in
res 40/00:98:38:08:32/00:00:2f:00:00/40 Emask 0x10 (ATA bus error)
[h nov 21 08:27:34 2022] ata5.00: status: { DRDY }
[h nov 21 08:27:35 2022] blk_update_request: I/O error, dev sdc, sector 3907022840 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0

GSMART on Zorin and CrystalDiskInfo on Windows say my drive is OK, so I'm suspecting a SATA cable issue. (In fact, I already had SATA issue with this drive once, when I inserted it, but re-seating it solved it that time, not so much now.) So I will get a new SATA cable and see if that solves the problems.

I agree with you as to teh cable being the definite first thing to check hardware side. The errors look like bad data transfer.
Which suggests cable issue or poor connection.