Wipeout
· 2 min read · December 17, 2018 · #tech #linux #oldI recently decided to go through some old PCs and hard disks (yes, actual spinning bits of metal) and recycle or simply junk them. I figured I should wipe them properly first, and given that they had been installed with a range of OSs, setup a bootable USB stick so that I could boot and wipe in one easy motion.
- Download Alpine Linux 3.8.1 ISO – I had only
x86_64machines, YMMV obviously - Write this to a USB stick using
dd(on Linux), or Balena Etcher on Windows - Insert the stick and boot the machine after making any necessary BIOS changes
- If the machine has been unbooted for too long or (as one of mine) has a flat CMOS clock battery so cannot retain time across reboots, set the time
- manually:
date --set="20181217" - automatically:
setup-alpineto start configuring things, thenCTRL-Cafter network setup, and executesetup-ntp
- manually:
- Then
setup-alpine; apk add coreutils - Finally,
shred --verbose /dev/sdXNwhereXis the device id andNthe partition number (eg.,/dev/sda2), orshred --verbose -n1 /dev/sdXNif you’re using a modern disk (apparently) and only want one pass of random data
Installing Alpine
After installing Alpine as above:
adduser mort- create
~mort/.ssh/authorized_keyscontaining you preferred public key, and set permissions (chmod 600 ~mort/.ssh/authorized_keys) apk add sudoand thenvisudoto allow members of groupsudotosudo- add
mortto groupsudo - logout and then back in
You can then configure storage as you see fit; it seems I once did probably using sudo:
# create `/etc/fstab` to match the above configuration