How to recover deleted files in ubuntu using live usb? [based on filetype]how to recover deleted files that are deleted using rm?Nautilus is very buggy recently, just lost 200 photos. Anyone else having trouble too?Recover deleted .docx filesHow do I move (copy) my entire Ubuntu system to a different hard disk?How do I make a bootable Ubuntu USB?Do not understand where files have been moved by find + execFinding files deleted from shared partitionFiles and folders automatically deleted. How to recover them?Recovering data in formatted partitionIs there any way to log activites performed by a user(another super user)?How to recover deleted files in ubuntu?how to recover the deleted user's data on ubuntu server?Recover deleted encrypted home dir after Ubuntu install over partitionrecover files from ubuntuBoot from USB to recover existing files?how to recover deleted files by ubuntuHow to recover deleted user with data in Ubuntu 14.04Files and folders automatically deleted. How to recover them?How to recover deleted files which are on windows virtual machine on VirtualBox?Recover deleted files from encrypted drive

Are relativity and doppler effect related?

How well should I expect Adam to work?

Employee lack of ownership

Recruiter wants very extensive technical details about all of my previous work

How do I hide Chekhov's Gun?

Have the tides ever turned twice on any open problem?

A single argument pattern definition applies to multiple-argument patterns?

If I can solve Sudoku, can I solve the Travelling Salesman Problem (TSP)? If so, how?

My adviser wants to be the first author

Professor being mistaken for a grad student

Python if-else code style for reduced code for rounding floats

Describing a chess game in a novel

Why does overlay work only on the first tcolorbox?

What do you call the act of removing a part of a word and replacing it with an apostrophe

Bacteria contamination inside a thermos bottle

Is it insecure to send a password in a `curl` command?

What is a ^ b and (a & b) << 1?

Why do passenger jet manufacturers design their planes with stall prevention systems?

Knife as defense against stray dogs

How do you talk to someone whose loved one is dying?

Are ETF trackers fundamentally better than individual stocks?

Happy pi day, everyone!

How to plot polar formed complex numbers?

ERC721: How to get the owned tokens of an address



How to recover deleted files in ubuntu using live usb? [based on filetype]


how to recover deleted files that are deleted using rm?Nautilus is very buggy recently, just lost 200 photos. Anyone else having trouble too?Recover deleted .docx filesHow do I move (copy) my entire Ubuntu system to a different hard disk?How do I make a bootable Ubuntu USB?Do not understand where files have been moved by find + execFinding files deleted from shared partitionFiles and folders automatically deleted. How to recover them?Recovering data in formatted partitionIs there any way to log activites performed by a user(another super user)?How to recover deleted files in ubuntu?how to recover the deleted user's data on ubuntu server?Recover deleted encrypted home dir after Ubuntu install over partitionrecover files from ubuntuBoot from USB to recover existing files?how to recover deleted files by ubuntuHow to recover deleted user with data in Ubuntu 14.04Files and folders automatically deleted. How to recover them?How to recover deleted files which are on windows virtual machine on VirtualBox?Recover deleted files from encrypted drive













8















I had accidentally deleted a few files from an Ubuntu Desktop.
Now I need to recover only the perl files which had been sitting in /home/user directory.
How can this be done?
I am able to boot using a live Ubuntu USB.
Please explain.










share|improve this question






















  • Using photorec is probably not a viable solution, unless you have a separate home partition; running it on the root partition will have the effect of recovering thousands of files without any metadata (i.e. with a filname generated by photorec on-the-fly, not useful to understand which files are the files you're looking for; at the very least you'll need to use grep -l '#!/usr/bin/perl' or variations and hope that not too many perl scripts exist / have existed in your system). Using testdisk you should be able to recover just the deleted folder / files by browsing the filesystem.

    – kos
    Sep 20 '15 at 11:55











  • I suggest you to shut down the system immediately, to avoid the files being overwritten, and to boot a Live DVD / USB and do things from there: here's an answer I gave some time ago about using testdisk; you should be able to adapt it and use it to recover the files; if no avail, you should try karel's solution, but you'll need to go through all the files somehow

    – kos
    Sep 20 '15 at 12:00
















8















I had accidentally deleted a few files from an Ubuntu Desktop.
Now I need to recover only the perl files which had been sitting in /home/user directory.
How can this be done?
I am able to boot using a live Ubuntu USB.
Please explain.










