How to Recover data after rm command

4,607 views
Skip to first unread message

Parveen Arora

unread,
Aug 11, 2010, 7:44:27 AM8/11/10
to iitdlug
Hello Everyone,
I have lost my very important data
which was the backup of my site bu mistake with rm command.

Actually i have to rename the file, and i used rm command accidently
inplace of mv.
I need it immidiately, becuause it was my project of 2 months.

So Please help me immidiately, if there is way to recover it.

Thank's in advance.

--
Parveen Arora
www.royallinux.co.cc

Nilesh Govindarajan

unread,
Aug 11, 2010, 8:06:15 AM8/11/10
to iit...@googlegroups.com
On 08/11/2010 05:14 PM, Parveen Arora wrote:
> Hello Everyone,
> I have lost my very important data
> which was the backup of my site bu mistake with rm command.
>
> Actually i have to rename the file, and i used rm command accidently
> inplace of mv.
> I need it immidiately, becuause it was my project of 2 months.
>
> So Please help me immidiately, if there is way to recover it.
>
> Thank's in advance.
>
Did you shutdown/restart/use any other application/did any writing
activity after that rm?
If yes, that CANNOT be recovered.

--
Regards,
Nilesh Govindarajan
Facebook: http://www.facebook.com/nilesh.gr
Twitter: http://twitter.com/nileshgr
Website: http://www.itech7.com
VPS Hosting: http://www.itech7.com/a/vps

Nanda

unread,
Aug 11, 2010, 8:28:51 AM8/11/10
to iit...@googlegroups.com
Out of curiosity am asking this question.
If not, then how do we recover ?




--
Regards,
Nanda

Varsha Jaikumar

unread,
Aug 11, 2010, 8:33:53 AM8/11/10
to iit...@googlegroups.com
On Wed, Aug 11, 2010 at 5:14 PM, Parveen Arora <prince....@gmail.com> wrote:
Hello Everyone,
I have lost my very important data
which was the backup of my site bu mistake with rm command.

Actually i have to rename the file, and i used rm command accidently
inplace of mv.
I need it immidiately, becuause it was my project of 2 months.

So Please help me immidiately, if there is way to recover it.

Thank's in advance.

--
Parveen Arora
www.royallinux.co.cc



--
Varsha Jaikumar
Computer Science & Engineering (4th Year)
National Institute of Technology
Durgapur
Blog: http://varshamyspace.blogspot.com/



Parveen Arora

unread,
Aug 11, 2010, 9:11:23 AM8/11/10
to iit...@googlegroups.com
On Wed, Aug 11, 2010 at 8:06 AM, Nilesh Govindarajan <li...@itech7.com> wrote:
>  On 08/11/2010 05:14 PM, Parveen Arora wrote:
>>
>> Hello Everyone,
>> I have lost my very important data
>> which was the backup of my site bu mistake with rm command.
>>
>> Actually i have to rename the file, and i used rm command accidently
>> inplace of mv.
>> I need it immidiately, becuause it was my project of 2 months.
>>
>> So Please help me immidiately, if there is way to recover it.
>>
>> Thank's in advance.
>>
> Did you shutdown/restart/use any other application/did any writing activity
> after that rm?
No, i have not done nither of this, no shutdown/restart

>
> --
> Regards,
> Nilesh Govindarajan
> Facebook: http://www.facebook.com/nilesh.gr
> Twitter: http://twitter.com/nileshgr
> Website: http://www.itech7.com
> VPS Hosting: http://www.itech7.com/a/vps
>
> --
> LUG@IITD - http://tinyurl.com/ycueutm
>

--
Parveen Arora
www.royallinux.co.cc

Nilesh Govindarajan

unread,
Aug 11, 2010, 9:23:03 AM8/11/10
to iit...@googlegroups.com

Then by luck, you may be able to recover it using debugfs.
Run debugfs /dev/<hdd-device> as root. It will give you a prompt. At the
prompt, type lsdel and press enter (keep your fingers crossed & pray hard).
If it lists some inodes, use the undel command (of debugfs) and give it
a temporary path.
See man debugfs for more info.
undel <inode> (include the angle brackets).

Parveen Arora

unread,
Aug 11, 2010, 9:46:48 AM8/11/10
to iit...@googlegroups.com

it was in my Downloads folder, should i give path ~/Downloads like this?
--
Parveen Arora
www.royallinux.co.cc

Nilesh Govindarajan

unread,
Aug 11, 2010, 10:45:22 AM8/11/10
to iit...@googlegroups.com
>> prompt, type lsdel and press enter (keep your fingers crossed& pray hard).

>> If it lists some inodes, use the undel command (of debugfs) and give it a
>> temporary path.
>> See man debugfs for more info.
>> undel<inode> (include the angle brackets).
> it was in my Downloads folder, should i give path ~/Downloads like this?

No, don't do that. Just recover the inodes.
Actually I've never used it to recover deleted files and hence I don't
know much about it.
As per the man page, it suggests that you should undel all inodes and
then run e2fsck to get back the files in the lost+found directory.

And yeah, I forgot to mention that this works ONLY WITH ext*.

Nilesh Govindarajan

unread,
Aug 11, 2010, 10:49:19 AM8/11/10
to iit...@googlegroups.com

One more thing, run debugfs -w instead of just debugfs. Because the
latter mounts the FS read only. Also ensure that a lost+found directory
exists (usually it is created automatically by e2fsck if it doesn't exist).

adnan.shoeb

unread,
Aug 12, 2010, 1:12:04 AM8/12/10
to iit...@googlegroups.com
Hi Praveen-

The below link will help you to recover.


http://linuxtrove.com/wp/?p=240

Abhinay melhotra

unread,
Aug 12, 2010, 1:45:19 AM8/12/10
to iit...@googlegroups.com
  

try this link its useful and trusted

http://www.r-tt.com/data_recovery_linux/

h4nnibal

unread,
Aug 12, 2010, 2:36:56 AM8/12/10
to iit...@googlegroups.com
Did you try the tool called "foremost"
It helps recovery by the information in the file's header.

Arjun.S.R
College of Engineering Trivandrum
Reply all
Reply to author
Forward
0 new messages