LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   files recovery swap partition (https://www.linuxquestions.org/questions/linux-newbie-8/files-recovery-swap-partition-881382/)

pavel 05-18-2011 06:03 AM

files recovery swap partition
 
Hi all, I`m new to the linux OS
I installed Ubuntu 10.10 on my PC. During the installation process i selected a partion on my hdd for swap , there i had some important files can i rocover it some how

AwesomeMachine 05-18-2011 07:01 AM

You can use foremost. You might have to adjust the .conf file for the file type you want to recover, but there are many default types you can just specify on the command line. Foremost will find the files, and put them in the specified directory.

[linux@sam] # foremost -d -v -q -b 1024 -k 1024 -o ~/rescued_files -t jpg -t doc -t txt -t pdf -i /dev/sda3

This command line is read from left to right:

-d use indirect blocking
-v verbose output
-q quick mode (only searches the beginning of each sector for header bytes)
-b block size (ram dependent)
-k chunk size in MB (ram dependent, about 1/2 total ram is good)
-o directory to store recovered files
-t file types to be recovered (in this example: JPEG, MS Word, Portable Document Format, and text)
-i input file (place to look for files to recover)


If your looking for a weird file type, you can find the header bytes from an existing file of that type, like so:

dd if=file_name count=1 | hexdump -C | less

and look at the first four bytes. Then, make your entry in foremost.conf. You'll have to read the man page for more information. But the default file types are usually adequate.


All times are GMT -5. The time now is 09:52 AM.