Terminal Help (related to .DS_Store)

Discussion in 'Mac OS X 10.3 (Panther) Discussion' started by Elan0204, Jun 23, 2004.

  1. Elan0204 macrumors 65816

    Elan0204

    Joined:
    Apr 16, 2002
    Location:
    Chicago, IL
    #1
    Ok, so I was having the problem in this thread (http://forums.macrumors.com/showthread.php?t=67237), so I took the advice posted about using the terminal to fix the problem. The advice seemed pretty sound, as it helped the two other people in that thread, and the person providing the advice said the commands weren't to serious if something were to go wrong. Well, it seems that something did go wrong, and at least to me, it seems pretty serious.

    My initial problem was with the saving of icon arrangement in certain folders (The root folder of my hard drive, and the Applications folder to be exact) and the advice was fixing permissions on .DS_Store using the Terminal. Well after following the advice, I got permission denied messages in the Terminal, and then when I clicked on my desktop, all the icons on it disappeared (the Finder application is still running). It also appears that right clicking has been disabled in most places, among other problems. Oh, now it appears that the tab bar in Safari has vanished, and I can't create new tabs or windows. Here is what I had typed in the Terminal:

    Last login: Wed Jun 23 20:21:02 on console
    Welcome to Darwin!
    Elan-Feldmans-Computer:~ elanfeldman$ ls -ld / .DS_Store
    -rwxr--r-- 1 elanfeld elanfeld 15364 23 Jun 18:31 .DS_Store
    drwxrwxr-t 41 root admin 1394 23 Jun 20:20 /
    Elan-Feldmans-Computer:~ elanfeldman$ groups elanfeldman
    elanfeldman appserverusr admin appserveradm
    Elan-Feldmans-Computer:~ elanfeldman$ sudo chown elanfeldman:elanfeldman / .DS_Store
    Password:
    Elan-Feldmans-Computer:~ elanfeldman$ sudo chmod 0644 / .DS_Store
    Elan-Feldmans-Computer:~ elanfeldman$ ls -ld / .DS_Store
    -bash: /bin/ls: Permission denied

    In an attempt to run one of the other commands again, I received this:
    -bash: /usr/bin/sudo: Permission denied

    Now, my shortname is kind of long (elanfeldman) could that have contributed to the problem? Anyways, I have no idea how to fix this, so help would be greatly appreciated.

    edit: I tried clicking on the Finder icon in the dock, and it caused the finder to close. Clicking on the icon again does not relaunch the Finder.

    edit 2: So I ended up trying rebooting after Safari crashed and I couldn't reopen it. Mac OS X loaded to the screen where the status bar appears, and the bar made it all the way to the right (except no text appeared to describe what was being loaded). Once OS X finished loading I get stuck with a screen that has a solid light blue background, and a mouse cursor. Right now I've booted off a backup on an external firewire HD. Double clicking on the Macintosh HD mounted on my desktop tells me I don't have sufficient access privileges to view the HD. Any help?
     
  2. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #2
    why did you try to chown a file you already owned?
     
  3. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #3
    oh, i see what you did.

    when you issued this command:
    sudo chmod 0644 / .DS_Store

    you chmod'ed the root directory and .DS_Store. very bad. also, you should have been working on ~/.DS_Store, not /.DS_Store, and especially not "/ .DS_Store" (note the space, which provides two separate args to the command, / and .DS_Store, instead of /.DS_Store, which is the file off the root directory. of course, i think you meant ~/.DS_Store, the file in your home directory, all along).

    so / now belongs to you, instead of of root. you gotta fix that. fix the permissions, too, though i'm not sure what the octal value is. you can try 755 to see if it will automagically give you that 't' in the last position. in any event, it'll be better than what you had.

    and put the /.DS_Store ownership and permissions back, too.

    your ~/.DS_Store looked fine to begin with.
     
  4. Elan0204 thread starter macrumors 65816

    Elan0204

    Joined:
    Apr 16, 2002
    Location:
    Chicago, IL
    #4
    Sorry, but I'm going to need a step by step explanation of how to do this. Especially, since I can no longer boot into the copy of Mac OS X on my internal HD. As for why I tried to do this in the first place, see the thread I linked to in my first post. I've tried many other things to try and fix this problem, so I thought I would give this a try. Of course, as it turns out the person posting this advice was not correct in saying that nothing bad could come out of his commands if they didn't work right.
     
  5. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #5
    ...except that you gave the wrong arguments to the command. that space made all the difference in the world.

    maybe the easiest thing to do is just reinstall osx, using that option to retain your home directory. though it would be an interesting experiment to first try fixing permissions.

    good luck.
     
  6. Elan0204 thread starter macrumors 65816

    Elan0204

    Joined:
    Apr 16, 2002
    Location:
    Chicago, IL
    #6
    Ah, I see that know. I just highlighted over it to see that the slash actually had no space before the period. /. in bold like it was in the original post really looked like it had a space after it, especially when put in italics when it was quoted.

    Although the person that posted it said, and I quote:

    I think an extra space counts as a simple mistyping, with obviously not very benign results.
     
  7. pooky macrumors 6502

    Joined:
    Jun 2, 2003
    #7
    Before you go to the trouble of reinstalling everything, I have a few ideas.

    Try rebooting from your mac OS X CD. (Hold in the "c" key as you start up) Choose Disk Utility from the (I think) Apple Menu. Click on your hard drive and try repairing permissions. It probably won't hurt to run Disk First Aid, as well. Then try rebooting.

    The reason you're getting permission denied errors, and crashing is that the "chmod 644 /" command took away execute privileges for your entire system. chmod 644 tells the computer that whatever file/directory your changing should be read/write for the owner and read only for everyone else. That means every executable, from Safari to "ls" to your system files can no longer be executed.
     
  8. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #8
    try these:

    % sudo chown root:admin /
    % sudo chmod 755 /

    and see if that gets your system back.

    the % is simply the prompt, btw
     
  9. pooky macrumors 6502

    Joined:
    Jun 2, 2003
    #9
    Assuming he could run chmod (which I don't think he can, since he doesn't have privileges), chmod 755 / is wrong. It should be 775, because / should have rwx privileges for root and admin, and rx for guest.

    ~Edit, said something dumb
     
  10. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #10
    my bad. 775 is more correct than 755. but the correct value, i've just determined, is 1775. that sets the sticky bit properly, like this:

    [~] > ls -ld /
    drwxrwxr-t 75 root admin 2550 20 Jun 02:20 /
    [~] >
     
  11. Elan0204 thread starter macrumors 65816

    Elan0204

    Joined:
    Apr 16, 2002
    Location:
    Chicago, IL
    #11
    This appears to have fixed my problems! Right after this happened I was thinking if only I could run disk utility to repair permissions. Too bad I forgot I could run it from the Mac OS X Install CD. All it had to do was change the owner and group of "." and that fixed everything. Thanks very much pooky and zimv20.

    Anyways, not to appear ungrateful, but I do still have the same problem that led me to enter these commands in the first place. Could either of you help me to solve this problem?
     
  12. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #12
    hey! i was the first one to suggest repairing permissions! grumble grumble...

    :D
     
  13. Elan0204 thread starter macrumors 65816

    Elan0204

    Joined:
    Apr 16, 2002
    Location:
    Chicago, IL
    #13
    Hey sorry about that. It was just that pooky suggested booting from the Mac OS X CD and running disk utility to repair permissions. You did say fix the permissions, just not how I was supposed to do that without being able to load OS X. Anyways, thanks to you too for your help, and I'll edit my other post to reflect my thanks.

    Anyways, you wouldn't know how to fix my problem from this thread, would you? After a restart the icon placement in Macintosh HD and the Applications folder is not saved.
     
  14. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #14
    i was just givin' ya a wee bit of crap. no worries.

    regarding the .DS_Store stuff, as you've seen in the original thread, i'm not certain why it was suggested to change /.DS_Store instead of ~/.DS_Store. so run this command (cut and paste it! :) and post back the results:

    % ls -lF /.DS_Store ~/.DS_Store


    don't worry. this command only reports, it can't change anything.
     
  15. Elan0204 thread starter macrumors 65816

    Elan0204

    Joined:
    Apr 16, 2002
    Location:
    Chicago, IL
    #15
    Here is what I get:

    Elan-Feldmans-Computer:~ elanfeldman$ ls -lF /.DS_Store ~/.DS_Store
    -rw-r--r-- 1 root admin 6148 29 Oct 2003 /.DS_Store
    -rw-r--r-- 1 elanfeld elanfeld 15364 23 Jun 18:31 /Users/elanfeldman/.DS_Store

    Although, the problem is not with folders in my home directory. The two folders that don't retain changes between restarts are:

    1) Macintosh HD (the folder where Applications, System, Users, etc. are)

    2) Applications

    Actually, nevermind, those are the 2 folders I noticed. This problem actually effects every folder inside Macintosh HD, until I get inside my home directory.

    edit: It seems the problem always extends only one level deep. So there is a problem with the contents of Library, but not with the contents of any of the folders inside Library.
     
  16. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #16
    i don't think this will fix the issue, but let's do it anyway (cut and paste!) so the permissions look like mine:

    % sudo chmod 775 /.DS_Store
    % chmod 755 ~/.DS_Store

    then run that ls command again to check the results. here's what mine look like:

    [~] > ls -l /.DS_Store ~/.DS_Store
    -rwxrwxr-x 1 zim admin 12292 13 May 23:56 /.DS_Store*
    -rwxr-xr-x 1 zim staff 12292 22 Jun 17:14 /Users/zim/.DS_Store*
     
  17. pooky macrumors 6502

    Joined:
    Jun 2, 2003
    #17
    For some reason, you aren't authorized for your .DS_Store files all over your hard drive.

    The command to use is:

    sudo chown <yourusername> <path>/.DS_Store
    chmod 0664 <path>/.DS_Store

    <yourusername> is your short user name. <path> is the path to the folder where you're having problems. So for Macintosh_HD use /.DS_Store (with NO space). For Applications use /Applications/.DS_Store. Repeat it for every folder you want to change
     
  18. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #18
    yeah, what pooky said. here's the command for the broken one in root:

    % sudo chown elanfeld /.DS_Store

    as always, cut and paste. this is one of the ones that screwed you up last time.
     
  19. Elan0204 thread starter macrumors 65816

    Elan0204

    Joined:
    Apr 16, 2002
    Location:
    Chicago, IL
    #19
    Is my short username only the first 8 characters of my short name, because mine is longer than 8. Should I use the whole short username or only the first 8 characters?
     
  20. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #20
    i pulled that shorter username from the results of your ls command. your system seems to like it, so i say try the shorter one.
     
  21. Elan0204 thread starter macrumors 65816

    Elan0204

    Joined:
    Apr 16, 2002
    Location:
    Chicago, IL
    #21
    After entering my password with the shorter short username I get

    chown: elanfeld: Invalid argument

    I'm guessing this means I should try the full length short username?
     
  22. Elan0204 thread starter macrumors 65816

    Elan0204

    Joined:
    Apr 16, 2002
    Location:
    Chicago, IL
    #23
    It seems that I only had to do this once for Macintosh HD, and it took care of the problems with all the other folders. Thanks again zimv20 and pooky. I'm going to go and update my backup now, just in case I decide to do anything else to mess my Mac up. :D
     
  23. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto

Share This Page