LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-17-2013, 12:59 AM   #1
inkscape
Member
 
Registered: Dec 2011
Distribution: Slackware 14.1
Posts: 33

Rep: Reputation: Disabled
How to recovery files with original names?


I use
Code:
rm -fr *.mp4
in wrong directory, so I need recovery files. Directory is in my home partition.
So, It's possibility recovery with original names or last names?
 
Old 01-17-2013, 01:06 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Try the photorec or Testdisk utilities, but you should stop using the system asap, as it may overwrite the 'deleted' files.

If the system was using a GUI and has a Trash icon, you may find the files in there, without using the utilities.
 
Old 01-17-2013, 02:05 AM   #3
inkscape
Member
 
Registered: Dec 2011
Distribution: Slackware 14.1
Posts: 33

Original Poster
Rep: Reputation: Disabled
What is asap system?
I haven't files in trash.

I use photorec but it hasn't output original names. ;(
(only fnumber.mp4 ....)

I care about restoring .mp4 files before 48 hours with original names.

Last edited by inkscape; 01-17-2013 at 02:07 AM.
 
Old 01-17-2013, 02:12 AM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,488

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
FYI, ASAP = As Soon As Possible
FYI = For Your Information
 
Old 01-17-2013, 02:48 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,202

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Quote:
Originally Posted by inkscape View Post
I care about restoring .mp4 files before 48 hours with original names.
In which case you should simply restore them from your backup.
 
Old 01-17-2013, 03:10 AM   #6
inkscape
Member
 
Registered: Dec 2011
Distribution: Slackware 14.1
Posts: 33

Original Poster
Rep: Reputation: Disabled
I haven't backup.
I modified some parameters (sync audio, codec etc) and I haven't finished work.
I don't want start from scratch and lost effect.

So, I haven't chance to restore files from a specific directory, last modification time?
 
Old 01-17-2013, 05:27 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,517
Blog Entries: 2

Rep: Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018
You may have a chance with using ext3undelete. But if you have used the system since you deleted the file chances are high that the files are already overwritten, so unrecoverable.
The most important principle of data recovery is not allowing any writes to the partition where the files are on.
 
Old 01-17-2013, 07:34 AM   #8
inkscape
Member
 
Registered: Dec 2011
Distribution: Slackware 14.1
Posts: 33

Original Poster
Rep: Reputation: Disabled
I read opitions extundelete. This command:
Code:
extundelete /dev/sda3 --restore-directory ~/Wideo/ --after 1358323320
will be ok?
 
Old 01-17-2013, 07:37 AM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,517
Blog Entries: 2

Rep: Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018
Never tried it and don't have it installed on my systems, so I can't say.

Are you still using the OS which you used to delete those files?
 
Old 01-17-2013, 07:37 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,118
Blog Entries: 54

Rep: Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785
...additionally a single file gets a single inode assigned.
This inode holds, among other things, information like the file name.
If the link between inode and file is broken that information is lost.
 
Old 01-17-2013, 08:12 AM   #11
inkscape
Member
 
Registered: Dec 2011
Distribution: Slackware 14.1
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD
Are you still using the OS which you used to delete those files?
I turn off machine yesterday. But I try my command (first umount sda3):
Code:
#extundelete /dev/sda3 --restore-directory /home/user/Wideo/lost --after 1358323320
Only show and process deleted entries if they are deleted on or after 1358323320 and before 2147483647.

WARNING: Extended attributes are not restored.
Loading filesystem metadata ... 1745 groups loaded.
Loading journal descriptors ... 29855 descriptors loaded.
Failed to restore file /home/user/Wideo/lost
Could not find correct inode number past inode 1835010
 
Old 01-17-2013, 02:02 PM   #12
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,408

Rep: Reputation: 594Reputation: 594Reputation: 594Reputation: 594Reputation: 594Reputation: 594
Quote:
Originally Posted by unSpawn View Post
...additionally a single file gets a single inode assigned.
This inode holds, among other things, information like the file name.
If the link between inode and file is broken that information is lost.
The inode does not contain the file name. Only the directory entry contains the name, and that is lost when the file is unlinked by the rm command.
 
1 members found this post helpful.
Old 01-17-2013, 03:50 PM   #13
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,408

Rep: Reputation: 594Reputation: 594Reputation: 594Reputation: 594Reputation: 594Reputation: 594
What you might be able to do is use debugfs to dump the data blocks for that directory and then examine the output with a hex editor. That should help you remap the photorec filenumbers to their original names. Beware that the directory may contain entries for older versions of files, and anything you've done in that directory may have overwritten some of what you need, so it's going to take some work to sort it out.
Code:
# debugfs /dev/sda3
debugfs: dump home/user/Wideo /var/tmp/dirdata
debugfs: quit
#
In /var/tmp/dirdata you'll see filenames in text, each preceded by some binary data including the inode number (little-endian). At least that's the case for ext2 and ext3. I haven't had occasion to look at the on-disk directory format variants for ext4. With a little luck and a lot of effort you may be able to restore the original names for most of those deleted files.
 
  


Reply

Tags
recovery


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
Convert many files to individual .bz2 files retaining original name? touser Linux - Newbie 5 03-29-2010 12:58 AM
zip files on their original folders Hioushi Linux - General 9 09-04-2008 06:25 PM
Getting Picasa to modify original files? ylikone Linux - Software 1 08-09-2006 08:52 AM
SAMBA: display of share names is OK but files names are wrong superandrzej Linux - Software 5 02-02-2004 09:14 AM
original config files Lempour Slackware 8 10-29-2003 11:56 AM


All times are GMT -5. The time now is 07:30 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration