Wipeout
Richard Mortier · 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_64
machines, 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-alpine
to start configuring things, thenCTRL-C
after network setup, and executesetup-ntp
- manually:
- Then
setup-alpine; apk add coreutils
- Finally,
shred --verbose /dev/sdXN
whereX
is the device id andN
the partition number (eg.,/dev/sda2
), orshred --verbose -n1 /dev/sdXN
if 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_keys
containing you preferred public key, and set permissions (chmod 600 ~mort/.ssh/authorized_keys
) apk add sudo
and thenvisudo
to allow members of groupsudo
tosudo
- add
mort
to 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