Disk Permissions Catastrophe

Discussion in 'macOS' started by herald1964, Jan 31, 2010.

  1. herald1964 macrumors newbie

    Joined:
    Jan 25, 2010
    #1
    Help

    Reset my disc permission is Disk utility ...like the idiot i am, and now My MBA won't boot past the Apple logo and spinning cog.

    In Single User Mode the key problem seems to be.

    sudo: /private/etc/sudoers is mode 0666, should be 0440
    :/ root# sendmail: warnibg: valid_hostname: empty hostname
    sendmail: fatal: unable to use my own hostname

    Any idea? is it possible to repair permissions in Single User mode?

    Mike
     
  2. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #2
    for sudoers, user and group should be root and wheel.

    In single user mode, just do

    Code:
    cd /private/etc
    chmod -r 440 sudoers
    
    Can't see why that would be a problem though: 660 is read and write, 440 is read only for user and group. Is the user and group root and wheel still? How did Disk Utility manage to do this?
     
  3. herald1964 thread starter macrumors newbie

    Joined:
    Jan 25, 2010
    #4
    Thanks, tried that all i got back was:

    chmod: 440: No such file or directory
    chmod: sudoers: Read-only file system

    Sadly this is an inherited MBA, so i do not have the original install media disk so i was hoping to sort this out in Single User mode. I don't want to have to buy another version of Leopard.

    Any other ideas?

    Regards

    Mike
     
  4. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #5
    Sorry typo on my part. Capital R is needed.

    Code:
    cd /private/etc
    chmod -R 440 sudoers
    
    Can you describe exactly what you did to 'reset' your permissions?
     
  5. herald1964 thread starter macrumors newbie

    Joined:
    Jan 25, 2010
    #6
    Hi Denarius

    Basically when i got the MBA, i had inconsistent permissions throughout (i'd have to give myself permission to copy to certain folders) which was a bit of a chore. I then noticed in Disk Utility, i could apply consistent read/write permissions to the entire disk (no warning came up that this was a bad thing!).....so i did it....next time i booted up it got stuck in the re-boot cycle.

    I have an appointment with a Genius!! on thursday in Cambridge, who will re-install the OS. but if there is a better way of doing it...i'm all ears!

    Regards

    Mike
     
  6. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #7
    Sorry to be the bearer of bad tidings, but if you've applied uniform permissions throughout the entire directory structure then you're seriously up the creek and reinstalling is the only realistic way to go: applying the correct permissions throughout the system again would take forever manually.

    Do you have an external hard drive? If you have important data on the computer you can still get it off there from single user mode. Plug in the volume, then do:
    Code:
    cd /Volumes
    ls
    Take a note of the name of the external volume, we'll call it volume for the following

    Code:
    cp -rf /Users/[I]username[/I] /Volumes/[I]volume[/I]
    Note, the permissions on these are still knackered at this stage so do the following in this order.

    Code:
    cd /Volumes/[I]volume[/I]
    chmod -RN [I]username[/I]
    chown -R username:staff [I]username[/I]
    chmod -R 700 [I]username[/I]
    cd [I]username[/I]
    chmod -R 755 Sites
    chmod -R 755 Public
    
    When you've had it reinstalled, you can just copy the files back into the relevant folders in your user folder on Macintosh HD providing that your user name is the same as it was.

    Is that Cambridge Massachusetts or Cambridge Cambridgeshire?
     
  7. herald1964 thread starter macrumors newbie

    Joined:
    Jan 25, 2010
    #8
    Thanks for the help, i'll let you know how the re-instal goes.....Cambridge, Cambridgeshire!

    Regards

    Mike
     
  8. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #9
    Small world, that's where I was at uni. :)
     
  9. chelseybaker macrumors newbie

    Joined:
    Feb 6, 2010
    #10
    Sorry to butt in :)

    After hours of searching I finally came across this thread. I have just done the exact same thing with permissions, I believe my entire hard drive is read only, and I've done everything I can possibly think of (including everything suggested here) to fix it. I figured I'd have to format which wasn't a problem but it won't format either. I have a Leopard disk and when I try to boot from it, my mac almost immediately restarts and just goes back to the gray screen for three minutes or so, and just restarts again.

    If you can let me know if reinstalling worked for you and how you did it (disk, drive, netboot..), or if you had to do anything special, or if it didn't work at all, I'd much appreciated it. This is very frustrating :(

    Thanks soo much

    Chelsey
     
  10. -aggie- macrumors P6

    -aggie-

    Joined:
    Jun 19, 2009
    Location:
    Where bunnies are welcome.
    #11
    Did you simply do a Repair Disk Permissions to get in this state?
     
  11. chelseybaker macrumors newbie

    Joined:
    Feb 6, 2010
    #12
    I did not. I changed permissions to Read/Write on my hard drive because I was having problems sharing files with my PC. Why would it set my entire hard drive to read only if I had set it to Read/Write?

    It was a stupid move apparently but I like to mess with things a lot. I've never never screwed up to the point where I couldn't fix it myself :X

    Thanks for the quick response too :)
     
  12. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #13
    Okay, I've been doing a bit more reading on this and I've revised my opinion to it might be possible to save the day by starting from your install DVD and repairing permissions on Macintosh HD via Disk Utility on the install DVD.

    If this proves enough to get you back into OSX on your hard drive, repair permissions again from the version of Disk Utility on your hard drive. There may be residual problems after this, but lets cross that bridge if we get to it.
     
  13. chelseybaker macrumors newbie

    Joined:
    Feb 6, 2010
    #14
    Wouldn't I have to boot from the disk for that? When I try to boot from a disk it just restarts. Unless you're talking about something else? :)
     
  14. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #15
    I'm talking about booting from DVD, not hard disk. You need to hold down C when you turn on the computer with the DVD already in the drive.
     
  15. chelseybaker macrumors newbie

    Joined:
    Feb 6, 2010
    #16
    Right I should have been more specific that's what I meant the DVD. When I boot from the leopard disk it just restarts :(
     
  16. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #17
    Blimey, that's far out.

    One last thing I can think of, turn on while holding down command(apple key)+s, then at the prompt type

    Code:
    diskutil repairPermissions /
    Think this was the answer to the OPs original question, but I've only just discovered it. Soz mate.
     
  17. chelseybaker macrumors newbie

    Joined:
    Feb 6, 2010
    #18
    Yeah I did that too I get the sendmail error and it just hangs :(
     
  18. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #19
    The fact that it restarts when you're trying to start from DVD makes no sense at all to me. The system shouldn't be referring to the hard drive at all for a boot from DVD so shouldn't be restarting, at least as far as I understand it.

    Get your install CD again, but this time start holding down the alt key, so you get a choice of volumes to click on. Click on the DVD icon (just making absolutely 100% sure you're booting from DVD and not anything else). If it restarts again during boot then you've exhausted all possibilities for getting back in.

    Out of desperation I'd boot holding down cmd+alt+P+R to reset the pram and then immediately try and boot from DVD again by holding down the C key on boot. If still no results, I'd be checking it's still in warranty and giving Apple a call and deny all knowledge of having done anything to the permissions...

    At that stage I'd run the DVD that originally came with the computer again, holding down D rather than C, and do a full hardware test as well though, just in case something hardware related had coincidentally happened at the same time as my permissions misjudgement.
     
  19. DewGuy1999 macrumors 68040

    DewGuy1999

    Joined:
    Jan 25, 2009
    #20
    +1 to Denarius' advice. I've never heard of Mac restarting when try to boot from the optical drive, that's weird. It does sound like something else is going on here.
     
  20. chelseybaker macrumors newbie

    Joined:
    Feb 6, 2010
    #21

    Yeah I always boot holding option because I never remember all of Apple's boot keys haha. Resetting the P RAM was my first step which I did many times. What happens when I hit the power button is it hangs for about three minutes on the grey screen and then restarts and does this indefinitely. If I hold down option, it pulls up the hard drive and the leopard disk no problem, and also searches for a wireless network. I've tried booting into safe mode which does nothing. I can boot into single user mode, see all my files but can't do anything. Every time I try to change anything it just says read only file system or gives me the sendmail error which I know isn't the "real" error. I've tried running fsck which gives no errors.

    Tomorrow I have work (I work for a tech department in a school district) so I'll have any tool I'll possibly need. I'm going to try to boot in target disk mode and see if I can repair permissions so I can at least format it. Or take it out and use a SATA to USB cable. What a pain this is. I guess that's how you learn. :) I'll let you know how it turns out. If that doesn't work I'll run apple tests and hopefully be able to send it in and play it off like I'm a dumb blonde. Worst case I buy a new hard drive.

    Thanks Denarius for all your help. I'll get this one way or another :)
     
  21. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #22
    No probs, sorry it hasn't actually been any help, but one last shot anway.

    Back to single user mode

    Code:
    chmod -R 777 "/Volumes/Macintosh HD"  (change Macintosh HD to what you named your main volume if necessary)
    
    That will set every single file on your hard drive to read write and execute for the user, group and everybody else. If that command works, give the diskutil command another whirl from single user mode.

    Failing that, your USB to SATA plan sounds like the next best option. If it's any consolation, I've been known to create a complete horlicks in the past through the injudicious application of a little knowledge. I've got dark brown hair, so there's no excuse. ;)
     
  22. chelseybaker macrumors newbie

    Joined:
    Feb 6, 2010
    #23
    Yeah I did that yesterday to the whole hard drive thinking the permissions would probably still be screwed but at least I would get it to boot and that actually created more problems I think. I can't remember if it was when I was mounting it or what I was doing but it would say whateverpath/subdoers is 0777 should be 0440 so I was like okay change to 0440 then it would say error read only file system which contradicts the previous error lol. I'm in quite a mess and this is probably why they don't let girls be computer science majors haha :)
     
  23. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #24
    Found this snippet describing fixing sudoers in single user mode. Must look up these commands and find out what they are...

    Code:
    /sbin/fsck -fy
    /sbin/mount -wu /
    /bin/chmod 1775 /
    /bin/sync
    exit
    
     
  24. chelseybaker macrumors newbie

    Joined:
    Feb 6, 2010
    #25
    I had tried something similar to those commands. I doubt they would have worked as I could never mount anything in the first place.

    I fixed it though :) I booted into target disk mode and copied over some files like my iPhoto Library and such. Then I erased the drive and formatted it and it seems to be good as new now :) I'm hoping when I copy my old files over that I don't get more permission problems. I doubt it though, but I'll run repair permissions just to be safe and if I still do I'll just start over. It's just my iTunes and iPhoto libraries I don't feel like rebuilding but if I must I must.

    Thanks for everyone's help!! :D
     

Share This Page