How do I shred the data on an external HDD? I am trying shred "/media/me/New Volume/" but I get failed to open for writing: Is a directory. Why?


You need to run shred on the device, not on the mount point.

Type mount and get the device name (e.g. /dev/sdb1, likely it will be /dev/sdXY where X is a letter and Y is a number), then unmount it (run umount /your/device) and run shred /your/device.

| improve this answer | |

shred runs on block devices or files.

So it is either (if /dev/sdx is your external HDD):

shred -n 1 /dev/sdx

Or, in case of a file (if the filesystem is 2TiB large):

truncate -s 2T "/media/me/New Volume/shredfile"
shred -n 1 "/media/me/New Volume/shredfile"
rm "/media/me/New Volume/shredfile"

The file will not shred the entire HDD, just the free space in the filesystem.

The option -n 1 makes sure shred uses only a single pass - multiple passes are a waste of time.

| improve this answer | |

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.