I want to investigate what keeps my drives spinning on my nas. Which commands help me to get insight on which files are being opened and preventing my disks to sleep?
2 Answers
If I got it correctly, you should use the lsof command:
lsof | grep /path/to/your/disk
This command will show you which processes have files open on that disk.
-
This will not work if you run docker containers. The opened files will not show upfaze– faze2024-03-03 21:06:37 +00:00Commented Mar 3, 2024 at 21:06
-
@faze you didnt ask for Docker... Its better to add Docker to your question.Yousha Aleayoub– Yousha Aleayoub2024-03-03 22:57:25 +00:00Commented Mar 3, 2024 at 22:57
-
Open files do not necessarily mean they are being read from/written to. An application may create and delete files.Artem S. Tashkinov– Artem S. Tashkinov2024-03-04 09:13:39 +00:00Commented Mar 4, 2024 at 9:13
btracecan be handy: it "traverses" all block layers.