Sudo gpt destroy disk0 command not found?

My Mac Pro 5,1 had been doing fine until a few days ago when I power it up to get to the boot/home screen it does one of a number of things…it either just brings up the dock with no file folders on the screen and a hung mouse, it does bring up the folders, but the mouse goes into the spinning wheel of death, or I get just the dock and the mouse moves around for a bit but can’t click on anything then hangs up….after trying the usual fixes (including installing the Mojave OS again but leaving everything intact) I’m basically at the point where I figure I have to wipe everything clean and do a fresh install using my bootable Mojave usb. Problem is, when I’ve booted into the usb and use the terminal command ‘sudo gpt destroy disk0’ it comes back with ‘command not found’?? Does anyone know why this may be happening and how to get it to work? Thanks in advance for your help!

Mac Pro, macOS 10.14

Posted on Oct 30, 2022 10:12 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 30, 2022 12:12 PM

You must preface the disk name with /dev. Be absolutely certain that it is disk0 you intend to whack. If you are using a USB Mojave installer, when you exit the Terminal you would quit Disk Utilities and then choose Install macOS from the main menu. The Mojave installation would rebuild the filesystem with a GPT partition scheme and pave macOS Mojave into it.


An alternative approach to what you are attempting is to boot into recovery and choose Restore from Time Machine backup which would repave the destination drive with the last Mojave backup. No terminal shenanigans necessary.

Similar questions

7 replies
Question marked as Top-ranking reply

Oct 30, 2022 12:12 PM in response to Mojo27

You must preface the disk name with /dev. Be absolutely certain that it is disk0 you intend to whack. If you are using a USB Mojave installer, when you exit the Terminal you would quit Disk Utilities and then choose Install macOS from the main menu. The Mojave installation would rebuild the filesystem with a GPT partition scheme and pave macOS Mojave into it.


An alternative approach to what you are attempting is to boot into recovery and choose Restore from Time Machine backup which would repave the destination drive with the last Mojave backup. No terminal shenanigans necessary.

Oct 30, 2022 11:59 AM in response to VikingOSX

Sorry I’m not good at terminal commands, just going by what I’ve read off of other forums. So the full command would be:


sudo /usr/sbin/gpt destroy disk0 ???


On anther site they were also trying doing the same as myself but from internet recovery and the command they gave was “sudo gpt destroy /dev/disk0”. Interestingly they did not use the ‘/usr/sbin’ part, but did add ‘/dev’. What is the purpose of the ‘/dev’ and do I need this? Finally, once my drive is wiped in this manner, will my usb rebuild the directories on disk0 to the proper configuration and start reloading Mojave automatically? Thanks for your reply!


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Sudo gpt destroy disk0 command not found?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.