I accidentally deleted /private/var folder

Joined
Mar 16, 2013
Messages
4
Reaction score
0
Points
1
Soooo, I was told I could delete /private/var/vdm but I deleted "/var/" folder and now I can't run my mac. I tried using the Cmd+V startup and it says:

Crucial filesystem check: Path not present: /var/"foldername"/etc. Will create.

With some files and ends with

launch_msg() : Socket is not connected (x2)
AppleThunderbolt tNHI: :enablePower - turn power off, status = 0x0, result_value = 0x0

I then turned it on normally and it is stuck forever in the apple logo.

What can I do? I don't want to lose all my files and money by going to a repair center. :(
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
You're going to have to reinstall OS X if you have no backup. You didn't tell us which version of OS X you were running?
 
OP
M
Joined
Mar 16, 2013
Messages
4
Reaction score
0
Points
1
You're going to have to reinstall OS X if you have no backup. You didn't tell us which version of OS X you were running?

I have Lion and Cannot see what version but it's not the lastest. I tried also reinstalling Lion (from the CMD+R Utilities startup) but when I select the HD I want it closes, I have less than 2Gb left, maybe it's that.

I read that I could enter the CMD+S startup and type something in the console to take out of the trash bin the files I need (That contain my passwords and all data) but when I enter i cant write this

"$ cd
$ cd .Trash
$ sudo mv var /private"

because everytime i hit enter to write the next line, the system says it's an invaldi comand.

Edit: I have the old Macbook Air
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
You should be able to reinstall Lion from the Recovery partition as long as you have an internet connection.

Try this from the terminal:

In the Terminal type "cd .Trash" (without the quotes). This will navigate the terminal to your Trash folder. The dot before the directory name "Trash" denotes that the folder is hidden. Hidden folders do not show up in directory listing methods (when you type "ls") and can only be accessed by using their full name.

Type "mv your_file_name ../" without the quotes and replacing your_file_name with the name of the file you'd like to restore.

The above example would restore the file to your home directory. ( / )
 
OP
M
Joined
Mar 16, 2013
Messages
4
Reaction score
0
Points
1
You should be able to reinstall Lion from the Recovery partition as long as you have an internet connection.

Try this from the terminal:

In the Terminal type "cd .Trash" (without the quotes). This will navigate the terminal to your Trash folder. The dot before the directory name "Trash" denotes that the folder is hidden. Hidden folders do not show up in directory listing methods (when you type "ls") and can only be accessed by using their full name.

Type "mv your_file_name ../" without the quotes and replacing your_file_name with the name of the file you'd like to restore.

The above example would restore the file to your home directory. ( / )

Thank you, but I have one more question: The single user mode says:

"If you want to make modifications to files:

/sbin/fsck -fy
/sbin/mount -uw /"

And because it keeps telling me "-sh: cd: .Trash: No such file or directory"

I tried doing that, that checks the HD and then mounts the filesystem, but nothing happens.

How do I load terminal from Single User mode?
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Read through this entire thread: LINK

You should be able to glean enough from it to move that folder from the trash back where it belongs. If not, reinstall is the only thing left. An archive and install will retain all your data and replace the folder and files you lost. Since you have the original MBA, you'll need an Apple external optical drive and your original Leopard DVD.
 
C

chas_m

Guest
If there's less that 2GB space left on that hard drive, nothing short of a clean reinstall is going to be successful. There's simply not enough working room on the disk to do a normal reinstall.
 
OP
M
Joined
Mar 16, 2013
Messages
4
Reaction score
0
Points
1
If there's less that 2GB space left on that hard drive, nothing short of a clean reinstall is going to be successful. There's simply not enough working room on the disk to do a normal reinstall.

Thank you guys, I'll fix it tomorrow, yeah, I figured out it needed 2GB so I downloaded the installer to an external HD partition.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
If there's less that 2GB space left on that hard drive, nothing short of a clean reinstall is going to be successful.
I hadn't thought of this and the effect this will have on the success of an archive and install. So, I'm inclined to go with chas here and suggest that you probably don't have enough room for an archive and install (we could be wrong but I doubt it). Thus, expect to lose files, media and any other important content.

You're getting the "-sh: cd: .Trash: No such file or directory" error because the .Trash folder doesn't exist where you're currently located.
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Thank you guys, I'll fix it tomorrow, yeah, I figured out it needed 2GB so I downloaded the installer to an external HD partition.

Let us know how it went. And... this time make a backup! ;)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top