Why can't you kill a process in D state?
AdvancedConceptProcesses, Signals & systemd
Answer
Uninterruptible sleep means the task is inside a kernel code path that cannot be safely aborted, typically waiting for a block I/O or NFS reply. Signals, including SIGKILL, are only acted on when it returns to user space. Fix the underlying I/O (failed disk, hung NFS server, stuck multipath) or reboot. cat /proc/<pid>/stack (as root) shows where it is stuck. Newer kernels add TASK_KILLABLE for some paths, so NFS hard mounts may respond to SIGKILL.
More on Processes, Signals & systemd
What is the difference between a program, a process and a thread?BeginnerHow are new processes created in Linux?IntermediateWhat is a zombie process, and how do you get rid of it?IntermediateWhat is an orphan process?BeginnerExplain the process states shown in ps (R, S, D, T, Z).IntermediateWhat are signals? Name the important ones.Beginner