Skip to content

Instantly share code, notes, and snippets.

@jhelmink
Last active April 1, 2025 23:54
Show Gist options
  • Save jhelmink/e974e2e14e9b975ca9e1ac0cd7a14213 to your computer and use it in GitHub Desktop.
Save jhelmink/e974e2e14e9b975ca9e1ac0cd7a14213 to your computer and use it in GitHub Desktop.
Secure erase USB attached Harddrive on Synology NAS

Install Packages

Package Center -> Settings -> Package Sources

Add SynoCommunity https://packages.synocommunity.com/

Wait for the packages to load under the Community Tab in Package Center then install

  • SynoCli File Tools = "shred"
  • SynoCli Network Tools = "tmux"

Format Drive

Control Panel -> External Devices

You should see the Drive and give it a quick Ext4 format.

SSH to NAS

I like to use Putty

Use your NAS admin credentials (remember right click to paste, then hit enter, no pasting feedback will be shown)

Commands

mount | grep usbshare

Will tell you the usb drive eg /dev/sdq1

tmux

Launches a new tmux session, so shred command can run in the background

sudo shred -v -n1 /dev/sdq1

Shreds the drive with [v]erbose feedback, for [n]umber of passes of random data

Using tmux

CTRL+B then D - to detach from current tmux session

tmux ls - to list sessions

tmux attach -t 0 - attach back to session zero (the default first session)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment