Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Recover from a single-user password-protected boot System
I recently was faced with a hanging login window on boot. After reading, it seemed the netinfo db was correcupt and I needed to boot single-user to fix it. When I tried, it was asking for a password. Using the install disk to reset the password did not work. What was going on?

After a lot of reading and inspecting found out that I had (a while ago) made an error adding a logouthook in the /etc/ttys file and instead of adding the -LogoutHook etc stuff before the closing quote of the loginwindow.app, added it after. The net result was that the "secure" option on the console was not seen anymore and a password was required.

Problem 1 How to even be able to check files on the machine?

The answer: Boot from CD and right after the gray screen appears, but before the Apple logo does, hold down command-S and boot in single user mode from the CD. Once there, issue this command:
mount -t hfs /dev/disk0s9 /Volumes
Your file system is now mounted on /Volumes and you can do some primitive stuff to it. You do not have editors available (ed is there, but /tmp is not writable). You can, however, cat files and inspect them. I used sed to edit the problem away (because it does not need a temp file). Now I could boot in single-user mode without the CD. If you need to mount multiple partitions, you need more directories for mount points. You can't create them, though, because the root file system on the CD is read-only. Here is the trick (instead of the above command):
mount -t synthfs /dev/null /Volumes<br>
mkdir /Volumes/m1<br>
mkdir /Volumes/m2<br>
mount -t hfs /dev/disk0s9 /Volumes/m1<br>
Additional disks can be mounted on /Volumes/m2, and if you need more, create more directories. The synthfs is a file system that cannot hold files, just directory structures, but that is all you need here.

Problem 2 Restore a good netinfo database. The OSXFAQ Mac OS X UNIX tip of the day from June 28th gives instructions that worked well for me.

Problem 3 Upon multi-user boot, the setup assistant runs.

I did not want to go through that, in particular because I did not know for sure the user directories would not be wiped (of course, I did not have a real current backup). The solution is to create a file like this:
touch /var/db/.AppleSetupDone
That's what did it for me.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[17,125 views]  

Recover from a single-user password-protected boot | 2 comments | Create New Account
Click here to return to the 'Recover from a single-user password-protected boot' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Recover from a single-user password-protected boot
Authored by: weee on Oct 05, '04 09:27:48AM

Thanks for the info.
But, what do you do if you have a password protected single user boot mode, and a password on boot from cd (openfirmware) too? And i forgot both of the passwords, (I set them a loooong time ago) =(
The only thing I can figure is that I'll have to take out the hard drive and put it in another ppc. That blows. Or I think someone told me if I take out the ram that will reset the openfirmware. I was hopeing someone had an easier way...



[ Reply to This | # ]
10.3.5 Setup Assistant Addendum
Authored by: heavyboots on Oct 08, '04 08:48:53PM

So, I was trying to see the dialog box for the new Setup Assistant Migration tool and foolishly reinstalled and reran Setup Assistant on my machine. Naturally, it nuked the .AppleSetupDone file and I couldn't get back on again; kept coming back to the Apple disco installer video.

When I went into single user mode to do the touch /var/db/.AppleSetupDone, I also noticed a new invisible file called .AppleSetupMigrate. I presume this was there to key the Setup Assistant into Migrate mode after creating the first user. In any case, I think the new hint should be:

rm /var/db/.AppleSetupMigrate;
touch /var/db/.AppleSetupDone

It may be possible to jump-start Migration by leaving that there as well as the SetupDone file? Didn't experiment enough to see though.



[ Reply to This | # ]