share|improve this question






















  • Using photorec is probably not a viable solution, unless you have a separate home partition; running it on the root partition will have the effect of recovering thousands of files without any metadata (i.e. with a filname generated by photorec on-the-fly, not useful to understand which files are the files you're looking for; at the very least you'll need to use grep -l '#!/usr/bin/perl' or variations and hope that not too many perl scripts exist / have existed in your system). Using testdisk you should be able to recover just the deleted folder / files by browsing the filesystem.

    – kos
    Sep 20 '15 at 11:55











  • I suggest you to shut down the system immediately, to avoid the files being overwritten, and to boot a Live DVD / USB and do things from there: here's an answer I gave some time ago about using testdisk; you should be able to adapt it and use it to recover the files; if no avail, you should try karel's solution, but you'll need to go through all the files somehow

    – kos
    Sep 20 '15 at 12:00














8












8








8


2






I had accidentally deleted a few files from an Ubuntu Desktop.
Now I need to recover only the perl files which had been sitting in /home/user directory.
How can this be done?
I am able to boot using a live Ubuntu USB.
Please explain.










share|improve this question














I had accidentally deleted a few files from an Ubuntu Desktop.
Now I need to recover only the perl files which had been sitting in /home/user directory.
How can this be done?
I am able to boot using a live Ubuntu USB.
Please explain.







command-line filesystem files data-recovery






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 20 '15 at 10:30









kiran bbnlkiran bbnl

25441025




25441025












  • Using photorec is probably not a viable solution, unless you have a separate home partition; running it on the root partition will have the effect of recovering thousands of files without any metadata (i.e. with a filname generated by photorec on-the-fly, not useful to understand which files are the files you're looking for; at the very least you'll need to use grep -l '#!/usr/bin/perl' or variations and hope that not too many perl scripts exist / have existed in your system). Using testdisk you should be able to recover just the deleted folder / files by browsing the filesystem.

    – kos
    Sep 20 '15 at 11:55











  • I suggest you to shut down the system immediately, to avoid the files being overwritten, and to boot a Live DVD / USB and do things from there: here's an answer I gave some time ago about using testdisk; you should be able to adapt it and use it to recover the files; if no avail, you should try karel's solution, but you'll need to go through all the files somehow

    – kos
    Sep 20 '15 at 12:00


















  • Using photorec is probably not a viable solution, unless you have a separate home partition; running it on the root partition will have the effect of recovering thousands of files without any metadata (i.e. with a filname generated by photorec on-the-fly, not useful to understand which files are the files you're looking for; at the very least you'll need to use grep -l '#!/usr/bin/perl' or variations and hope that not too many perl scripts exist / have existed in your system). Using testdisk you should be able to recover just the deleted folder / files by browsing the filesystem.

    – kos
    Sep 20 '15 at 11:55











  • I suggest you to shut down the system immediately, to avoid the files being overwritten, and to boot a Live DVD / USB and do things from there: here's an answer I gave some time ago about using testdisk; you should be able to adapt it and use it to recover the files; if no avail, you should try karel's solution, but you'll need to go through all the files somehow

    – kos
    Sep 20 '15 at 12:00

















Using photorec is probably not a viable solution, unless you have a separate home partition; running it on the root partition will have the effect of recovering thousands of files without any metadata (i.e. with a filname generated by photorec on-the-fly, not useful to understand which files are the files you're looking for; at the very least you'll need to use grep -l '#!/usr/bin/perl' or variations and hope that not too many perl scripts exist / have existed in your system). Using testdisk you should be able to recover just the deleted folder / files by browsing the filesystem.

– kos
Sep 20 '15 at 11:55





Using photorec is probably not a viable solution, unless you have a separate home partition; running it on the root partition will have the effect of recovering thousands of files without any metadata (i.e. with a filname generated by photorec on-the-fly, not useful to understand which files are the files you're looking for; at the very least you'll need to use grep -l '#!/usr/bin/perl' or variations and hope that not too many perl scripts exist / have existed in your system). Using testdisk you should be able to recover just the deleted folder / files by browsing the filesystem.

– kos
Sep 20 '15 at 11:55













I suggest you to shut down the system immediately, to avoid the files being overwritten, and to boot a Live DVD / USB and do things from there: here's an answer I gave some time ago about using testdisk; you should be able to adapt it and use it to recover the files; if no avail, you should try karel's solution, but you'll need to go through all the files somehow

– kos
Sep 20 '15 at 12:00






I suggest you to shut down the system immediately, to avoid the files being overwritten, and to boot a Live DVD / USB and do things from there: here's an answer I gave some time ago about using testdisk; you should be able to adapt it and use it to recover the files; if no avail, you should try karel's solution, but you'll need to go through all the files somehow

– kos
Sep 20 '15 at 12:00











2 Answers
2






active

oldest

votes


















13














