Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

recover deleted (but running) executable

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
skunk
l33t
l33t
User avatar
Posts: 646
Joined: Wed May 28, 2003 11:24 pm
Location: granada, spain
Contact:
Contact skunk
Website

recover deleted (but running) executable

  • Quote

Post by skunk » Sat Aug 02, 2014 12:45 pm

hi all,
i've accidentally deleted a still running executable and i've thought it could be restored simply copying /proc/$PID/exe, but it's not because it's a (broken) symlink to the deleted file...
with lsof i can still see the inode of the file, so my questions are: is it possible to hardlink the inode? how?
if not, is there any other way to recover the executable?
thank you
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Sat Aug 02, 2014 3:59 pm

Does this help?

FYI.
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
skunk
l33t
l33t
User avatar
Posts: 646
Joined: Wed May 28, 2003 11:24 pm
Location: granada, spain
Contact:
Contact skunk
Website

  • Quote

Post by skunk » Sat Aug 02, 2014 5:00 pm

unfortunately i had to reboot, so i finally had to rebuild the deleted executable...
but for the sake to try and learning something new (at least for me), i've replicated the situation:

Code: Select all

$ ls -li test
28454299 -rwxr-xr-x 1 skunk skunk 5613016 Aug  2 18:31 test
$ ./test &
$ rm test
$ ps ax|grep test
18866 pts/8    Sl+    0:08 ./test
lsof -p18866|grep /home/skunk/test
test    18866 skunk  txt    REG                8,3  5613016 28454299 /home/skunk/test (deleted)
# debugfs -w /dev/sda3
debugfs 1.42.10 (18-May-2014)
debugfs:  logdump -i <28454299>
Inode 28454299 is at group 3473, block 113771148, offset 3328
Journal starts at block 24724, transaction 12843711
No magic number at block 27541: end of journal.
# mount|grep debugfs
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
filesystem is ext4, do i need CONFIG_EXT4_DEBUG enabled?
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Fri Aug 15, 2014 8:38 pm

skunk wrote:filesystem is ext4, do i need CONFIG_EXT4_DEBUG enabled?
I really have no idea as I never had to test it. As an alternate solution you also have testdisk as explained in the article I linked to.
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
Post Reply

4 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic