Re: Wiping a disk partition
- In reply to: Odhiambo Washington : "Wiping a disk partition"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Jun 2025 10:42:44 UTC
Hi Odhiambo, Assuming you're using UFS, just delete and recreate the partition. First, ensure that you know how to recreate the partition and more importantly the filesystem exactly (if that matters), using something like: - gpart show ada1 - gpart show -l ada1 - dumpfs -m /dev/ada1p2 Then use the steps below: - umount /dev/ada1p2 - gpart delete -i 2 ada1 - gpart add -t freebsd-ufs ada1 (use -a, -s and other options as appropriate) - newfs /dev/ada1p2 (assuming the previous command returned something like "ada1p2 created", may not be the case if entries in your GPT are sparse; use same parameters as reported above if relevant). If using ZFS, you would just destroy and recreate the dataset. This wipes all data in the common sense of the word. In particular, it does not make any effort to protect against some malicious actor recovering some of the previously written bytes. Regards. -- Olivier Certner