What’s the best way to format a disk with a corrupted GPT?

0
6
Asked By TechWizard42 On

I have a disk that has a corrupted GPT and a protective MBR, and I'm looking for a way to completely erase it so I can reformat. I'm not interested in recovering any data from it. The guides I find mostly discuss fixing the GPT instead of how to wipe it. When I try to format using GParted or Disks on Ubuntu, I keep getting errors. Any simple solutions?

3 Answers

Answered By KernelGuru77 On

To completely wipe the GPT, you can rewrite it with any random data or simply overwrite the beginning of the drive. This will destroy the GPT. However, I’m curious about the errors you’re getting when trying to format. Can you share the exact commands and error messages? It’ll help us assist you better!

Answered By DataDynamo91 On

You could try using `gdisk`; it can help you zap the existing GPT info and create a new protective MBR. If that doesn't work, there's a more brute force method: use `sudo dd if=/dev/zero of=/dev/sdX bs=512 count=34`. This will zero out the first 34 sectors on the disk and will wipe the MBR and GPT tables completely. Just make sure to replace `/dev/sdX` with your actual disk identifier. Also, proceed with caution as this will delete everything!

Answered By DiskNinja88 On

If your drive is SSD or NVMe, you might want to try the `blkdiscard` command. First, check your disk ID with `lsblk`, and then run `sudo blkdiscard -f /dev/(diskID)`. For example, `sudo blkdiscard -f /dev/sdb`. This command will reset all the data blocks on the disk to factory default, and it’s usually pretty quick.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.