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?

1
  • 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, 2016 at 17:36

2 Answers 2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .