LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-12-2018, 02:57 AM   #1
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Rep: Reputation: Disabled
Recover specific files


Hi
I have accidentally deleted my following directory (Shift+Del):
~/Text/Books/Downloaded
which contains some valuable downloaded books.
I tried 'photorec' to recover my data but it starts to recover everything and I don't want to recover every deleted item.
So, is there a software which can only look under:
~/Text/Books
or
~/Text
and recover only needed files?
Regards
 
Old 09-12-2018, 03:06 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Have a go with testdisk.
 
Old 09-12-2018, 03:30 AM   #3
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
Have a go with testdisk.
Isn't "testdisk" and "photorec" same thing? I am using Manjaro Linux and when I queried for "photorec" it gave me "testdisk" in search results. So I installed and tried "testdisk" but it starts to restore everything, instead of specific directory.
PS: I want recovery software to only look under ~/Text/Books.
 
Old 09-12-2018, 03:34 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by zetrotrack000 View Post
So, is there a software which can only look under:
~/Text/Books
or
~/Text
and recover only needed files?
No.

Photorec allows you to nominate specific file types (pdf or epub ...) and only restore them. But it will look for all of that type. It's up to you to rename them appropriately as that data is no longer aavailable unless the files are tagged and you can extract that for a rename script.
Quote:
I have accidentally deleted my following directory (Shift+Del):
Seriously - how is that in any way "accidental" ?.

Note my sigline.
 
Old 09-12-2018, 03:50 AM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by zetrotrack000 View Post
Isn't "testdisk" and "photorec" same thing? I am using Manjaro Linux and when I queried for "photorec" it gave me "testdisk" in search results. So I installed and tried "testdisk" but it starts to restore everything, instead of specific directory.
PS: I want recovery software to only look under ~/Text/Books.
No, although the two applications come bundled in the same package, called testdisk.

How to use testdisk to recover deleted files:

https://itsfoss.com/recover-deleted-files-linux/

I would suggest you recover files to an external device if possible to avoid over-writing your existing deleted files, until you have recovered as many as you can.
 
Old 09-12-2018, 04:02 AM   #6
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Seriously - how is that in any way "accidental" ?.
It happens when you have two directories:
1. Downloads
2. downloads
 
Old 09-12-2018, 04:04 AM   #7
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
It means that targeting specific directory is not possible.
 
Old 09-12-2018, 04:07 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by zetrotrack000 View Post
It means that targeting specific directory is not possible.
Did you read the article for which I provided the link?
 
1 members found this post helpful.
Old 09-12-2018, 04:54 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I wonder how many on this list use VFAT for this sort of thing. Common Linux inode filesystems with indirect inodes and extents aren't subject to recovery like that AFAIR.
Attempts have been made to parse any uncommitted journal entries to back-track into the filesystem space, but with apparently limited success.
 
Old 09-12-2018, 05:25 AM   #10
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
Did you read the article for which I provided the link?
Yes, I have gone through it and also watched the embedded video. Photorec has an option to select filetypes (like pdf) but then it starts to recover every pdf file. I got pdfs even from last year and the deleted data so huge that I don't have capacity to restore all the files.
 
Old 09-12-2018, 05:26 AM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by zetrotrack000 View Post
Yes, I have gone through it and also watched the embedded video. Photorec has an option to select filetypes (like pdf) but then it starts to recover every pdf file. I got pdfs even from last year and the deleted data so huge that I don't have capacity to restore all the files.
The article isn't about photorec. The article is about testdisk.

You need to read it again.
 
Old 09-12-2018, 05:56 AM   #12
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
The article isn't about photorec. The article is about testdisk.

You need to read it again.
Yes, I know. testdisk is also installed along with photorec. However, it has different options like "undelete a partition", "Create an image", "Partition Analysis". I have checked these options. Am I missing something here? Isn't testdrive for whole partition/disk, instead of individual files?
 
Old 09-12-2018, 06:06 AM   #13
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by zetrotrack000 View Post
Yes, I know. testdisk is also installed along with photorec. However, it has different options like "undelete a partition", "Create an image", "Partition Analysis". I have checked these options. Am I missing something here? Isn't testdrive for whole partition/disk, instead of individual files?
If you read the article, you will see that testdisk also has an Advanced mode which allows you to select individual files to recover (if it is possible to recover them). You can also select recovery of all the files in a directory.

Edit: Note that in the version of testdisk I have, 7.0, "Undelete" in the article is now "List".

Last edited by hydrurga; 09-12-2018 at 06:13 AM.
 
1 members found this post helpful.
Old 09-12-2018, 09:51 AM   #14
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
If you read the article, you will see that testdisk also has an Advanced mode which allows you to select individual files to recover (if it is possible to recover them). You can also select recovery of all the files in a directory.

Edit: Note that in the version of testdisk I have, 7.0, "Undelete" in the article is now "List".
Now I got it. Thanks a lot
 
Old 09-12-2018, 10:40 AM   #15
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by zetrotrack000 View Post
Now I got it. Thanks a lot
Great. Did you manage to recover any files?
 
  


Reply



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
[SOLVED] Help - trying to MD5SUM files after removing specific lines from some of the files. sk1ds Programming 5 05-10-2013 09:36 AM
how to recover files if accidentally deleted files in mysql Majed17 Linux - Software 3 03-02-2013 09:34 AM
How to copy a specific no of files from a group of files biswa_nayak Programming 2 05-11-2008 12:21 PM
Compare files in specific directory to files on CD szim90 Linux - Newbie 3 02-10-2007 08:39 PM
Recover Files Pablop Linux - Newbie 3 10-19-2005 05:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:11 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