问题描述
我试图杀死这个过程:
sam@sam-desktop:~$ ps -aux|grep sda
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 2898 0.0 0.0 0 0 ? S 11:39 0:00 [jbd2/sda6-8]
root 2899 0.0 0.0 2300 716 ? D 11:39 0:00 mount -t ext4 -o uhelper=udisks,nodev,nosuid /dev/sda6 /media/634bad56-5543-40fe-843b-cd31f4a95dba_
sam 2973 0.0 0.0 3328 876 pts/0 S+ 14:13 0:00 grep --color=auto sda
sam@sam-desktop:~$ sudo kill -9 2898
sam@sam-desktop:~$ sudo kill -9 2899
sam@sam-desktop:~$ sudo killall -9 2898
2898: no process found
sam@sam-desktop:~$ sudo killall -9 2899
2899: no process found
sam@sam-desktop:~$ ps -aux|grep sda
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 2898 0.0 0.0 0 0 ? S 11:39 0:00 [jbd2/sda6-8]
root 2899 0.0 0.0 2300 716 ? D 11:39 0:00 mount -t ext4 -o uhelper=udisks,nodev,nosuid /dev/sda6 /media/634bad56-5543-40fe-843b-cd31f4a95dba_
sam 2987 0.0 0.0 3328 872 pts/0 S+ 14:22 0:00 grep --color=auto sda
sam@sam-desktop:~$
在提出建议后,我尝试了:
sam@sam-desktop:~$ sudo umount -f /media/634bad56-5543-40fe-843b-cd31f4a95dba_
umount2: Invalid argument
umount: /media/634bad56-5543-40fe-843b-cd31f4a95dba_: not mounted
sam@sam-desktop:~$ sudo umount -l /media/634bad56-5543-40fe-843b-cd31f4a95dba_
umount: /media/634bad56-5543-40fe-843b-cd31f4a95dba_: not mounted
sam@sam-desktop:~$
最佳答案
几点:
-
killall
仅采用进程名称,因此您的语法不正确。 -
[bracketed]
进程是内核线程,它们不会响应被像kill
这样的用户空间程序杀死的情况。 -
像
mount
这样的东西正在等待内核响应。它应该安装然后关闭。它挂起的唯一时间是当坐骑无法通过时,AFAIK。考虑在您的挂载选项中使用-v
以查看确切的问题。
我认为您想尝试 sudo umount -f /media/634bad56-5543-40fe-843b-cd31f4a95dba_
如果这不起作用: sudo umount -l /media/634bad56-5543-40fe-843b-cd31f4a95dba_
。我希望内核会看到卸载并停止之前的安装操作。
此外,如果这是您的 /etc/fstab
的挂载,您可能需要考虑 using UUIDs 而不是可以在引导之间更改名称的“ /dev/sdxn
”设备。
次佳答案
该进程处于不间断的睡眠状态,因此无法被杀死。
\\n
An uninterruptible sleep state is a sleep state that won’t handle a\\n signal right away. It will wake only as a result of a waited-upon\\n resource becoming available or after a time-out occurs during that\\n wait (if specified when put to sleep). It is mostly used by device\\n drivers waiting for disk or network IO (input/output). When the\\n process is sleeping uninterruptibly, signals accumulated during the\\n sleep will be noticed when the process returns from the system call or\\n trap.
\\n
所以我会检查 the hard disk and partition for errors 。