Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
Last active March 9, 2022 09:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohanpedala/fc85481b464935af929d82d54a1b24c4 to your computer and use it in GitHub Desktop.
Save mohanpedala/fc85481b464935af929d82d54a1b24c4 to your computer and use it in GitHub Desktop.
Force Delete user in mac

Can’t Delete Original Admin User on macOS High Sierra

I recently migrated to a new MacBook Pro. The old one was on High Sierra, but the new one wasn’t. So I created a temp “admin” account to do the upgrade, then do the migration with Migration Assistant.

All seemed okay, but when I went to delete the original user account, I couldn’t. And I don’t mean “you don’t know how to delete accounts” couldn’t. I mean, I tried every possible way, and it wouldn’t couldn’t.

I found this thread on the Apple forums with people having the same problem. After trying everything else, this is the solution shared in one of the replies that worked. Warning, I have no idea of the side effects this might have, but so far so good for me. Also, do not come crying to me if it totally hoses your machine. You’ve been warned!

  • System Preferences > Login Options > Join… > Open Directory Utility…
  • Click to unlock it. (You may need to Enable Root User in Edit menu.)
  • Go to Directory Editor. Search to find the user you can’t delete — the original user that was logged in when upgrading to High Sierra.
  • Find the GeneratedUID field on the right and copy it somewhere safe.
  • Change one digit in it and Save.
  • Find your new/main user account > GeneratedUID, paste in the one copied above. Save.
  • Identify the BDS device node value by following the below steps.
    • open spot light search (cmd+space) type Disk Utility
    • Mark/Select your startup disk
    • click on the info icon in the top right of the window
    • In the pop-up window find the row 'BDS device node', copy the value and run the below command.
  • Run diskutil apfs updatePreboot <BDS_device_node> in Terminal.
  • Reboot.
  • Login as your main user. You should be able to delete the original user now.
@Pizzo8
Copy link

Pizzo8 commented Jul 20, 2020

thank you so much

@mohanpedala
Copy link
Author

thank you so much

you are welcome

@te-music
Copy link

Note that the command diskutil apfs updatePreboot disk1s1 may need to be modified to your disk and partition number for your startup disk. For example 'disk1s1' may be 'disk2s1' or 'disk0s2'.
To determine the correct disk/partition number:

  1. open Disk Utility
  2. mark your startup disk
  3. click on the info icon in the top right of the window
  4. in the pop-up window find the row 'BDS device node'
  5. copy that value to the command line above and run

@mohanpedala
Copy link
Author

Note that the command diskutil apfs updatePreboot disk1s1 may need to be modified to your disk and partition number for your startup disk. For example 'disk1s1' may be 'disk2s1' or 'disk0s2'.
To determine the correct disk/partition number:

  1. open Disk Utility
  2. mark your startup disk
  3. click on the info icon in the top right of the window
  4. in the pop-up window find the row 'BDS device node'
  5. copy that value to the command line above and run

Thank you I have updated the document...

@temiyemi
Copy link

Funny, I almost did this but I decided to search further, and found the easiest solution here

All I had to do was disable "Fast user switching", and restart the system. Then sign into the account I wish to keep, and delete the old user account. It worked!

@BlackChristianGeek
Copy link

I have no idea how you figured this out, but I am grateful that you did because it too worked for me. CRAZY!!!!! Again, thanks.

@ben-w-smith
Copy link

@temiyemi I've spent the last 3 days trying to figure this out and your fast user switching comment fixed it for me, thank you!

@007rules
Copy link

007rules commented Mar 9, 2022

Question: Which is the "startup disk," Macintosh HD or Macintosh HD - Data? They have different nodes and I want to be sure to use the right one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment