You are not logged in.

#1 2021-12-14 18:15:00

Markus.N2
Member
From: Germany
Registered: 2013-08-22
Posts: 99

How to monitor who is accessing my not-mounted sleeping HDD's ?

In my PC, I have SSD and an additional a md-raid made of 5 HDD's. The data on the md-raid is used only occasionally. To save energy, I would like to have the HDD's sleeping all the time they are not used.

The problem is that every now and then a random HDD is waking up.

First, I ruled out the updatedb service by disabling it. Then, I identified a few applications that scan the whole filesystem when I use "File -> Open" and eliminated this cause by unmounting the raid. I also found out that udisks2 scans all devices when anything (e.g. a USB stick or even network volume) is mounted or unmounted.

But even when updatedb is off, the raid is not mounted, and I do no mounts or unmounts, I still have random HDD wakeups.

Is there a tool that can monitor who is accessing physical or LVM devices (there is LVM on top of the md-raid) ?

Offline

#2 2021-12-21 18:24:38

ua4000
Member
Registered: 2015-10-14
Posts: 418

Re: How to monitor who is accessing my not-mounted sleeping HDD's ?

Sorry, I don't know such a tool, maybe inspect all available logs with  journalctl, maybe 'lsof' could help too.

But a hint on wakeup, do you use https://wiki.archlinux.org/title/S.M.A.R.T.#smartd ?

Offline

#3 2022-01-07 10:35:24

Markus.N2
Member
From: Germany
Registered: 2013-08-22
Posts: 99

Re: How to monitor who is accessing my not-mounted sleeping HDD's ?

This is a very good idea, but I'm not running smartd.

Offline

#4 2022-02-12 17:01:00

Krakonos
Member
Registered: 2017-07-19
Posts: 4

Re: How to monitor who is accessing my not-mounted sleeping HDD's ?

I suggest the following (blktrace is available in AUR):

blktrace -d /dev/sda2 -o -  | blkparse -i -

Also, I know you did say you do not run smartd, but asking for SMART data usually spins up the drive. Could be another daemon getting something like that? collectd, nagios/icinga/cacti/.... whatever monitoring system also comes to mind.

Offline

#5 2022-02-12 17:18:36

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: How to monitor who is accessing my not-mounted sleeping HDD's ?

are you using smartd? does smartctl -a wake up your drive? in that case, add -n standby,q

edit: sorry missed the post where you said you're not using it -.-

basically smart is the thing that keeps my WD 8TB drives awake, in the end I put them back into their USB enclosures and use external power switch... (standby works okay in Linux but Windows keeps waking the drives up)

----

Oh, another thing that wakes up drives is if you mount by UUID. Searching for UUIDs wakes up all drives. Change fstab entry to use /dev/disk/by-uuid/X instead of UUID=X

Last edited by frostschutz (2022-02-12 17:21:48)

Offline

Board footer

Powered by FluxBB