User Tools

Site Tools


cleandisk

This is an old revision of the document!


Write nulls to free space of all partitions on /dev/sda

cleandisk
#!/bin/bash
## fill empty space with nulls to really delete everything
 
sfdisk -d /dev/sda \
| awk '/^.dev.sd/ {print $1}' \
| while read d; do
    mkdir -p /mnt/x
    mount $d /mnt/x
    ls -l /mnt/x
    echo "writing nulls to free space on $d ..."
    time cat /dev/zero > /mnt/x/zeroes
    sync
    rm /mnt/x/zeroes
    umount /mnt/x
  done
echo OK
/docs/dokuwiki/data/attic/cleandisk.1716630015.txt.gz · Last modified: 2024-05-25 11:40:15 by mi