I have two SSDs in my system, and when I tried to make one drive linux, it broke windows and is unrecoverable via an installation media. To make it easier (since I have nothing that I need on either), I need to nuke both, including removing the operating system and MBR. Does anyone have any solutions for this?
-
Is this a duplicate of unix.stackexchange.com/q/547867/116858 maybe?Kusalananda– Kusalananda ♦2025-07-31 06:01:22 +00:00Commented Jul 31 at 6:01
-
2Partially, but the older thread doesn't account for Windows still being involved in the future, which means it's not enough to just clear the partition table – creating new partitions at the same spot may result in Windows recognizing the old filesystems found at that location, so those need to be wiped as well.grawity– grawity2025-07-31 13:25:28 +00:00Commented Jul 31 at 13:25
1 Answer
Choose one (in no particular order):
Discard (TRIM) the whole thing:
blkdiscard -f /dev/sdzMost SSDs implement "read zero after trim", so even though this doesn't securely erase data, that data still becomes unreachable to the host OS and the disk just appears completely blank.
The command is identical for SATA and NVMe.
ATA secure erase (for SATA SSDs):
hdparm --security-set-pass foo /dev/sdy && hdparm --security-erase-enhanced foo /dev/sdyThe password gets automatically unset after an erase. For SSDs this usually only takes a few seconds. It asks the SSD's internal controller to erase everything, even the otherwise unreachable parts; I've even used it to "repair" dying cheap SSDs temporarily.
I'm not sure of the NVMe equivalent but it may be:
nvme sanitize /dev/nvmeXYZDelete just the bits that make a filesystem recognizable:
wipefs -a /dev/sdm[1-9] # first each filesystem wipefs -a /dev/sdm # then the partition tableFor your purpose there is no need to actually remove all the data – if there's no more filesystem metadata, then nothing will look for that data anymore, and will just treat the partition or the disk as fresh.
This doesn't remove the bootloader part of the MBR if I remember correctly, but that's only relevant for "legacy BIOS" systems – not for UEFI – and a fresh OS installation will overwrite it anyway. If you also want to destroy the MBR manually:
head -c 1M /dev/zero > /dev/sdu
Note that for UEFI there is additional configuration that is not stored on disk. The boot entries are kept on your mainboard's NVRAM and managed through "EFI variables":
efibootmgr
efibootmgr -b 0123 --delete-bootnum
-
What ended up working was in the bios to disable automatic NVMe and SATA mapping with VMPFrost– Frost2025-10-27 01:20:33 +00:00Commented Oct 27 at 1:20