LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Recover and wipe files/ (https://www.linuxquestions.org/questions/linux-newbie-8/recover-and-wipe-files-4175503132/)

jokar.mohsen 04-27-2014 07:57 AM

Recover and wipe files/
 
Hello.
1- If I format my partition in Linux, How can I recover files?
2- How can I remove file under linux that can't be recover?

Cheers.

unSpawn 04-27-2014 08:17 AM

Quote:

Originally Posted by jokar.mohsen (Post 5160032)
If I format my partition in Linux, How can I recover files?

Restore from a backup?


Quote:

Originally Posted by jokar.mohsen (Post 5160032)
How can I remove file under linux that can't be recover?

Recovery asserts the file was mutilated or deleted, so wipe free and slack space?

John VV 04-27-2014 01:40 PM

Quote:

How can I remove file under linux that can't be recover?
many ways
-- files in a folder, ONLY that ONE folder or one file --
Code:

shred -n 3 -xzuv " The Name Of The File"
many folders
install or build from source the debian program " srm"
( it dose build on opensuse and RHEL6 )
for instructions see the help and man page for it

metaschima 04-27-2014 02:02 PM

With modern filesystems the safest way would be to wipe free space. Using shred on the file is an option, but there's no guarantee that the file is actually wiped. Wiping free space with zeros or a PRNG should get rid of any deleted files. You can use '/dev/zero' to create a large file and then delete it when you run out of space, or you can use:
http://wipe.sourceforge.net/
to do the same. It is much faster than /dev/urandom.

Example:
Code:

dd if=/dev/zero of=file conv=fsync bs=4M; rm -f file

unSpawn 04-27-2014 02:15 PM

Quote:

Originally Posted by metaschima (Post 5160173)
(..) or you can use: http://wipe.sourceforge.net/ to do the same. It is much faster than /dev/urandom.

...and then there's frandom.

John VV 04-27-2014 02:17 PM

DBAN is always an option

JeremyBoden 04-27-2014 02:23 PM

Don't forget to wipe all the backups too...

jokar.mohsen 04-28-2014 12:56 PM

Thank you so much but how can I recover a formatted partition? As you know in windows OS, You can find tons of program for recover NTFS partitions but in Linux....

schneidz 04-28-2014 01:11 PM

photorec is probably the best bet to retrieve (or partially retrieve) deleted files (not sure if it can resurrect deleted partitions though.

metaschima 04-28-2014 01:34 PM

testdisk may be able to recover partitions.

maples 04-28-2014 02:36 PM

I think if you used something like parted to create a partition (but don't format it!) with the same start and end sectors, you could recover it. Of course, that's assuming that the partition hasn't been touched...


All times are GMT -5. The time now is 11:41 AM.