Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

greg97

macrumors member
Original poster
Aug 22, 2012
74
11
Canada Eh?
My Mac Pro 5,1 had been doing fine until a few days ago when I power it up to get to the 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 and trying Safe boot, both of which lead to a hung Mac) 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 /usr/sbin/gpt destroy /dev/disk0’ it comes back with ‘command not found’?? Does anyone know why this may be happening and how to get it to work? I’m wanting to go the terminal route to wipe my drive since I’ve read that using Disk Utilities might not give a clean enough wipe, and using the terminal ‘destroy’ command, then going to the main menu of the usb Mojave installer and selecting ‘Install macOS’ right from there, and then migrating everything over would be the cleanest way to start in order to correct any errors. Thanks in advance for your help! Here’s a shot of what my MP looks like at present….also not shown are disk4-disk22, each of which only contains a few KB or MB…I’m assuming these are irrelevant and using the ‘destroy’ of ‘/dev/disk0’ is all that I need to start? Thanks!
08DCE780-C624-402C-A9D4-B4C4B2E04D8A.jpeg
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,651
4,053
New Zealand
I didn't actually know about gpt destroy. When I've needed to do this I've just written zeros to the start of the disk:

sudo dd if=/dev/zero of=/dev/rdisk0 bs=1m

Let it run for maybe 20-30 seconds then cancel with Ctrl-C (you don't need to overwrite the whole disk, just the start of it). This may not be the "best" way of fixing the problem but it should work.
 
  • Like
Reactions: greg97

greg97

macrumors member
Original poster
Aug 22, 2012
74
11
Canada Eh?
I didn't actually know about gpt destroy. When I've needed to do this I've just written zeros to the start of the disk:

sudo dd if=/dev/zero of=/dev/rdisk0 bs=1m

Let it run for maybe 20-30 seconds then cancel with Ctrl-C (you don't need to overwrite the whole disk, just the start of it). This may not be the "best" way of fixing the problem but it should work.
Thanks for the quick reply! If no one responds as to why my sudo command isn’t working (and it should!?), I’ll give your command a try. Hopefully it doesn’t come back with ‘Command not found’ either! 🙄
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,651
4,053
New Zealand
Well now that I'm thinking about it, if I recall correctly, recovery mode is root anyway so you probably don't need sudo.
 
  • Like
Reactions: greg97

greg97

macrumors member
Original poster
Aug 22, 2012
74
11
Canada Eh?
Well now that I'm thinking about it, if I recall correctly, recovery mode is root anyway so you probably don't need sudo.
Success! So far at least…yes you were right about not needing ‘sudo’, however it wouldn’t work until I used ‘diskutil unmountDisk disk0’, as it said the disk was in use. Then when I typed in the ‘destroy’ command it just went to the next line without asking to confirm or anything (scary!). But it worked since a ‘diskutil list’ showed a blank 2TB drive. Then I had to ‘mount’ this drive and in Disk Utility I had to ‘Erase’ to create a new disk, and only then would ‘Install macOS’ work. It’s presently loading Mojave as I write this. 👍🏻
Thanks again!!
 
  • Like
Reactions: Nermal
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.