Score:1

Something unknown reads data from my disks

my flag

I've got a small server at home to access my files and the HDDs don't spin down. Currently it runs Ubuntu Server 22.04. Executing something like $ cat /sys/block/sde/stat displays some information including the total sectors read. If I wait for about 20 minutes and execute this command again, the total amount of sectors read increased.

$ cat /sys/block/sde/stat
 6886729 970027822 7822380784 1292509782    15759   276608  2297706   485868        0 30475568 1293440472        0        0        0        0    23680   444820
... Wait about 20 minutes
$ cat /sys/block/sde/stat
 6886734 970027822 7822380787 1292510398    15759   276608  2297706   485868        0 30476188 1293441088        0        0        0        0    23680   444820

But in theory there shouldn't be any process accessing this HDD.
This all started 2 days ago after upgrading to Ubuntu Server 22.04 from Ubuntu Server 20.04.

I already tried to use <inside the correct directory>$ sudo fatrace -c, but this didn't show anything. Also I tried to use $ inotifywait -m -r /..., still nothing.

How am I able to dig deeper so my HDDs are finally able to spin down again?

Score:1
vn flag

Using iotop

You can monitor disk IO with iotop.

Install with:

sudo apt install iotop

And run:

iotop

This should tell you exactly which processes use disk and swap.

Using htop

You can also monitor IO directly with htop (although it's a sort of "hidden" feature).

Install with:

sudo apt install iotop

And run:

htop

Now press Tab to switch to the IO screen (instead of the main screen). This gives info similar to iotop.

Using udisksctl

If you suspect the activity is related to udisks, you can try and run:

udisksctl monitor

This will tell you if there is activity with the udisks daemon.

SomeDude avatar
my flag
I'm unable to filter for specific mount-points/HDDs in `iotop`. Then I tried `dstat -tdD /dev/sde --top-io` and saw something like `04-07 14:06:30|1536B 0 |gvfs-udisks 465k 120B` May this be the culprit?
Artur Meinild avatar
vn flag
Possibly related to the `gvfs-udisks2-volume-monitor.service`: https://github.com/canonical/microk8s/issues/500
SomeDude avatar
my flag
`udisksctl monitor` really output something interesting: `14:36:27.466: /org/freedesktop/UDisks2/drives/HGST_HDN724040AL_PK2334PEKD5RJT: org.freedesktop.UDisks2.Drive.Ata: Properties Changed SmartUpdated: 1688474187` PS: I don't have microk8s installed, so there is no such service and no commands starting with `microk8s`
SomeDude avatar
my flag
There is no such service like `gvfs-udisks2-volume-monitor.service`. The closest I got is `run-user-1000-gvfs.mount`
Artur Meinild avatar
vn flag
Hmm ok. I think maybe the `udisksctl monitor` is a clue, but I don't know what it tells. `SmartUpdated` - sounds like SMART attributes maybe? But sorry, I really don't know.
SomeDude avatar
my flag
May be related to https://github.com/storaged-project/udisks/issues/993 or https://github.com/storaged-project/udisks/issues/892?
Artur Meinild avatar
vn flag
I think you're on to something..
Score:1
my flag

I solved it.

With sudo dstat -tdD /dev/xxx --top-io I was able to see which services did something with my drive. Those were in my case:

  • smartd
  • irqbalance
  • udisks2

So I had to do

sudo systemctl stop udisks2.service # System still works, seems not to be so important
sudo systemctl disable udisks2.service
sudo systemctl stop smartd.service # SMART is nice, but not if the daemon prevents the drive from going into standby
sudo systemctl disable smartd.service
sudo systemctl stop irqbalance.service # If you got a server with hunders of drives this is meaningful for performance. In my case just overkill and prevents my drives from sleeping
sudo systemctl disable irqbalance.service

Thanks to Artur Meinlid for the assistance.


Edit: At least I thought it was solved. I realized that udisks2.service restarts after some hours. The service is stopped and disabled but it still restarts. What the potatosalad?


Edit2: It was possible to mask this service.

sudo systemctl mask udisks2.service
sudo systemctl stop udisks2.service

Now this service doens't get restarted and the HDDs are sleeping. I tested this for a week now and everything works fine.

Artur Meinild avatar
vn flag
If you found my answer useful, please consider upvoting (even though it's not the exact and full solution). Thanks.
SomeDude avatar
my flag
Sorry but I'm unable to upvote anything. "Thanks for the feedback! You need at least 15 reputation to cast a vote, but your feedback has been recorded."
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.