Recover deleted files on Linux server

Login or Register to Reply

Thread Tools Search this Thread
# 8  
Originally Posted by reminisce
Note: The directory was deleted with other use not root user.
That is irrelevant - dead is dead and deleted is deleted.

Originally Posted by reminisce
In one of the youtube link ,the admin provided some steps to get back the lost files.

As first step, below command needs to be executed :
ps -aux | grep <filename>
As an output, I could find the file and process id .
That may help as long as the process is running: when a file is deleted the system routine unlink() is used, which deletes the inode (and thus every possibility to access the files data). As long as at least one process still has this file opened, though, the unlink() is postponed, so the process still can access the file even though "from outside" the file already ceases to exist.

This means, if you can somehow get "inside" the process in question and if you can bring the process to write the file (or, at least, its inode information) then you can use this to restore the file, otherwise it is lost.

You might have luck with trying TestDisk as long as you haven't done anything further on that filesystem. My suggestion is to unmount it as soon as possible (preferably: NOW!) because the longer it is in use the bigger the chance that data which are still there (but unaccessible right now) will be overwritten (=definitely and ultimately lost forever).

I hope this helps.

# 9  
Originally Posted by reminisce
This is the filesystem that is mounted on:
/dev/xvda2 on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
For debugfs to work on linux systems you need to use lsdel (list deleted files), for example:

linux:/tmp# debugfs /dev/md0 

debugfs 1.44.1 (24-Mar-2018)
debugfs:  lsdel

However, according to the man page:

debugfs - ext2/ext3/ext4 file system debugger
This means that debugfs should not work for a zfs file system.

I do not use the xfs filesystem on any server, so I cannot help on xfs.

I suggest you find something similar to debugfs that works on the xfs filesystem which will help you locale deleted files (if the the deleted inode entries have not yet been cleared).
# 10  
Hint: Try searching for:

xfs_db - debug an XFS filesystem
This User Gave Thanks to Neo For This Post:
Login or Register to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
How to recover the deleted file in Linux?
hi, i deleted one file from linux please let me know, if we can recover it ? if yes, pls let me know the steps to do..... UNIX for Advanced & Expert Users
UNIX for Advanced & Expert Users
Recover deleted files from linux server machine..
Hi, I am working Linux server machine. Somebody by mistake(or may be knowingly) deleted few folders and files from the machine. How is this possible to recover those files and folders????:confused: I normally logged in through Putty and winscp only. And don't have any history for putty...... Red Hat
Red Hat
Need to Recover Deleted Files
Hi, By mistake, executed the following command : rm -rf * and ALL files got deleted. But I need to get back these files as they are very very important. Please help me how to recover this file. Its Urgent for me please. Thanks in advance.... Shell Programming and Scripting
Shell Programming and Scripting
recover deleted files
How to recover deleted files in AIX ?... AIX
Recover deleted files
Is there a Unix tool, like in Novell, to recover accidentally deleted files?... UNIX for Dummies Questions & Answers
UNIX for Dummies Questions & Answers