Despite kill -9 $PID
should work always, it sometimes does not. At least I have some encounters to recall. Yesterday I got one such: I had a problem with my SD-card and I wrote it over with zeroes (dd
). After that, I reinserted into a card reader and tried to list all partitions available:
$ sudo parted -l
But the process hanged and after a couple of minutes I tried to interrupt it with CTR+C. It did nothing, so I tried to kill the process:
$ ps aux | grep parted
root 26968 0.0 0.0 73408 4384 pts/4 S+ 01:40 0:00 sudo parted -l
root 26969 0.0 0.0 39516 3072 pts/4 D+ 01:40 0:00 parted -l
username 27178 0.0 0.0 15664 1148 pts/5 S+ 01:45 0:00 grep parted
After a few iterations of
$ sudo kill 26969
$ sudo kill -15 26969
$ sudo kill -9 26969
$ sudo kill -9 26968
I got killed 26968 (just sudo
, I think). PID 26969 is still (about 16h later) in a process table:
root 26969 0.0 0.0 39516 444 pts/4 D 01:40 0:00 parted -l
And I can't access my SD-card, I reinserted it few times tried to access it few ways, in dmesg
I don't see any events on inserting the card. Usually, in situations like that, I have found no other ways but reboot.
Is there a better way?
kill -9
isn't going to work. The only way to stop it is the reboot the system but the driver will just cause it to happen it again. – Nasir Riley Dec 21 '19 at 16:20