Before you start:



  • It's always a good idea to work from a copy of your deleted data, so copy your entire disk before you begin

  • If you cannot, boot from a Live-USB/DVD before you begin.

  • If you cannot, know that by each and every single byte you write to your disk right now, one byte of one of your deleted files will be overwritten! (i.e. by installing PhotoRec and TestDisk, some deleted files will be overwritten by the applications that you're going to install if you continue!).


What are the main differences between TestDisk and PhotoRec?



TestDisk is a lot more efficient than PhotoRec. The problem with TestDisk is that it doesn't always recover all deleted files. If you accidentally reformat a partition, TestDisk can recover thousands of files without missing a single file, but if you deleted a file by sending it to the Trash and then emptying the Trash, TestDisk can't always recover it.



So use TestDisk first, and if you recovered all of the deleted files with TestDisk, then you're done. If you recovered most of the deleted files with TestDisk, you can decide whether you're done or not. If you're not done after running TestDisk, you can try recovering the deleted files using PhotoRec.



PhotoRec can selectively recover files based on their filetype(s), but PhotoRec / TestDisk can't selectively scan an individual directory for lost files unless you had mounted a whole hard drive partition as this directory. In some cases, the filename is stored in the file itself. PhotoRec tries to recover the filename in this case, but most of the time PhotoRec can't recover the filenames.




Recover files based on filetype using PhotoRec




  1. Install TestDisk from the Ubuntu Software Center.



    sudo apt-get install testdisk



  2. Launch PhotoRec.



    Open a terminal and launch photorec (as root).



    sudo photorec


  3. Select hard disk.



  4. Select partition type.



    If your hard disk has Linux partitions, then select [Intel].




  5. Select filetype option.



    Move to [File Opt] and press Enter. Here you can disable all file types by pressing s. Use space to toggle the check button. Select filetype(s) to recover. For Perl you can select pl for Perl script or pm for Perl module.




  6. Select options.



    Photorec also has a list of different options. Under normal circumstances you don’t need to modify them.




  7. Select partition.



    Move the selector up or down to the partition from which you have removed the file(s). Then select [Search] and press Enter.




  8. Select filesystem type.



    If you are using Linux, it's going to be ext2/ext3/ext4, so the default selection is ext2/ext3. Otherwise if you are recovering files from a partition formatted as FAT or NTFS select Other.




  9. Select space for analysis.



    Select Free if you didn’t write to that partition after removing the particular file, otherwise select Whole.




  10. Select a directory for the recovered files



    Select the path where the recovered files will be stored. Then press Y.



Photorec will show how many files it has recovered.



Source: revised from How To Recover Deleted Files in Linux Using Photorec






share|improve this answer

























  • I'd first try testdisk and then photorec: photorec will recover all the text files in the selected partition, with no metadata (hence no filenames in the recovered files) and possibly thousands of files recovered. If the filesystem entries haven't been overwritten yet with testdisk one could recover just the single deleted folder / deleted files. Also I'd strongly suggest to not do this while booting from the hard drive containing the deleted files, but to shut the system down immediately and to do this from a Live DVD / USB.

    – kos
    Sep 20 '15 at 11:20



















0














"Ubuntu 14.04+Dummy Output+PhotoRec"



Hi everybody,
Can any of you help me, please?
A number of things happened with my Ubuntu 14.04 system.
Here the events go.
E#1: My Ubuntu system got a regular Update and then Dummy Output was shown under Sound Settings & as a consequence Input/Output voice was no more available. This means something went wrong with the Sound Card or it was Not Appearing for some reason. Then Backup Stopped working and System Settings got lost, almost all of it.



E#2: Then some Dummy Suggested that Rebooting is the Cure. Why am I calling the Tech person dummy? The reason is that he merely stated the so called Cure Name & not the Outcome which took place afterwards. Well, in this world Mostly People are not Techs & therefore in their naive selves they harm their computer systems.
This happened to me too. I Lost All of My Photos, Docs, Videos & Music!



E#3: Then a friend of mine suggested me to use PhotoRec to Recover the files, but he forgot to tell me that I need a Separate Drive to Recover those Files or there is a chance of the existing Internal Hard Drive to be Overwritten!
I did as directed and was very happy with PhotoRec until the next morning. The next day I opened my computer system and everything just Hung/Froze After Login. Until now it is in the same state. Guest Session is of no use & so is Recovery Mode & Rebooting in Grub. It'll surely bring me to the ground Zero.



The only Possibility I am seeing is to Start over with
Rebooting->Installing PhotoRec->Run PhotoRec (with an external Hard Drive this time)->Sesrch Through All the Files->Wreck a Tech Person's brain over what to do with the Unwanted and Some Software Files.
And may be...
If I'll get lucky enough. I'll get what I am searching for.
Any sensible & comprehending solution for humans, is my desire.
Thanks for reading & coming up with an applicable fool-proof sugge0stion.






share|improve this answer










New contributor




Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f676242%2fhow-to-recover-deleted-files-in-ubuntu-using-live-usb-based-on-filetype%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    13














    Before you start:



    • It's always a good idea to work from a copy of your deleted data, so copy your entire disk before you begin

    • If you cannot, boot from a Live-USB/DVD before you begin.

    • If you cannot, know that by each and every single byte you write to your disk right now, one byte of one of your deleted files will be overwritten! (i.e. by installing PhotoRec and TestDisk, some deleted files will be overwritten by the applications that you're going to install if you continue!).


    What are the main differences between TestDisk and PhotoRec?



    TestDisk is a lot more efficient than PhotoRec. The problem with TestDisk is that it doesn't always recover all deleted files. If you accidentally reformat a partition, TestDisk can recover thousands of files without missing a single file, but if you deleted a file by sending it to the Trash and then emptying the Trash, TestDisk can't always recover it.



    So use TestDisk first, and if you recovered all of the deleted files with TestDisk, then you're done. If you recovered most of the deleted files with TestDisk, you can decide whether you're done or not. If you're not done after running TestDisk, you can try recovering the deleted files using PhotoRec.



    PhotoRec can selectively recover files based on their filetype(s), but PhotoRec / TestDisk can't selectively scan an individual directory for lost files unless you had mounted a whole hard drive partition as this directory. In some cases, the filename is stored in the file itself. PhotoRec tries to recover the filename in this case, but most of the time PhotoRec can't recover the filenames.




    Recover files based on filetype using PhotoRec




    1. Install TestDisk from the Ubuntu Software Center.



      sudo apt-get install testdisk



    2. Launch PhotoRec.



      Open a terminal and launch photorec (as root).



      sudo photorec


    3. Select hard disk.



    4. Select partition type.



      If your hard disk has Linux partitions, then select [Intel].




    5. Select filetype option.



      Move to [File Opt] and press Enter. Here you can disable all file types by pressing s. Use space to toggle the check button. Select filetype(s) to recover. For Perl you can select pl for Perl script or pm for Perl module.




    6. Select options.



      Photorec also has a list of different options. Under normal circumstances you don’t need to modify them.




    7. Select partition.



      Move the selector up or down to the partition from which you have removed the file(s). Then select [Search] and press Enter.




    8. Select filesystem type.



      If you are using Linux, it's going to be ext2/ext3/ext4, so the default selection is ext2/ext3. Otherwise if you are recovering files from a partition formatted as FAT or NTFS select Other.




    9. Select space for analysis.



      Select Free if you didn’t write to that partition after removing the particular file, otherwise select Whole.




    10. Select a directory for the recovered files



      Select the path where the recovered files will be stored. Then press Y.



    Photorec will show how many files it has recovered.



    Source: revised from How To Recover Deleted Files in Linux Using Photorec






    share|improve this answer

























    • I'd first try testdisk and then photorec: photorec will recover all the text files in the selected partition, with no metadata (hence no filenames in the recovered files) and possibly thousands of files recovered. If the filesystem entries haven't been overwritten yet with testdisk one could recover just the single deleted folder / deleted files. Also I'd strongly suggest to not do this while booting from the hard drive containing the deleted files, but to shut the system down immediately and to do this from a Live DVD / USB.

      – kos
      Sep 20 '15 at 11:20
















    13














    Before you start:



    • It's always a good idea to work from a copy of your deleted data, so copy your entire disk before you begin

    • If you cannot, boot from a Live-USB/DVD before you begin.

    • If you cannot, know that by each and every single byte you write to your disk right now, one byte of one of your deleted files will be overwritten! (i.e. by installing PhotoRec and TestDisk, some deleted files will be overwritten by the applications that you're going to install if you continue!).


    What are the main differences between TestDisk and PhotoRec?



    TestDisk is a lot more efficient than PhotoRec. The problem with TestDisk is that it doesn't always recover all deleted files. If you accidentally reformat a partition, TestDisk can recover thousands of files without missing a single file, but if you deleted a file by sending it to the Trash and then emptying the Trash, TestDisk can't always recover it.



    So use TestDisk first, and if you recovered all of the deleted files with TestDisk, then you're done. If you recovered most of the deleted files with TestDisk, you can decide whether you're done or not. If you're not done after running TestDisk, you can try recovering the deleted files using PhotoRec.



    PhotoRec can selectively recover files based on their filetype(s), but PhotoRec / TestDisk can't selectively scan an individual directory for lost files unless you had mounted a whole hard drive partition as this directory. In some cases, the filename is stored in the file itself. PhotoRec tries to recover the filename in this case, but most of the time PhotoRec can't recover the filenames.




    Recover files based on filetype using PhotoRec




    1. Install TestDisk from the Ubuntu Software Center.



      sudo apt-get install testdisk



    2. Launch PhotoRec.



      Open a terminal and launch photorec (as root).



      sudo photorec


    3. Select hard disk.



    4. Select partition type.



      If your hard disk has Linux partitions, then select [Intel].




    5. Select filetype option.



      Move to [File Opt] and press Enter. Here you can disable all file types by pressing s. Use space to toggle the check button. Select filetype(s) to recover. For Perl you can select pl for Perl script or pm for Perl module.




    6. Select options.



      Photorec also has a list of different options. Under normal circumstances you don’t need to modify them.




    7. Select partition.



      Move the selector up or down to the partition from which you have removed the file(s). Then select [Search] and press Enter.




    8. Select filesystem type.



      If you are using Linux, it's going to be ext2/ext3/ext4, so the default selection is ext2/ext3. Otherwise if you are recovering files from a partition formatted as FAT or NTFS select Other.




    9. Select space for analysis.



      Select Free if you didn’t write to that partition after removing the particular file, otherwise select Whole.




    10. Select a directory for the recovered files



      Select the path where the recovered files will be stored. Then press Y.



    Photorec will show how many files it has recovered.



    Source: revised from How To Recover Deleted Files in Linux Using Photorec






    share|improve this answer

























    • I'd first try testdisk and then photorec: photorec will recover all the text files in the selected partition, with no metadata (hence no filenames in the recovered files) and possibly thousands of files recovered. If the filesystem entries haven't been overwritten yet with testdisk one could recover just the single deleted folder / deleted files. Also I'd strongly suggest to not do this while booting from the hard drive containing the deleted files, but to shut the system down immediately and to do this from a Live DVD / USB.

      – kos
      Sep 20 '15 at 11:20














    13












    13








    13







    Before you start:



    • It's always a good idea to work from a copy of your deleted data, so copy your entire disk before you begin

    • If you cannot, boot from a Live-USB/DVD before you begin.

    • If you cannot, know that by each and every single byte you write to your disk right now, one byte of one of your deleted files will be overwritten! (i.e. by installing PhotoRec and TestDisk, some deleted files will be overwritten by the applications that you're going to install if you continue!).


    What are the main differences between TestDisk and PhotoRec?



    TestDisk is a lot more efficient than PhotoRec. The problem with TestDisk is that it doesn't always recover all deleted files. If you accidentally reformat a partition, TestDisk can recover thousands of files without missing a single file, but if you deleted a file by sending it to the Trash and then emptying the Trash, TestDisk can't always recover it.



    So use TestDisk first, and if you recovered all of the deleted files with TestDisk, then you're done. If you recovered most of the deleted files with TestDisk, you can decide whether you're done or not. If you're not done after running TestDisk, you can try recovering the deleted files using PhotoRec.



    PhotoRec can selectively recover files based on their filetype(s), but PhotoRec / TestDisk can't selectively scan an individual directory for lost files unless you had mounted a whole hard drive partition as this directory. In some cases, the filename is stored in the file itself. PhotoRec tries to recover the filename in this case, but most of the time PhotoRec can't recover the filenames.




    Recover files based on filetype using PhotoRec




    1. Install TestDisk from the Ubuntu Software Center.



      sudo apt-get install testdisk



    2. Launch PhotoRec.



      Open a terminal and launch photorec (as root).



      sudo photorec


    3. Select hard disk.



    4. Select partition type.



      If your hard disk has Linux partitions, then select [Intel].




    5. Select filetype option.



      Move to [File Opt] and press Enter. Here you can disable all file types by pressing s. Use space to toggle the check button. Select filetype(s) to recover. For Perl you can select pl for Perl script or pm for Perl module.




    6. Select options.



      Photorec also has a list of different options. Under normal circumstances you don’t need to modify them.




    7. Select partition.



      Move the selector up or down to the partition from which you have removed the file(s). Then select [Search] and press Enter.




    8. Select filesystem type.



      If you are using Linux, it's going to be ext2/ext3/ext4, so the default selection is ext2/ext3. Otherwise if you are recovering files from a partition formatted as FAT or NTFS select Other.




    9. Select space for analysis.



      Select Free if you didn’t write to that partition after removing the particular file, otherwise select Whole.




    10. Select a directory for the recovered files



      Select the path where the recovered files will be stored. Then press Y.



    Photorec will show how many files it has recovered.



    Source: revised from How To Recover Deleted Files in Linux Using Photorec






    share|improve this answer















    Before you start:



    • It's always a good idea to work from a copy of your deleted data, so copy your entire disk before you begin

    • If you cannot, boot from a Live-USB/DVD before you begin.

    • If you cannot, know that by each and every single byte you write to your disk right now, one byte of one of your deleted files will be overwritten! (i.e. by installing PhotoRec and TestDisk, some deleted files will be overwritten by the applications that you're going to install if you continue!).


    What are the main differences between TestDisk and PhotoRec?



    TestDisk is a lot more efficient than PhotoRec. The problem with TestDisk is that it doesn't always recover all deleted files. If you accidentally reformat a partition, TestDisk can recover thousands of files without missing a single file, but if you deleted a file by sending it to the Trash and then emptying the Trash, TestDisk can't always recover it.



    So use TestDisk first, and if you recovered all of the deleted files with TestDisk, then you're done. If you recovered most of the deleted files with TestDisk, you can decide whether you're done or not. If you're not done after running TestDisk, you can try recovering the deleted files using PhotoRec.



    PhotoRec can selectively recover files based on their filetype(s), but PhotoRec / TestDisk can't selectively scan an individual directory for lost files unless you had mounted a whole hard drive partition as this directory. In some cases, the filename is stored in the file itself. PhotoRec tries to recover the filename in this case, but most of the time PhotoRec can't recover the filenames.




    Recover files based on filetype using PhotoRec




    1. Install TestDisk from the Ubuntu Software Center.



      sudo apt-get install testdisk



    2. Launch PhotoRec.



      Open a terminal and launch photorec (as root).



      sudo photorec


    3. Select hard disk.



    4. Select partition type.



      If your hard disk has Linux partitions, then select [Intel].




    5. Select filetype option.



      Move to [File Opt] and press Enter. Here you can disable all file types by pressing s. Use space to toggle the check button. Select filetype(s) to recover. For Perl you can select pl for Perl script or pm for Perl module.




    6. Select options.



      Photorec also has a list of different options. Under normal circumstances you don’t need to modify them.




    7. Select partition.



      Move the selector up or down to the partition from which you have removed the file(s). Then select [Search] and press Enter.




    8. Select filesystem type.



      If you are using Linux, it's going to be ext2/ext3/ext4, so the default selection is ext2/ext3. Otherwise if you are recovering files from a partition formatted as FAT or NTFS select Other.




    9. Select space for analysis.



      Select Free if you didn’t write to that partition after removing the particular file, otherwise select Whole.




    10. Select a directory for the recovered files



      Select the path where the recovered files will be stored. Then press Y.



    Photorec will show how many files it has recovered.



    Source: revised from How To Recover Deleted Files in Linux Using Photorec







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jul 8 '18 at 9:55

























    answered Sep 20 '15 at 10:53









    karelkarel

    60.2k13130154




    60.2k13130154












    • I'd first try testdisk and then photorec: photorec will recover all the text files in the selected partition, with no metadata (hence no filenames in the recovered files) and possibly thousands of files recovered. If the filesystem entries haven't been overwritten yet with testdisk one could recover just the single deleted folder / deleted files. Also I'd strongly suggest to not do this while booting from the hard drive containing the deleted files, but to shut the system down immediately and to do this from a Live DVD / USB.

      – kos
      Sep 20 '15 at 11:20


















    • I'd first try testdisk and then photorec: photorec will recover all the text files in the selected partition, with no metadata (hence no filenames in the recovered files) and possibly thousands of files recovered. If the filesystem entries haven't been overwritten yet with testdisk one could recover just the single deleted folder / deleted files. Also I'd strongly suggest to not do this while booting from the hard drive containing the deleted files, but to shut the system down immediately and to do this from a Live DVD / USB.

      – kos
      Sep 20 '15 at 11:20

















    I'd first try testdisk and then photorec: photorec will recover all the text files in the selected partition, with no metadata (hence no filenames in the recovered files) and possibly thousands of files recovered. If the filesystem entries haven't been overwritten yet with testdisk one could recover just the single deleted folder / deleted files. Also I'd strongly suggest to not do this while booting from the hard drive containing the deleted files, but to shut the system down immediately and to do this from a Live DVD / USB.

    – kos
    Sep 20 '15 at 11:20






    I'd first try testdisk and then photorec: photorec will recover all the text files in the selected partition, with no metadata (hence no filenames in the recovered files) and possibly thousands of files recovered. If the filesystem entries haven't been overwritten yet with testdisk one could recover just the single deleted folder / deleted files. Also I'd strongly suggest to not do this while booting from the hard drive containing the deleted files, but to shut the system down immediately and to do this from a Live DVD / USB.

    – kos
    Sep 20 '15 at 11:20














    0














    "Ubuntu 14.04+Dummy Output+PhotoRec"



    Hi everybody,
    Can any of you help me, please?
    A number of things happened with my Ubuntu 14.04 system.
    Here the events go.
    E#1: My Ubuntu system got a regular Update and then Dummy Output was shown under Sound Settings & as a consequence Input/Output voice was no more available. This means something went wrong with the Sound Card or it was Not Appearing for some reason. Then Backup Stopped working and System Settings got lost, almost all of it.



    E#2: Then some Dummy Suggested that Rebooting is the Cure. Why am I calling the Tech person dummy? The reason is that he merely stated the so called Cure Name & not the Outcome which took place afterwards. Well, in this world Mostly People are not Techs & therefore in their naive selves they harm their computer systems.
    This happened to me too. I Lost All of My Photos, Docs, Videos & Music!



    E#3: Then a friend of mine suggested me to use PhotoRec to Recover the files, but he forgot to tell me that I need a Separate Drive to Recover those Files or there is a chance of the existing Internal Hard Drive to be Overwritten!
    I did as directed and was very happy with PhotoRec until the next morning. The next day I opened my computer system and everything just Hung/Froze After Login. Until now it is in the same state. Guest Session is of no use & so is Recovery Mode & Rebooting in Grub. It'll surely bring me to the ground Zero.



    The only Possibility I am seeing is to Start over with
    Rebooting->Installing PhotoRec->Run PhotoRec (with an external Hard Drive this time)->Sesrch Through All the Files->Wreck a Tech Person's brain over what to do with the Unwanted and Some Software Files.
    And may be...
    If I'll get lucky enough. I'll get what I am searching for.
    Any sensible & comprehending solution for humans, is my desire.
    Thanks for reading & coming up with an applicable fool-proof sugge0stion.






    share|improve this answer










    New contributor




    Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.
























      0














      "Ubuntu 14.04+Dummy Output+PhotoRec"



      Hi everybody,
      Can any of you help me, please?
      A number of things happened with my Ubuntu 14.04 system.
      Here the events go.
      E#1: My Ubuntu system got a regular Update and then Dummy Output was shown under Sound Settings & as a consequence Input/Output voice was no more available. This means something went wrong with the Sound Card or it was Not Appearing for some reason. Then Backup Stopped working and System Settings got lost, almost all of it.



      E#2: Then some Dummy Suggested that Rebooting is the Cure. Why am I calling the Tech person dummy? The reason is that he merely stated the so called Cure Name & not the Outcome which took place afterwards. Well, in this world Mostly People are not Techs & therefore in their naive selves they harm their computer systems.
      This happened to me too. I Lost All of My Photos, Docs, Videos & Music!



      E#3: Then a friend of mine suggested me to use PhotoRec to Recover the files, but he forgot to tell me that I need a Separate Drive to Recover those Files or there is a chance of the existing Internal Hard Drive to be Overwritten!
      I did as directed and was very happy with PhotoRec until the next morning. The next day I opened my computer system and everything just Hung/Froze After Login. Until now it is in the same state. Guest Session is of no use & so is Recovery Mode & Rebooting in Grub. It'll surely bring me to the ground Zero.



      The only Possibility I am seeing is to Start over with
      Rebooting->Installing PhotoRec->Run PhotoRec (with an external Hard Drive this time)->Sesrch Through All the Files->Wreck a Tech Person's brain over what to do with the Unwanted and Some Software Files.
      And may be...
      If I'll get lucky enough. I'll get what I am searching for.
      Any sensible & comprehending solution for humans, is my desire.
      Thanks for reading & coming up with an applicable fool-proof sugge0stion.






      share|improve this answer










      New contributor




      Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















        0












        0








        0







        "Ubuntu 14.04+Dummy Output+PhotoRec"



        Hi everybody,
        Can any of you help me, please?
        A number of things happened with my Ubuntu 14.04 system.
        Here the events go.
        E#1: My Ubuntu system got a regular Update and then Dummy Output was shown under Sound Settings & as a consequence Input/Output voice was no more available. This means something went wrong with the Sound Card or it was Not Appearing for some reason. Then Backup Stopped working and System Settings got lost, almost all of it.



        E#2: Then some Dummy Suggested that Rebooting is the Cure. Why am I calling the Tech person dummy? The reason is that he merely stated the so called Cure Name & not the Outcome which took place afterwards. Well, in this world Mostly People are not Techs & therefore in their naive selves they harm their computer systems.
        This happened to me too. I Lost All of My Photos, Docs, Videos & Music!



        E#3: Then a friend of mine suggested me to use PhotoRec to Recover the files, but he forgot to tell me that I need a Separate Drive to Recover those Files or there is a chance of the existing Internal Hard Drive to be Overwritten!
        I did as directed and was very happy with PhotoRec until the next morning. The next day I opened my computer system and everything just Hung/Froze After Login. Until now it is in the same state. Guest Session is of no use & so is Recovery Mode & Rebooting in Grub. It'll surely bring me to the ground Zero.



        The only Possibility I am seeing is to Start over with
        Rebooting->Installing PhotoRec->Run PhotoRec (with an external Hard Drive this time)->Sesrch Through All the Files->Wreck a Tech Person's brain over what to do with the Unwanted and Some Software Files.
        And may be...
        If I'll get lucky enough. I'll get what I am searching for.
        Any sensible & comprehending solution for humans, is my desire.
        Thanks for reading & coming up with an applicable fool-proof sugge0stion.






        share|improve this answer










        New contributor




        Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        "Ubuntu 14.04+Dummy Output+PhotoRec"



        Hi everybody,
        Can any of you help me, please?
        A number of things happened with my Ubuntu 14.04 system.
        Here the events go.
        E#1: My Ubuntu system got a regular Update and then Dummy Output was shown under Sound Settings & as a consequence Input/Output voice was no more available. This means something went wrong with the Sound Card or it was Not Appearing for some reason. Then Backup Stopped working and System Settings got lost, almost all of it.



        E#2: Then some Dummy Suggested that Rebooting is the Cure. Why am I calling the Tech person dummy? The reason is that he merely stated the so called Cure Name & not the Outcome which took place afterwards. Well, in this world Mostly People are not Techs & therefore in their naive selves they harm their computer systems.
        This happened to me too. I Lost All of My Photos, Docs, Videos & Music!



        E#3: Then a friend of mine suggested me to use PhotoRec to Recover the files, but he forgot to tell me that I need a Separate Drive to Recover those Files or there is a chance of the existing Internal Hard Drive to be Overwritten!
        I did as directed and was very happy with PhotoRec until the next morning. The next day I opened my computer system and everything just Hung/Froze After Login. Until now it is in the same state. Guest Session is of no use & so is Recovery Mode & Rebooting in Grub. It'll surely bring me to the ground Zero.



        The only Possibility I am seeing is to Start over with
        Rebooting->Installing PhotoRec->Run PhotoRec (with an external Hard Drive this time)->Sesrch Through All the Files->Wreck a Tech Person's brain over what to do with the Unwanted and Some Software Files.
        And may be...
        If I'll get lucky enough. I'll get what I am searching for.
        Any sensible & comprehending solution for humans, is my desire.
        Thanks for reading & coming up with an applicable fool-proof sugge0stion.







        share|improve this answer










        New contributor




        Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer








        edited 4 mins ago





















        New contributor




        Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 10 mins ago









        SamSam

        11




        11




        New contributor




        Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f676242%2fhow-to-recover-deleted-files-in-ubuntu-using-live-usb-based-on-filetype%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Are there any comparative studies done between Ashtavakra Gita and Buddhim?How is it wrong to believe that a self exists, or that it doesn't?Can you criticise or improve Ven. Bodhi's description of MahayanaWas the doctrine of 'Anatta', accepted as doctrine by modern Buddhism, actually taught by the Buddha?Relationship between Buddhism, Hinduism and Yoga?Comparison of Nirvana, Tao and Brahman/AtmaIs there a distinction between “ego identity” and “craving/hating”?Are there many differences between Taoism and Buddhism?Loss of “faith” in buddhismSimilarity between creation in Abrahamic religions and beginning of life in Earth mentioned Agganna Sutta?Are there studies about the difference between meditating in the morning versus in the evening?Can one follow Hinduism and Buddhism at the same time?Are there any prohibitions on participating in other religion's practices?Psychology of 'flow'

            Where else does the Shulchan Aruch quote an authority by name?Parashat Metzora+HagadolPesach/PassoverShulchan Aruch UTF-8Anonymous glosses in the Shulchan AruchWhy is the Shulchan Aruch definitive?Siman 32, Kitzur Shulchan Aruch: UntranslatedLitvaks/Yeshivish and Shulchan AruchBuying a Shulchan AruchEnglish version of SHULCHAN ARUCHIs there any place where Shulchan Aruch rules with the Rosh against the Rif and Rambam?Are there practices where Sepharadim do not hold by Shulchan Aruch?5th part of the shulchan aruch

            fallocate: fallocate failed: Text file busy in Ubuntu 17.04? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)defragmenting and increasing performance of old lubuntu system with swap partitionIssue with increasing the root partition from the swapthis /usr/bin/dpkg returned error || ubuntu-16.04, 64bitDefault 17.04 swap file locationHow to Resize Ubuntu 17.04 Zesty Swap file size?Ubuntu freezes from online formsMy Laptop is not starting after upgrade ubuntu 16.04 (Kernel 4.8.0-38 to 04.10.0-36)hcp: ERROR: FALLOCATE FAILED!Not sure my swap is being usedWine 3.0 asking for more virtual free swap