recover deleted account from terminal

merrickpl

Registered
Can this be done?

I am very new to Macs. Recently I was given the job of trying to fix a G4 for the town's public access committee. I ended up buying a used G4 and swapping out the HD and cards. All was well but no one could remember the old password, so nothing could be updated.

So I used: "/sbin/mount -uaw" "rm /var/db/.applesetupdone" "reboot" and setup a new account from which I could change the original account's password; then chose the original account to be the default boot.

In the original account I was able to update all the software, (except a 168 MB combined update for OS 10.4) and decided to delete the new account just to get things back to how they were before.

Mistake. The new account must have been made the root account, because now the system hangs at the Mac OS X screen and the progress bar never gets any blue.

The above commands in terminal don't go beyond "...applesetupdone", which receives a "no such file or directory" response.

G4; OS X 10.4
 
No, I don't have access to the install disks. I'm not sure who has them, but I'm hoping I can fix this without having to ask around. Also, the original account had Microsoft Office 2004 with all the updates so if I have to get the computer working again from an install disk and I archive the old setup I don't know how to restore Office (or anything else, for that matter) from that.

I don't know if this helps anyone to see a solution, but I deleted the new account by dragging it to the Trash from the Accounts window. There it sits.

Further information: "sh /etc/rc" at the terminal finishes with a message "date&time newusernames-power-mac-G4-agp-graphics mdimportserver[156]; Could not create DiskArb session or approval session." where the 'newusername' is the deleted account's short name. The message repeats every few seconds with the time and [###] incrementing.

If there is nothing that can be done and I get the Tiger install disk, then what? Would I be better off using another HD (I have a few) to install and setting the old one as a slave to draw information (programs?) off it? Can this even be done? Or can I fix the old HD from the new one, restore the account from the Trash somehow?
 
Last edited:
Thats one hell of a mess for a password reset. What would possess you to go into terminal and fumble around while being new to Macs. I don't want to sit here and crucify you when you are trying to get help. But given the damage that has been done if the data is crucial, I would recommend you take it to a pro. In our shop we usually charge $40.00 for a password reset, but what you've done now might have turned into $200.00 in labor for software fixes.

I haven't seen the damage to the file structure. I would first try a safe boot. But if no love there, and the data is critical you are going to need not only some installers, but another mac to connect to with enough HD space to make a .dmg (disk image) of the hosed drive. Then when you have a good disk image saved you can attempt an archive & install to try and bring it back.

For future reference, system preferences/accounts to add/remove user accounts. Plus you couldn't have deleted root. You can enable/disable root, but never delete. I think you really hosed something dragging the account to the trash.
 
Last edited:
Thank you for the safe boot suggestion. I have, since last post, gotten the install disk and run First Aid and seen in the Reset password utility that the System Administrator (root) account is still listed, as is the new account name I dragged to the Trash, so I assumed I hadn't deleted Root after all. Obviously, I did a poor job of removing new account, or it wouldn't be listed.

It still wouldn't boot after First Aid. I got to the screen with the progress bar only to see no progress a few time and powered off by holding in the power button, before trying Safe boot. So when Safe boot wouldn't work (reaching the same screen with no progress on the bar, or any Safe Boot subtitle) I ran First Aid again (file permissions fixed; nothing to fix in Repair Disk) and chose to reboot into OS 10.4.11, then held down the Shift key again, to try a Safe boot. It promptly created a new account, as it did after I removed ".applesetupdone", and started in Safe Mode. I don't know why it did this.

At the login choice screen, I chose to login to the original user account, rather than into the newest account.

Here, there is a folder in the Trash named 501.263650471 with files in it named annex_aux, annex.db, filetoken.db, fonts.db, Local.fcache, Local.fodb, qdfams.db, System.fcache, User.fcache, and User.fodb. I assume this is what I dragged into it from the Accounts window.

At this point should I try to restore these files or should I just use the suggestion to remove that account using system preferences/accounts and the add/remove function? I don't need the account.

I am hesitant to remove the newly created third account, yet, or to choose the original account as the defaut boot account, but I suppose this is what I am to do (at least the second, eventually).

I will just leave the computer on for now and wait for a reply. If none comes I will just remove the second account as above and see what happens on reboot. If that goes well, I'll try changing the default. Eventually, unless I hear protests, I'll try removing the third account.

If you've read this far, thanks for following me in verbose mode. I just want to be as clear as possible.
 
Just go into system preferences/accounts and delete the account or accounts you want to delete. After that try to empty the trash if the trashed files are still there after the account deletion. Try to reboot normally, I imagine it should. Once booted normally do another couple rounds permissions repairs in disk utility.

And once again for the record an administrator account is NOT root. Root CANNOT be deleted. But when root is active it has access to all and may do whatever it wants. Root is a very powerful tool which you should stay away from if you are a rookie!
 
Last edited:
Thanks. It's working now and has successfully rebooted. I wish I understood what happened because I don't think dragging a user to the Trash should have done that or why, on the last Safe Boot, it created a third account.

Maybe the problem came from something else: On the last run of Software Update, a few minutes ago, the 168 MB MacOSXUpdCombo10.4.11PPC.pkg that wouldn't install twice before was no longer the available update.

Instead a 76.1 MB Security Update 2009-001 (PowerPC) was listed.

Before the crash, after the second attempt to install the combined 168 MB 10.4.11 software update, following a suggestion that accompanied the notice of failure to install, I dragged the .pkg file out of the Trash to the Desktop and double-clicked it. Nothing happened. The computer had become sluggish after the failure to install and still wasn't responding well when I shut it down after dragging the second account into the Trash.

Irrelevant?

I was so caught up in straightening out the accounts/password problem that I didn't think the software update was the source of the new trouble. Maybe it was; maybe not.
 
I don't know if this helps anyone to see a solution, but I deleted the new account by dragging it to the Trash from the Accounts window. There it sits.

Further information: "sh /etc/rc" at the terminal finishes with a message "date&time newusernames-power-mac-G4-agp-graphics mdimportserver[156]; Could not create DiskArb session or approval session." where the 'newusername' is the deleted account's short name. The message repeats every few seconds with the time and [###] incrementing.

There are many times software updates won't auto-install through software update. You just go download the combined update and manually install it. I know for a fact dragging those accounts to the trash screwed things up. What you posted above proves that by hanging at that point.
 
Back
Top