How to recover from chmod -w on top-level?

Zim

Registered
I got very lucky last night, but wanted to get some feedback on other recovery methods...

As usual, the 10.1 Installer reset all my top level permissions, making sendmail unhappy.

As I've done thru all the previous releases, I went to / and attempted to

chmod g-w .

but instead (I think) typed

chmod -gw .

Boy, talk about making a system UNHAPPY... lost my Terminal window, then Finder, of all oddness all I had left was IE 5.1, and couldn't discover any useful recovery method thru it, so I rebooted and thought maybe I could boot from the 10.0 or 10.1 installer disk and pop out into a Terminal from it.. no dice.. a reboot failed as services started up (oddly enuf), but it seemed to get hung as it tried to start up my user...

After several more fits, I put in the 10.1 installer and tried to reinstall it thinking hey this durned thing changed my permissions the first time, maybe it'll do it again...

It failed 2/3 of the way thru...

However it had changed the perms (wonder why it then failed?)...

Breathing a heavy sigh of relief, I was ok again...

But I'm wondering what else I could have tried to get back in?

Thanks,
Mike
 
You could have booted into single user mode. Your boots were failing (I'm guessing here) because something was trying to write something to the drive/partition.

But single user mode doesn't mount the root partition as read/write. So you probably could have done that, remounted the drive as read/write (and hope that mount didn't fail in that :p), then just do chmod +w /

Probably :D
 
The reason it became quite unhappy is that it appears '-gw' clears all permissions:


localhost:/Users/blb $ touch testfile
localhost:/Users/blb $ l testfile
-rw-r--r-- 1 blb staff 0 Oct 4 12:52 testfile
localhost:/Users/blb $ chmod -gw testfile
localhost:/Users/blb $ l testfile
---------- 1 blb staff 0 Oct 4 12:52 testfile


Best fix would be to try single user as Darkshadow suggested and run

mount -o update /
chmod 1755 /

to set it back to the way it was (minus group write, of course).
 
Ignorant question perhaps...

but I think I am in single user mode already??

ie, I do not type in a login/pass. (which mode is this?)

When I booted (after the chmod -gw), it went thru all the startup stuff (Starting this... Starting that....) but then when it would normally start my user view with the menu bar, and a Terminal window, etc, it would keep switching between 2 lue screens of slightly different hues, and I'd see the pinwheel for a bit... it was as if it were trying to move on to step n+1, and timed out in that effort, and so reverted back to step n, and continued to loop...

Somewhere (and this sounds woefully ignorant) along the way my machine stopped asking me for login/pwd without me specifially going in and changing that (that I am aware of). As I am the only user, I didn't care and simply made a mental curiosity note that hmphm, I don't recall making that change....

Thanks for indulging me,
Mike
 
Um...that's not good. Try checking out Systeem Preferences -> Login Preferences, hit the tab for Login Window, and see if you have "Automatically log in" checked with your username and a password under it.

If not, then somethin is pretty screwed up somewhere. It could become an issue...

And no, that's not single user mode. To get to single user mode, start hold down Command (Apple)-s while you are booting OS X. This will get you to single user mode.

You would know if you were in it - there's no GUI (i.e. no Aqua). You are booted into the console (Looks like the Terminal.app, but full screen). Here you can run fsck to check/repair your disk/partition or do other sorts of needed repairs and what not. To get out of it, either type restart to reboot or bye to continue logging on normally (you could also type logout or exit instead of bye).
 
Ah... good to know a good hard command prompt is accessible :) I was suprised that I could not quite the Installer CD's and fire off a Terminal.

Will check that pref setting.

Cheers,
Mike
 
Back
Top