Created
April 23, 2026 12:53
-
-
Save watson0x90/b43bc66ee36e81eca7653db68076ecdc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Identify the internal drive | |
| lsblk | |
| # Wipe everything (replace /dev/sda with the correct device) | |
| sudo wipefs -a /dev/sda | |
| sudo sgdisk --zap-all /dev/sda | |
| sudo dd if=/dev/zero of=/dev/sda bs=1M count=100 | |
| sudo dd if=/dev/zero of=/dev/sda bs=1M seek=$(( $(sudo blockdev --getsz /dev/sda) / 2048 - 100 )) | |
| count=100 | |
| sudo sync | |
| The first dd wipes the beginning (partition table, LVM headers), the second wipes the end (backup | |
| GPT header, secondary LVM metadata). sgdisk --zap-all destroys both MBR and GPT structures. wipefs | |
| -a removes all filesystem/RAID/LVM signatures. | |
| After that, verify it's clean: | |
| sudo fdisk -l /dev/sda |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment