1

I have a small home sever running with Debian Buster where I have a ZFS filesystem (ZFS: Loaded module v0.7.12-2+deb10u2, ZFS pool version 5000, ZFS filesystem version 5) with a RAID.

As the server is sometimes not used for days I have configured a autoshutdown script which shuts down the server if my 2 big WD red hard disks are in standby for more than 45 minutes (not the system hard disk). Now I figured out that the server is not shutting down anymore as both drives are only a few minutes in standby before getting active again. I tested with iotop and figured out that ZFS with the command txg_sync is waking them up. Even if no other process is writing or reading anything on the drives.

By using iosnoop (https://github.com/brendangregg/perf-tools) I was able to identify that dmcrypt is writing to my disk in regular intervals. Please note that my underlying disks are encrypted with LUKS.

./iosnoop -d 8,16
Tracing block I/O. Ctrl-C to end.
COMM         PID    TYPE DEV      BLOCK        BYTES     LATms
dmcrypt_writ 1895   W    8,16     2080476248   4096    6516.10
dmcrypt_writ 1895   W    8,16     3334728264   4096    6516.14
dmcrypt_writ 1895   W    8,16     2080429048   16384      0.16
dmcrypt_writ 1895   W    8,16     3334728272   20480      0.21
dmcrypt_writ 1895   W    8,16     2080476256   20480      0.16
dmcrypt_writ 1895   W    8,16     3328225336   16384      0.20

What is the reason for that and how can I prevent this occuring?

MelBourbon
  • 31
  • 6

1 Answers1

1

It's not easy to identify I/O activity on a disk when using ZFS and a LUKS encrypted device. One way is to use a combination of iotop and iosnoop and killing processes to identify when I/O activity is stopped.

I was able to identify the process which was accessing my drive with

cut -d" " -f 1,2,42 /proc/*/stat | sort -n -k +3
MelBourbon
  • 31
  • 6