Skip to main content
Topic: Need to delete file(s) for undeletion purpose (Read 308 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Need to delete file(s) for undeletion purpose

How/what operation can do deletion of file(s) with being in mind really for purpose of undeleting it/them later afterward ?

need arose as way to do dd copying with some exclusion


Re: Need to delete file(s) for undeletion purpose

Reply #2
Make a backup then do whatever you want. Otherwise, something might go wrong.

Re: Need to delete file(s) for undeletion purpose

Reply #3
In most desktop sessions you can use trash-cli which does native xdg trash mgmt., but i would still excercise care.

Re: Need to delete file(s) for undeletion purpose

Reply #4
fine, got at AUR:

Code: [Select]
extundelete

but it obliges user to do it offline, use rm then this

Re: Need to delete file(s) for undeletion purpose

Reply #5
Extundelete and others would not work on any modern SSD, and possibly other flash media too. Use it on spinning hdd's only.

 

Re: Need to delete file(s) for undeletion purpose

Reply #6
If you mean you want to securely wipe a drive, on an SSD you can use hdparm:
https://archive.kernel.org/oldwiki/ata.wiki.kernel.org/index.php/ATA_Secure_Erase.html
This zeros the drive and is very fast.
For spinning disks you can use:
Code: [Select]
# badblocks -w /dev/sd??
But that might take a few hours depending on the drive size and speed. Could be days on multi TB drives!  Some people reckon doing 4 overwrite runs is more than needed, that's forensic lab level protection, one would probably suffice if you wanted to speed things up. You can also specify a block range rather than a whole drive.
For file recovery I use testdisk / photorec, it takes a bit of study to use it effectively but works well. Set only the file types you want to recover, not everything, to speed up the process. No point wasting time searching for weird file types (like eg. MS or MAC specific ones) that I don't have.
I think you can dd files to a location outside of any partition, which won't normally get overwritten unlike inside one, if you mean you want to hide them, and keep a record of the block locations manually to dd them back later.