You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Deleted private­/var/db folder.... Can't boot

Hi, first I know that what I did was stupid but I didnt know what I was doing.. and I still don’t know what are the consequences.

In order to save space on my MBP 2011 Snow Leopard, I deleted private/var/db folder, yes the whole folder to the trashbin and then I emptied it. Files that were in use weren´t deleted.

So I rebooted and the screen is stuck on apple logo with the turning wheel and safe boot start normally but end up with the turning wheel too.


How can I put fix this issue?

Can I recover the files deleted ? Or at least put back the files that are still in the trash bin ?


Thank you for any help.

MacBook Pro, Mac OS X (10.6.8)

Posted on Mar 14, 2012 2:22 PM

Reply
35 replies

Mar 14, 2012 2:25 PM in response to Serenna

You will have to reinstall Snow Leopard.


Reinstall OS X without erasing the drive


Do the following:


1. Repair the Hard Drive and Permissions


Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.


If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.


2. Reinstall Snow Leopard


If the drive is OK then quit DU and return to the installer. Proceed with reinstalling OS X. Note that the Snow Leopard installer will not erase your drive or disturb your files. After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.


Download and install the Combo Updater for 10.6.8 from support.apple.com/downloads/.

Mar 14, 2012 2:29 PM in response to Serenna

If the files are still in trash you should be able to boot to Single User Mode and replace them with a move (mv) command, but it would take me a long time to work out the details. Maybe somebody else who is more regularly familiar with using Terminal and is actually running a copy of Snow Leopard (I use Tiger) could help.

Mar 14, 2012 2:38 PM in response to Serenna

Thank you for your answers, well the files that the OSX were using weren't deleted and are still in the trashbin, so I think they are the critical one and can be restored no?

I would like to use the installation DVD but Im far far from my home and I didn't take the dvd so I ll try one of a friend when I can.

Mar 14, 2012 2:48 PM in response to Limnos

If they borrow a disc it's possible to replace just the deleted directory using Pacifist:


How Restore Deleted or Missing OS X Components


A few of the basic OS X installed applications can be restored from the Optional Installs installer located in the Optional installs folder on your Installer DVD. However, if what you need is not there then follow the instructions below.


How to Use Pacifist to Restore Deleted or Missing OS X Components


Insert the OS X Installer DVD into the optical drive. Use a simple utility like TinkerTool to toggle invisibility so you can see invisible items. Alternatively, open the Terminal application in your Utilities folder and at the prompt enter the following:


defaults write com.apple.finder AppleShowAllFiles Yes


Press RETURN.


To turn off the display of invisible files repeat the above command substituting No for Yes.


The install packages are located in the /System/Installation/ folder on the DVD.


Download the shareware utility Pacifist. Use it to extract a fresh copy of the missing item(s) from the file archives on your OS X installation DVD. The file archives are in the /System/Installations/ folder (use Go to Folder option in the Go menu of the Finder.)


Here are Four Basic ways to use Pacifist (courtesy of George Orville.)


  1. Drag a .pkg icon onto the Pacifist window .....proceed to step 7.
  2. Click on “Open Package ....” and navigate to package desired and click “Open” in the open/save window.....proceed to step 7.
  3. Insert Mac OS X installer CD and when it mounts, navigate to .... Menu->Go->Go to Folder. In the path field enter or paste ....


/Volumes/disc name/System/Installation/Packages (where disc name is the name of the CD/DVD that you inserted.)


Click on the "Go" button ..... • Drag a .pkg to Pacifist..... proceed to step 7.


The package you'll need will have to be discovered by trial and error, but for most applications you should start with the Essentials.pkg and/or Additional Essentials.pkg.


D. Insert your Mac OS X install disk 1 .... and open Pacifist.


1. In Pacifist, select "Open Mac OS X Install Packages" ... dialog may appear asking for disk 2, then disk 3 and finally disk 1 again.... {if DVD is not used)...If “Stop Loading” is selected...the procedure will stop!!!


2a. When loading is complete, a new window appears, click the triangle to display contents of each package...Select item and proceed to step 7.


2b. or click the “Find” icon in the Pacifist window and type the name of the software you need.


3. In the list that comes back, click the top most entry for the item that you want. ..... that is the one for the English language.


4. On the top of the Pacifist window, click “verify” .... you will probably be prompted for your password.


5. Enter checks for.... “verify permissions” and “verify file contents.” and click “verify” ....enter password when prompted.... you will get back output which may look like this:


20 files were scanned. 20 of 20 files were present on the hard disk. 0 of 20 files had file permissions that did not match those specified in the package. 0 of 20 files had checksums that did not match those specified in the package.


6. Click “close”. Go to step 7.


Extract or Install........


7. In the Toolbar (upper left), you now have the option to extract or install. Click a file in the lower list and those two icons will be enabled.


8. If “Extract to...” is selected.... navigate to the location where the file will be placed, select “choose”, select “extract” in new dialog that appears,authenicate , if prompted, click “OK”.


9. In the next dialog, click “Extract”.


10. If “Install” is selected... dialog will appear with the location/path of the installed software. Click “Install”


11. Type in your password, click “OK”


Pacifist will begin to extract files.


12. In steps 8/10ß.... you also have the choice to “cancel”


Notes: Pacifist may find that a file it is installing already exists on the hard disk. Pacifist will present you with an alert panel....


  • Stop
  • Leave original alone
  • Update .....
  • Default selection
  • Replace .... (Replace option should only be used on full install packages)

Mar 15, 2012 10:43 AM in response to Serenna

When I boot with the installation dvd of a friend it says to reboot the mac and then the turning wheel with apple logo appear again, so it's not working. Yet I have isolated the db file from the cd, can I insert it in some way using the single user mode ? Or boot from another drive and acess my snow leopard partition and remplace it ?

Mar 15, 2012 10:45 AM in response to Serenna

The procedure requires you use Pacifist to reinstall the entire folder whose contents you deleted. This is done by carefully following the directions I sent you.


From your description I don't know what you did. If you booted from an installation disc, then all you can do is reinstall OS X from it.

Mar 15, 2012 11:17 AM in response to Serenna

Then I would find a suitable installer disc for your computer and reinstall OS X. You will need the same version as you now have installed or later. Otherwise, you will need to erase the drive to install a different point version (like 10.6 versus 10.7.)


For Snow Leopard do this:


Reinstall OS X without erasing the drive


Do the following:


1. Repair the Hard Drive and Permissions


Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.


If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.


2. Reinstall Snow Leopard


If the drive is OK then quit DU and return to the installer. Proceed with reinstalling OS X. Note that the Snow Leopard installer will not erase your drive or disturb your files. After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.


Download and install the Combo Updater 10.6.8 from support.apple.com/downloads/.

Mar 15, 2012 11:55 AM in response to Kappy

Kappy wrote:Then I would find a suitable installer disc for your computer and reinstall OS X. You will need the same version as you now have installed or later. Otherwise, you will need to erase the drive to install a different point version (like 10.6 versus 10.7.)


Hi Kappy, I'm a bit puzzled, maybe you can clarify. Are you saying that if, e.g., the current version installed is 10.6.8, the disc that came with the Mac, most likely 10.6.2 or 3, cannot be used to reinstall? This is not what I had always understood for the reinstall feature.


Have I misunderstood what you meant?

Deleted private­/var/db folder.... Can't boot

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.