用户@mtak在另一个问题上建议:
You could try running
热熔器/path/to/.nfsto check which process is using the .nfs file. – mtak May 2 '14 at 9:13
^^^^^可行^^^^^并终止令人讨厌的进程,使其释放文件句柄。
例如
$ rm -rf ~/Downloads
rm: cannot remove ‘/nfshome/x/Downloads’: Directory not empty
$ ls -alstr ~/Downloads
total 38864
972 -rw-r--r-- 1 x users 988438 Dec 20 2016 .nfs00000000018d307a00000369
31812 -rw-r--r-- 1 x users 32503812 Dec 20 2016 .nfs00000000018d307f0000036b
636 drwx--x--x 134 x y 647168 Aug 28 10:37 ..
240 drwxr-xr-x 2 x y 241664 Aug 28 10:43 .
$ rm -rf ~/Downloads
rm: cannot remove ‘/na-homes/x/Downloads/.nfs00000000018d307a00000369’: Device or resource busy
rm: cannot remove ‘/na-homes/x/Downloads/.nfs00000000018d307f0000036b’: Device or resource busy
$ fuser /nfshome/x/Downloads/.nfs00000000018d307400000367
/nfshome/x/Downloads/.nfs00000000018d307400000367: 8231m
$ ps -elf |grep 8231
0 S x 1493 15153 0 80 0 - 28177 pipe_w 10:55 pts/39 00:00:00 grep --color=auto 8231
0 S x 8231 7660 0 99 - - 481464 poll_s Jul19 ? 00:06:01 /usr/libexec/tracker-extract
$ kill 8231
$ kill 8231 # kill twice to check first kill worked, . .
# escalate to kill -9 8231 if first kill didn't work, . .
# use sudo or root or other user to kill if ownership prevents kill working.
-bash: kill: (8231) - No such process
$ rm -rf ~/Downloads
$ ls -alstr ~/Downloads/
ls: cannot access /nfshome/x/Downloads/: No such file or directory
好极了!成功。
YMMV当然。在打开文件的过程中可能是一个不同的过程。
我杀死跟踪器提取过程后,它会自动重新启动。
这是什么跟踪器提取的东西?(我在centos / redhat上看到了)
/programming/26737900/tracker-extract-and-tracker-store-processes-using-huge-amount-of-ram
extra/tracker 1.2.3-1 (gnome)
All-in-one indexer, search tool and metadata database
ps -Af | grep 'indicator-services-start' | awk '{ print $2 }' | xargs kill
到解决crontab -e
。