OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: guest29153 on July 07, 2021, 10:28:16 PM

Title: Formatting whole disk before installation
Post by: guest29153 on July 07, 2021, 10:28:16 PM
Hi all,

I have searched the forum as well as a regular Google search, but am a bit lost.
Before doing a fresh install, I would like to completely wipe all content on the SSD, basically starting as if it were a new disk that was installed.

I know there's a shell option during installation, and even a possibility to manually partition, but have to admit I am not a BSD expert.
Any tips as such are welcome!
Title: Re: Formatting whole disk before installation
Post by: bartjsmit on July 08, 2021, 08:25:36 AM
There is no need to wipe a disk unless there is sensitive data on it. Use this command to clear out the partition table: dd if=/dev/zero of=/dev/<block device> bs=1M count=1

This will overwrite the first megabyte of the disk with zeroes and will work on most (if not all) Unix systems.

To delete the disk under FreeBSD specifically run:

gpart destroy -F <disk><partition> (e.g. da0s1)
gpart destroy -F <disk>

The installation screens should give you the name for your particular drive.

Bart...