LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-21-2009, 04:42 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 49
Data recovery for files deleted from USB drive


Hi,

So I was in Windows XP and I deleted a video file (.wmv) from my USB drive (FAT partition) by mistake. Is it possible to recover that deleted file in Linux using some free recovery tools?

I have a Debian 5.0 as my Linux system.

Last edited by kushalkoolwal; 05-21-2009 at 08:04 PM.
 
Old 05-21-2009, 07:10 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Depends on the format, but probably. Mount the drive READ-ONLY until you take an image. Otherwise you risk overwriting the file you want to recover. Then the steps I use are
Code:
1. aptitude install testdisk
2. Make an image of the drive using dd (i.e. dd if=/dev/sdb of=~/image.img)
3. Run photorec (part of testdisk) from the command line on the image to recover the video file
It won't be named the same, but you'll get it back as long as you didn't write anything over it.

Here's a list of the formats that can be recovered by photorec.

If the format is unsupported by photorec, you can use foremost, but you'll probably have to find the header info from a similar type of movie file and write your own rule.
 
Old 05-21-2009, 08:14 PM   #3
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by pljvaldez View Post
Depends on the format, but probably. Mount the drive READ-ONLY until you take an image. Otherwise you risk overwriting the file you want to recover. Then the steps I use are
Code:
1. aptitude install testdisk
2. Make an image of the drive using dd (i.e. dd if=/dev/sdb of=~/image.img)
3. Run photorec (part of testdisk) from the command line on the image to recover the video file
It won't be named the same, but you'll get it back as long as you didn't write anything over it.

Here's a list of the formats that can be recovered by photorec.

If the format is unsupported by photorec, you can use foremost, but you'll probably have to find the header info from a similar type of movie file and write your own rule.
Ok thanks. I think I will try your suggestion. The format of the video file is wmv. Looks like this is not supported as per the link that you gave but in any case I will go ahead and give it a try.
 
Old 05-21-2009, 08:26 PM   #4
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by kushalkoolwal View Post
Ok thanks. I think I will try your suggestion. The format of the video file is wmv. Looks like this is not supported as per the link that you gave but in any case I will go ahead and give it a try.

Guess what...the photorec discovered the lost file as <somenumber>.asf. First I thought it be some garbage but then when I looked at its size it showed 1/2 GB and then when I tried to play in Linux and Windows it works fine....Hurray....The file was recovered.

Wonder why Linux rename the extension from wmv to asf. Are they analogous to each other?

Thanks pljvaldez for the tip.
 
Old 05-22-2009, 10:40 AM   #5
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
http://en.wikipedia.org/wiki/Windows_Media_Video
 
Old 05-22-2009, 10:42 AM   #6
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Quote:
Originally Posted by kushalkoolwal View Post
Ok thanks. I think I will try your suggestion. The format of the video file is wmv. Looks like this is not supported as per the link that you gave but in any case I will go ahead and give it a try.
wmv is actually on the same line as *.asf in the file type list. Glad you got your file back!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Use Linux to recover deleted files from NTFS USB drive writedom Linux - Newbie 2 06-05-2008 11:01 PM
recovery of deleted files linux4real Linux - Newbie 7 06-29-2006 08:14 AM
recovery of deleted files linux4real Linux - Software 3 06-27-2006 01:13 PM
recovery of deleted files linux4real Linux - General 1 06-27-2006 09:32 AM
data recovery (deleted by rm -R) lavluda Debian 9 02-16-2006 04:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration