Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-22 Thread Derek Martin
On Tue, Jul 07, 2020 at 11:10:33AM -0400, Rich Pieri wrote: > Something along these lines should work on probably any UNIX or > UNIX-like system. Unlinking a file removes the directory entry but the > storage blocks are not released for reuse until all file handles are > closed. This ends up being

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-16 Thread Bill Bogstad
On Thu, Jul 9, 2020 at 3:41 PM Steve Harris wrote: > > Doing it the hard way: https://www.theregister.com/2020/07/06/who_me/ The comment section for that article is where I learned about using /proc/$PID/fd to recover files. Much easier and probably less error prone. Bill _

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-10 Thread Jerry Feldman
Done. On Thu, Jul 9, 2020 at 9:20 AM Rich Pieri wrote: > Also, one of the list admins needs to remove 8652427...@email.uscc.net > and the gearbest.com address from the list. > > -- > Rich Pieri > ___ > Discuss mailing list > Discuss@lists.blu.org > htt

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-09 Thread Rich Pieri
On Thu, 9 Jul 2020 15:39:34 -0400 Steve Harris wrote: > Doing it the hard way: https://www.theregister.com/2020/07/06/who_me/ Yup, that's one way to do it. Duplicating the raw device with dd makes for a safety net. -- Rich Pieri ___ Discuss mailing

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-09 Thread Steve Harris
Doing it the hard way: https://www.theregister.com/2020/07/06/who_me/ - Steve ___ Discuss mailing list Discuss@lists.blu.org http://lists.blu.org/mailman/listinfo/discuss

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-09 Thread Rich Pieri
Also, one of the list admins needs to remove 8652427...@email.uscc.net and the gearbest.com address from the list. -- Rich Pieri ___ Discuss mailing list Discuss@lists.blu.org http://lists.blu.org/mailman/listinfo/discuss

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-09 Thread Rich Pieri
On Thu, 9 Jul 2020 03:51:55 -0400 Bill Bogstad wrote: > I'm not sure I'm following you here. /proc not only lets me easily > discover on what fd # the file is opened. It also gives me an easy > way to reopen the file so I can copy its contents. How would you go > about recovering the file eas

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-09 Thread Bill Bogstad
On Wed, Jul 8, 2020 at 12:07 PM Rich Pieri wrote: > > On Tue, 7 Jul 2020 19:44:37 -0400 > Bill Bogstad wrote: > > > But not all UNIX-like systems have a /proc/PID/fd directory that makes > > it easy to access the contents of > > such an unlinked file. I don't know if the *BSDs do or not. > > Tr

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-08 Thread Rich Pieri
On Tue, 7 Jul 2020 19:44:37 -0400 Bill Bogstad wrote: > But not all UNIX-like systems have a /proc/PID/fd directory that makes > it easy to access the contents of > such an unlinked file. I don't know if the *BSDs do or not. True, but it should be possible to find the file descriptor somehow i

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-07 Thread Chris Tyler
I once had a research assistant come to me almost trembling because he'd deleted the disk images for a set of critical VMs. I asked if the VMs were still running, and he said they were. So, I dd'd a copy of the disk images using the technique you describe here, and all was well. He bought me more

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-07 Thread Bill Bogstad
On Tue, Jul 7, 2020 at 10:54 AM Jerry Feldman wrote: > > Additionally, you can use debugfs along with the inode to create a link Never used that command, but from the manual page it looks straight forward to do so. Two thoughts though: 1. debugfs appears to only work with ext* filesystems. The

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-07 Thread Bill Bogstad
On Tue, Jul 7, 2020 at 11:12 AM Rich Pieri wrote: > > Something along these lines should work on probably any UNIX or > UNIX-like system. Unlinking a file removes the directory entry but the > storage blocks are not released for reuse until all file handles are > closed. This ends up being more of

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-07 Thread Rich Pieri
Something along these lines should work on probably any UNIX or UNIX-like system. Unlinking a file removes the directory entry but the storage blocks are not released for reuse until all file handles are closed. This ends up being more of an annoyance than a benefit when long-running jobs put big f

Re: [Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-07 Thread Jerry Feldman
Additionally, you can use debugfs along with the inode to create a link On Mon, Jul 6, 2020 at 1:37 PM Bill Bogstad wrote: > I just learned a technique to recover the contents of an open but > deleted file which I wanted to share here. The trick is to use the > /proc/PID/fd/# file. The file h

[Discuss] recover contents of deleted but still open file on a Linux system.

2020-07-06 Thread Bill Bogstad
I just learned a technique to recover the contents of an open but deleted file which I wanted to share here. The trick is to use the /proc/PID/fd/# file. The file has to still be open by some process on the system. While you can't link the entry in the /proc directory back to a real filesystem