LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-27-2014, 08:57 AM   #1
jokar.mohsen
Member
 
Registered: Jul 2008
Location: Tehran
Posts: 441

Rep: Reputation: 22
Post 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.
 
Old 04-27-2014, 09:17 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
Quote:
Originally Posted by jokar.mohsen View Post
If I format my partition in Linux, How can I recover files?
Restore from a backup?


Quote:
Originally Posted by jokar.mohsen View Post
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?
 
Old 04-27-2014, 02:40 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,817

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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
 
Old 04-27-2014, 03:02 PM   #4
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 490Reputation: 490Reputation: 490Reputation: 490Reputation: 490
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
 
Old 04-27-2014, 03:15 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
Quote:
Originally Posted by metaschima View Post
(..) or you can use: http://wipe.sourceforge.net/ to do the same. It is much faster than /dev/urandom.
...and then there's frandom.
 
Old 04-27-2014, 03:17 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,817

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
DBAN is always an option
 
Old 04-27-2014, 03:23 PM   #7
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 938

Rep: Reputation: 174Reputation: 174
Smile

Don't forget to wipe all the backups too...
 
Old 04-28-2014, 01:56 PM   #8
jokar.mohsen
Member
 
Registered: Jul 2008
Location: Tehran
Posts: 441

Original Poster
Rep: Reputation: 22
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....
 
Old 04-28-2014, 02:11 PM   #9
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
photorec is probably the best bet to retrieve (or partially retrieve) deleted files (not sure if it can resurrect deleted partitions though.
 
Old 04-28-2014, 02:34 PM   #10
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 490Reputation: 490Reputation: 490Reputation: 490Reputation: 490
testdisk may be able to recover partitions.
 
Old 04-28-2014, 03:36 PM   #11
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 810

Rep: Reputation: 264Reputation: 264Reputation: 264
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...
 
  


Reply


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
how to recover files if accidentally deleted files in mysql Majed17 Linux - Software 3 03-02-2013 10:34 AM
Recover Files saran_redhat Linux - Newbie 4 09-09-2010 10:18 AM
How to recover files kadharris Linux - Newbie 5 02-20-2007 04:16 AM
LXer: How to recover lost files after you accidentally wipe your hard drive LXer Syndicated Linux News 1 08-29-2006 04:47 AM
Recover Files Pablop Linux - Newbie 3 10-19-2005 06:45 PM


All times are GMT -5. The time now is 02:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration