10.10 – Boot Hangs after Deleting /var/folders Directory

UPDATE 4-13-2015: Apple replied back to my bug report stating it behaves as expected and deleting the /var/folders directory is not supported. So….don’t delete /var/folders.

Previously, in OS 10.9 it has been documented that removing the data in /private/var/folders is a good troubleshooting step for various reasons. There is a good writeup at blog.magnusviri.com describing what /var/folders contains and what issues arise from its bloat. Up thru OS 10.9.5 it hasn’t been an issue deleting contents or the parent directory.

The article above mentions deleting just the contents of /var/folders, which is still good advice. However a haphazard deletion of the /var/folders directory itself will cause issues in 10.10. If you delete the parent folder /var/folders and reboot, the computer will boot to about 50% and hang indefinitely. It will look a lot like the “loginLockout” behavior except the progress bar is at around 50% instead of 33% and the cursor is on screen. Don’t be fooled as I was. This is not loginLockout.

Examining the boot drive while booted from another source showed many errors in system.log when booting about /var/folders/zz not being present. Surprisingly it appears that mkdir is being called but unable to create the directory structure.

.
.
.
Mar 19 09:40:26 macadmins-Mac.local dirhelper[1008]: mkdir(/var/folders/tx): No such file or directory
Mar 19 09:40:26 macadmins-Mac xpcproxy[1007]: libcoreservices: _dirhelper_userdir: 351: stat: /var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/: No such file or directory
Mar 19 09:40:26 macadmins-Mac.local dirhelper[1008]: mkdir(/var/folders/tx): No such file or directory
Mar 19 09:40:26 macadmins-Mac fontworker[1007]: libcoreservices: _dirhelper_userdir: 351: stat: /var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/: No such file or directory
Mar 19 09:40:26 macadmins-Mac fontworker[1007]: libcoreservices: _dirhelper: 454: mkdir: path=/var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/T/ modes[1]=0700: No such file or directory
Mar 19 09:40:26 macadmins-Mac fontworker[1007]: libcoreservices: _dirhelper: 454: mkdir: path=/var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/C/ modes[2]=0700: No such file or directory
Mar 19 09:40:27 macadmins-Mac storeassetd[304]: libcoreservices: _dirhelper: 454: mkdir: path=/var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/T/ modes[1]=0700: No such file or directory
Mar 19 09:40:27 macadmins-Mac fontd[227]: libcoreservices: _dirhelper: 454: mkdir: path=/var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/T/ modes[1]=0700: No such file or directory
Mar 19 09:40:31 macadmins-Mac.local dirhelper[1008]: mkdir(/var/folders/tx): No such file or directory
Mar 19 09:40:31 macadmins-Mac xpcproxy[1011]: libcoreservices: _dirhelper_userdir: 351: stat: /var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/: No such file or directory
Mar 19 09:40:31 macadmins-Mac.local dirhelper[1008]: mkdir(/var/folders/tx): No such file or directory
Mar 19 09:40:31 macadmins-Mac xpcproxy[1012]: libcoreservices: _dirhelper_userdir: 351: stat: /var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/: No such file or directory
Mar 19 09:40:31 macadmins-Mac fontd[227]: libcoreservices: _dirhelper: 454: mkdir: path=/var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/T/ modes[1]=0700: No such file or directory
Mar 19 09:40:31 macadmins-Mac fontd[227]: libcoreservices: _dirhelper: 454: mkdir: path=/var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/T/ modes[1]=0700: No such file or directory
Mar 19 09:40:31 macadmins-Mac loginwindow[64]: libcoreservices: _dirhelper: 454: mkdir: path=/var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/T/ modes[1]=0700: No such file or directory
Mar 19 09:40:31 macadmins-Mac fontd[227]: libcoreservices: _dirhelper: 454: mkdir: path=/var/folders/tx/56ff45qs2rlc89vggkr8x3yr0000gn/T/ modes[1]=0700: No such file or directory
Mar 19 09:40:31 macadmins-Mac.local locationd[241]: Could not write data to disk /var/folders/zz/zyxvpxvq6csfxvn_n00000sm00006d/C/cache.plist
Mar 19 09:40:45 localhost dirhelper[61]: /var/folders/: invalid ownership
.
.
.

To fix the issue I had to maually recreate the directories folders/zz in /var to allow the system to boot once again.

I’ve file a bug report and posted on OpenRadar.

Advertisements
Tagged , ,

15 thoughts on “10.10 – Boot Hangs after Deleting /var/folders Directory

  1. Kevin says:

    How did you recreate the directories folders/zz in /var?

    Like

  2. Alan Tai says:

    You save my day!

    Like

  3. Krle says:

    Thank you, you saved my life today!

    Like

  4. Kaya says:

    Didn’t work for me. Maybe thats because after i deleted /folders/var/ i tried to empty the trash and deleted some of the files. I also tried to reinstall but didnt work. I’ve made a bootable linux mint but macintosh hd couldnt mount. I need some of my files in it i dont know what to do now

    Like

  5. Kaya says:

    An update; so i tried to delete them permanatly on terminal with rm -r /var/folders but couldnt perform it either it says resource busy. I was planing to deleted for good and recreate it with mkdir command but didnt work that way too.

    Like

    • eholtam says:

      Try booting in single user mode or recovery mode to remove the data. It sounds from the two posts you’ve made that there may be larger issues going on with the disk as well.

      Like

  6. dieWithYourBootsON says:

    foolish step: rm -rf /var/folders. And now I am not able to enter in single user mode :(. Tried rebooting and command+s

    Like

  7. dieWithYourBootsON says:

    Being a newbee … I had to decipher ๐Ÿ™‚
    “Boot into single use mode, mount the disk, and then use the mkdir command to create the structure.”

    but it worked for me. Thanks a lot!!!

    Steps followed:
    1. From “https://support.apple.com/en-us/HT201573”
    Shut down your Mac.
    Press the power button to start up your Mac.
    Immediately hold down the following keys: Hold down Command-S for single-user mode.

    If FileVault is enabled, you need to unlock the startup disk as part of this process. White text appears briefly before the FileVault login screen is shown. After selecting a user and entering the userโ€™s password, the single-user mode or verbose mode startup process continues.

    /* Now you will end up on a command line */
    /* Enter the following commands on cmd line */

    2. From “http://www.pgts.com.au/cgi-bin/psql?blog=0806&ndx=b004”
    # check and fix the root file system
    /sbin/fsck -fy

    # remount the root file system as read-write (do this after fsck)
    /sbin/mount -uw /

    3. mkdir /var/folders/zz
    or mkdir /var/folders and mkdir /var/folders/zz

    4. reboot

    Like

  8. Jonathan says:

    Late after THE original post, but could anyone help? I tried THE above in single Usher mode but gat a “this is read only directory” have Googled around, but no luck so far. Thanks and happy 2016

    Like

    • Jonathan says:

      Somehow, it didn’t want to work. Then found a website suggesting doing
      Sudo /sbin/mount -uw /

      After that I did

      Mkdir var/folders

      And there you go, 25 minutes into 2016, it did the trick.

      Somehow it didn’t accept the command modify var/folders/zz command.

      But there you go, happy it seems to work

      Jonathan

      Like

      • eholtam says:

        Glad you got it working. In single user mode you do need to mount the volume before it can be edited as you discovered. Thanks for the follow up comment.

        Like

  9. I had a similar issue but it was a permissions problem on the /private/var/folder/zz directory. A simple chmod 755 zz fixed the boot problem

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: