0

Say I unlink a file myfile on a USB located at /dev/sdb1

mount /dev/sdb1 /media
rm /media/myfile

and then umount the usb and run zerofree:

umount /media
zerofree /dev/sdb1

Would this last command allow to avoid any possible recovery my file myfile?

  • zerofree only works with ext[234] filesystem - if your USB is formatted with one of these, it should do that. You can make sure with tools like photorec. – ridgy Dec 11 '16 at 17:36
0

zerofree only works with ext[234] filesystem - if your USB is formatted with one of these, it should do that.

You can make sure with tools like photorec

0
 shred -zun1 /media/myfile

See man shred for the details. On modern hard disks and SSD using an overwrite count greater than 1 is useles (the default is 3 for historical reasons). If the USB drive in question is a solid-state drive (SSD or flash drive) you may also want to fstrim /media; try to not overuse this command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.