This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
cleandisk [2024-05-25 11:40:15] mi removed |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Write nulls to free space of all partitions on /dev/sda | ||
| - | |||
| - | <file bash 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 | ||
| - | </file> | ||
| - | |||
| - | {{tag>public linux}} | ||