Timeline for Find and remove large files that are open but have been deleted
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 13, 2017 at 12:36 | history | edited | CommunityBot | replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/ | |
| Sep 23, 2015 at 10:11 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 | added 178 characters in body |
| Apr 30, 2015 at 10:02 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 | added 96 characters in body |
| Oct 23, 2014 at 6:26 | comment | added | Synchro | You can also use lsof +L1. From the lsof man page: "A specification of the form +L1 will select open files that have been unlinked. A specification of the form +aL1 <file_system> will select unlinked open files on the specified file system.". That should be a bit more reliable than grepping. | |
| Mar 21, 2013 at 6:08 | vote | accept | dotancohen | ||
| Mar 20, 2013 at 18:56 | comment | added | Olivier Dulac | @StephaneChazelas: thanks. I found a way to list all PIDs which have a file open on each partitions : df -k | awk 'NR>1 { print $NF }' | xargs fuser -Vud (and then easy to send signals to the offenders to force them to release the fd) | |
| Mar 20, 2013 at 13:50 | comment | added | Stéphane Chazelas | @OlivierDulac, lsof is probably going to be the closest to a portable solution you can get to list open files. the debugger approach to close the fd under the application feet should be quite portable as well. | |
| Mar 20, 2013 at 13:40 | comment | added | Olivier Dulac | nope, even as root: AIX 6.1, lsof 4.82 : doesn't show the filename. instead, using procfiles -n pid instead of lsof -p pid will show the filename, UNTIL you delete it (ie, after deletion, it still shows its other informations, inode, modes, etc, but the things -n was showing (ie: its full path : name:.........) is no longer shown once the corresponding file is deleted). So please if anyone knows a solution for AIX 6.1, I'm interrested. | |
| Mar 20, 2013 at 10:59 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 | added 95 characters in body |
| Mar 20, 2013 at 9:21 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 | added 177 characters in body |
| Mar 20, 2013 at 9:15 | comment | added | Tobu | There's also a truncate command that does the same thing more explicitly. | |
| Mar 20, 2013 at 8:42 | history | answered | Stéphane Chazelas | CC BY-SA 3.0 |