My external HDD is written constantly, making constant noise

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

My external HDD is written constantly, making constant noise

Post by LeVraiRoiDHyrule »

Hi,

I have an external HDD plugged in my raspberry, EXT4 formatted and mounted in /mnt.

The drive makes a constant 24/7 noise, I can hear very loudly the head of the drive writing, constantly. The IDLE Spindown is set to 5 minutes, but it doesn't seem to work as it continues to make a lot of noise after 5 mins.

I have a lot of apps on my Raspberry, but normally none of them is supposed to use the disk constantly. But I guess one is doing it, I see no other explaination.

Is there a way to see which one of my apps is using my external HDD that much ?

Thanks in advance for any answer, have a great day.
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: My external HDD is written constantly, making constant noise

Post by Joulinar »

well you could use htop so see which processes are running in generell. As well you could go to stop app by app and see how it behave.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2987
Joined: Sat Nov 18, 2017 6:21 pm

Re: My external HDD is written constantly, making constant noise

Post by MichaIng »

Or iotop to see processes that do disk I/O explicitly:

Code: Select all

apt install iotop
iotop -Po
Options -Po used to have a little cleaner content:
-P: Shows only processes instead of every thread of every process
-o: Shows only processes that actually do disk I/O

But it does not differentiate between disks.
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: My external HDD is written constantly, making constant noise

Post by LeVraiRoiDHyrule »

Hi, thanks a lot for your advice for iotop.

I just installed it and tried to use the argument -Po as you said. It works correctly, but I would have some questions to make it display IO as I would like.
With just -Po, it shows IO but only at the moment when the command is executed. I would like it to refresh continuously, because sometimes I can see some apps writing but it's very fast. I would like it to "log" the apps that are writing, instead of making them disappear from the list if they have finished to write.

Do you know how I could do that ?
Thanks in advance for any answer
User avatar
MichaIng
Site Admin
Posts: 2987
Joined: Sat Nov 18, 2017 6:21 pm

Re: My external HDD is written constantly, making constant noise

Post by MichaIng »

Code: Select all

iotop -aPo
-a: Accumulates reads and writes

Generally, all tools have a help command to show usage and options info:

Code: Select all

iotop -h
-h or --help is understood by nearly all GNU/Linux/UNIX commands :).

Another good resource is the man pages. Debian has an online archive for them for all their packages: https://manpages.debian.org/iotop
Use this URL and append any console command instead of iotop and in 99% of cases you'll get a nice complete man page :).
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: My external HDD is written constantly, making constant noise

Post by LeVraiRoiDHyrule »

Thanks, I now get a clearer view of what my Raspberry does with my disks :

85 be/3 root 0.00 B 56.00 K 0.00 % 0.66 % [jbd2/mmcblk0p2-]
28798 be/4 ombi 0.00 B 8.00 K 0.00 % 0.00 % Ombi --storage /etc/Ombi/

Those are basically 99% of my IO on my disk. Ombi is not an issue, as /etc/Ombi is my internal SD card.

But the problem is my 1st line. What is jbd2/mmcblk0p2- ?
I searched a bit on it, and I stumbled upon this :
https://raspberrypi.stackexchange.com/q ... ernal-disk
https://unix.stackexchange.com/question ... pi-on-arch
https://www.linuxquestions.org/question ... ds-788810/

That REALLY looks like my issue. But I couldn't find a clear method on how to fix it
User avatar
MichaIng
Site Admin
Posts: 2987
Joined: Sat Nov 18, 2017 6:21 pm

Re: My external HDD is written constantly, making constant noise

Post by MichaIng »

jbd2/mmcblk0p2 is the root filesystem's cache sync. ext4 by default has a filesystem cache enabled, so when smaller writes are done, those are not done directly physically to the disk directly, but hold in cache until accumulated to a certain amount, at least a block size (4 KiB) or so. This is to reduce disk write overhead. When major writes are done from the cache, it means that the cache is working as intended and writes are mostly smaller ones, which is pretty normal in case of a database or when daemons are logging to files etc. The cache also reduces the frequency of writes by this.

So have a look at the other processes. Btw, using the arrow keys, you can sort the list in iotop differently. By default its sorted by current I/O, not accumulated writes.
Post Reply