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

PeteMacMan

macrumors member
Original poster
Jun 12, 2023
30
4
London
Hello everyone, I need your help please.

. I changed the username of my login on my Mac, but I didn't realize that it would also remove my admin status. Now, I don't have an admin user on my Mac, and I need to re-add one Although my SSD is new and I haven't added many files yet I can't create a reboot disk (need admin) and reinstall Sierra that easily. so any simpler method would be great.

I tried to fix this issue by running the following commands in recovery mode:
1. mount -uw /
2. rm /var/db/.AppleSetupDone

However, I received an error message stating that there is no such file or directory. After some research, I realized that the command is not looking at the correct drive, so I need to change the directories to my new SSD drive. Unfortunately, I'm having trouble doing so. Can someone explain to me how to change the directory and find the Appleset up db file? Please provide clear and precise steps.

My SSD drive is named SAMSUNG SSD 870 EVO, but when I tried to change the directory by typing "cd SAMSUNG SSD 870 EVO", it didn't recognize it. ??

I would really appreciate it if someone could provide me with clear instructions on how to find the Applesetup db file and complete the recovery process. Thank you in advance for your help!

ps The applications I have downloaded to new SSD If I were to have to start disk from fresh, If I simply right click copy the application from the SSD to a spare USB disc before wiping, then when new disk is up and running, copy and paste over. Will that be a working app with all the data etc I've set up. Ie say Nord VPN.. I'm thinking not!
 

bogdanw

macrumors 603
Mar 10, 2009
5,809
2,814
From Terminal in Recovery, use

Code:
ls /Volumes/

to list the available volumes. If you haven’t changed the name, it should be Macintosh HD, so the command should be

Code:
rm “/Volumes/Macintosh HD/var/db/.AppleSetupDone”

or identical, but without quotes

Code:
rm /Volumes/Macintosh\ HD/var/db/.AppleSetupDone
 

PeteMacMan

macrumors member
Original poster
Jun 12, 2023
30
4
London
Ok i did the volumes previously on researching, after it said no file found. But I have no Macintosh HD anymore? Only the replacement Samsung Evo as named above. So the suggestion was to cd to that named drive.

Are you saying I don't need to cd?

Instead I just write

1. rm “/Volumes/SAMSUNG SSD 870 EVO,/var/db/.AppleSetupDone”

then type

2. reboot

Would that be correct?
 

bogdanw

macrumors 603
Mar 10, 2009
5,809
2,814
Unmouting and remounting the volume should make it writable. Try from Disk Utility, then rm from Terminal.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.