Operating System - HP-UX
1819736 Members
3093 Online
109606 Solutions
New Discussion юеВ

Re: Can we Recover deleted file in Unix

 
SOLVED
Go to solution
Ezhilarasan
Occasional Advisor

Can we Recover deleted file in Unix

Hi,

In LAN, there is command Recover to get
back deleted file. If we run command Purge,
we can not recover deleted files.

Likewise, is there any way to recover deleted
file in UNIX ?

Thanks
R. Ezhil

10 REPLIES 10
Michael Tully
Honored Contributor

Re: Can we Recover deleted file in Unix

The only way to get files back in Unix is recover them from backup tape. Unix does not have an undelete function, or recycle bin.
Anyone for a Mutiny ?
Yogeeraj_1
Honored Contributor

Re: Can we Recover deleted file in Unix

hi,

unless your "delete" script moves the files to another "trash" directory, i fear that you don't have any other alternative than to recover from backup.

In X environment, however you can configure, the same as in Windoze enviroment, a place where to keep delete files - a "TRASH BIN"

Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Ravi_8
Honored Contributor

Re: Can we Recover deleted file in Unix

Hi,

UNIX doesn't have Recyclebin or undelete command to recover lost files. Only way is retrieve from backup unless you don't have link or copy
never give up
Rajeev  Shukla
Honored Contributor
Solution

Re: Can we Recover deleted file in Unix

I haven't tried, but i know people and my other friends have recovered a deleted file in Unix. Its possible only if you knew the Inode number of the file before you deleted then you could recover that file and also nothing should have been written over that space. That is no changes should have been made to the filesystem and you know teh Inode number, then it is possible.

Cheers
Rajeev
Frank Slootweg
Honored Contributor

Re: Can we Recover deleted file in Unix

Maybe it is different on vxfs/JFS (I only have (this) experience with HFS), but (for HFS) you do not only need the inode *number*, but also the inode *content*, especially the block pointers. When a (HFS) file is removed, the inode number in the directory is cleared (set to zero) and the block pointers are cleared (set to zero) as well, so unless you can find the blocks in some other way (for example by grep(1)-ping the whole LV), there is no way to 'undelete' a (HFS) file.

Perhaps others can describe the situation for vxfs/JFS.
Bill Hassell
Honored Contributor

Re: Can we Recover deleted file in Unix

Without extensive knowledge of the hfs or vxfs filesystem and a lot of spare time to learn how to poke around on the disk, about the only practical way to locate a removed file is to use dd on the raw logical volume and pipe the the results to grep, looking for something within the file that is unique. By playing around (for hours), you should be able to find most of the pieces since the space is not cleared.

NOTE: If the filesystem is busy (adding/deleting) other files, the deleted space will probably be reused very quickly in which case there is no hope in recovering the file.

"There are only two types of computer users in the world: those that have lost dayta and those that are going to."


Bill Hassell, sysadmin
John Bolene
Honored Contributor

Re: Can we Recover deleted file in Unix

On LAN to recover a file?

Not understanding here.

LAN is a network, how do you recover a file on a communications device?

On UNIX, you delete it, you better have wanted to delete it as it is gone, gone, gone.

Did I say GONE?

Recovery of files is by some means of a backup file that you saved somewhere, be it on tape or disk.

You cannot get back the file you deleted.

This is not Microsoft.

Oops, there I said that bad word that will get my message examined and edited by the forum administrator.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Steven E. Protter
Exalted Contributor

Re: Can we Recover deleted file in Unix

There are third party programs for Windows NT and some flavors of Unix that create teh illusion of a recycle bin. They are resource instensive and that includes CPU overhead.

P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill McNAMARA_1
Honored Contributor

Re: Can we Recover deleted file in Unix

restore from backup ;)
It works for me (tm)
Dietmar Konermann
Honored Contributor

Re: Can we Recover deleted file in Unix

BTW, it's quite straight-forward to get a VxFS file back after unlink()ing it, if (and only if) some process has it still open. In this situation the inode information is still valid.

Imagine a Database, which is still running and someone accidently removed some data files... DON'T STOP the database. Log a call with HP asking for an VxFS expert, before touching anything. :-)

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)