Missing tmp file on osx 10.4

marknichol

Registered
G4 Powerbook Aluminium 15” running OSX 10.4

After finishing some work I have stupidly (through bleary eyes and some wine) deleted a folder that has now caused my powerbook on start up to go back to a fresh start like it has had a new operating system installed.

The folder was located (after clicking on the hard drive icon) along with Applications, Library, System, Users .

The folder was called something like tmp???and had a small curved arrow pointing north east on the blue folder icon. Inside the folder were lots of folders of unfamiliar names etc. The folder was deleted and is in the trash. The trash has not been emptied.

I would like to know how I can get this file out of the trash and back where it was. As I cant start up normally I am reluctant to go through the new osx start up procedure as I fear this may erase of damage the user, settings and stuff already on the drive.

I have another mac that can be used a firewire start up help. Have tried this and the drive mounts but unsure where the trash is located to put folder back!!! I thought it would be user/admin/trash but in users there is no admin (maybe because it's mounted from another mac?).

Here's where I am.

1)Havean disk utilities "repair permissions" etc but to no avail.
Have also tried Tech tools volume Check which passed but said "start up file >not present<".
Have also tried Disk Warrior which came up with
Folder-Var This folder pointed to by a system symbolic link file is missing. Location - untitled/private/

2)Am sure I did not rename my home folder. The "fresh start" is not like all prefs have gone but like it's just been turned on for the first time, the welcome graphics and music play before asking you to set up the mac for the first time. Would this wipe old user set up if followed?

3)If I try archive and install will it transfer all email stuff, plugins and applications etc as I have lots of music software set up that took ages to all work together!

Will back everything up by mounting from another mac with firewire before I try any major operations.

4)Is there anyway of accessing the trash to retrieve the deleted folder and place it back?

Thanks for any help....

Mark..
 
Hi Mark
Yes you can access the trash via terminal app when the mac is mounted over firewire, are you comfortable with doing this in terminal?
And yes please perform a full backup before doing anything.
Let me know when you are ready and I will talk you through it, we will need to place it back and check the symbolic link is working.
Ed
 
Ed
Thats great news. Ask a tech was unable to help so I really appreciate your assistance.
I can access terminal via my install disc under utility or is it best to go through the firewire mount process?
I haven't used terminal before but will happily follow your lead.
Will back up the hard drive tonight and then let you know.
Thanks

Mark....
 
Hi Ed
After cranking up my old G4 tower it's time for action. Mounted laptop and copied everything there to an external drive.
Ready to go ahead.
Cheers


Mark.
 
HI Mark

Sorry for the delay.
Ok here we go.

Open terminal and type - 'sudo passwd root' - this will enable the root user
Enter your admin user password, choose a password for the root user and enter it twice.
Enter- 'cd /Volumes/'
Enter- 'ls -la' note the name of the firewire mounted drive
Enter- 'cd /Volumes/nameofmounteddrive/'
Enter- 'ls -la'
This command should list all of the files/folders and hidden items on the root of your hard drive.
There should have been a symbolic link here that looks like this - tmp -> /private/tmp
Enter 'cd private'
Enter 'ls -la'
This command will list the contents of the private folder, is there a tmp in there, there should be
Ok now we find the deleted file
Enter 'cd /Volumes/nameofmounteddrive/Users/shortusername/
Enter 'ls -la'
There should be a .Trash folder in this folder
Enter 'cd .Trash'
Enter 'ls -la'
Now find the item you deleted hopefully it is still here as this folder is the contents of your users trash.
Find the file in question - tmp -> /private/tmp -is it here?
Enter 'mv tmp /'
This command should move the deleted file back to the correct place on the drive root, quit out of terminal and unmount the firewire drive from desktop
Reboot your Mac as normal, hopefully if all is well it should boot just fine.

One thing, the indication that the OS wants to setup the user again possibly means that it is not the tmp symbolic link that you deleted but could be the var symbolic link that is missing. If you get to the .Trash folder in the steps above and there is no tmp -> /private/tmp file there then look for the var -> /private/var file instead.

Hopefully i have not made this difficult for you, if it does not make sense PM me and we can take it offline.

Good luck
Ed
 
Hi Ed

Followed your instructions right to the last bit when I hit a bit of a stumbling block!

As you stated the tmp file wasn’t there but the var was, so..........

Entered mv var /
Asked override rwxr-xr-x root/wheel for /var? (y/n [n])
Entered y
Told mv: rename var to /var: Permission denied

Tried laptop but still same as I take it a the denied bit suggests the file hasnt moved.

Any ideas?

Thanks for all your help so far

Mark
 
Mark

Great, sorry my bad I just realized that I missed one vital step at the start-
Enter 'su'
Enter password chosen earlier for root user
Then try the 'mv var /'

Should work now?
Ed
 
Hi Ed,

Ran through as instructed but at end by mistake typed

mv var/

instead of

mv var /

this listed

usage: mv[-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source directory

Still no start up

when I then realized mistake went through procedure and typed proper command at end and got

mv: cannot resolve var:/Volumes/Untitled/Users/marknichol/ .Trash/private

Not sure if this is because of my mistaken type error?

Apologies for not being fast in reply and not the best typist! Have saved terminal read outs if any use?

Thanks

Mark...
 
Hi Mark
Been out the whole day.
Interesting, so if you enter
'cd Volumes/Untitled/Users/marknichol/ .Trash/'
Then 'ls -la'
Do you see a private folder in there or the symbolic link to var?
Ed
 
Hi Ed,

Yep it's in there

admins-ibook:/Volumes/Untitled/Users/marknichol/.Trash root#

Contains

lrwxr-xr-x 1 unknown unknown 11 Dec 12 15:55 var -> private/var

Mark
 
Hi Ed,

Ran disk utility. Here's the read out.

Repairing permissions for “Untitled”
Determining correct file permissions.
Permissions differ on ./Applications/iTunes.app/Contents/Frameworks/InternetUtilities.bundle/Contents/MacOS/InternetUtilities, should be -rw-rw-r-- , they are -rwxrwxr-x
Owner and group corrected on ./Applications/iTunes.app/Contents/Frameworks/InternetUtilities.bundle/Contents/MacOS/InternetUtilities
Permissions corrected on ./Applications/iTunes.app/Contents/Frameworks/InternetUtilities.bundle/Contents/MacOS/InternetUtilities

Permissions repair complete
The privileges have been verified or repaired on the selected volume


One thing I noticed was that it would not let me repair permissions until I open info on the mounted volume and unselected 'ignore ownership on this volume'. I could then run repair permissions but it didnt come up with much. Then ran through mv var / process again but all I got was again

mv: cannot resolve var: /Volumes/Untitled/Users/marknichol/.Trash/private

Could it be something to do with ownership and permissions of the mounted volume? Have attached snapshot of volume info menu (I hope) if any help!

Mark....
 

Attachments

  • Picture 4.png
    Picture 4.png
    29.5 KB · Views: 2
Mark
Ok try this-
In terminal enter - 'cd /private/
Enter - 'ls -la'
Do you see the var folder in there?
If yes the enter- 'cd /'
Enter - 'ln -s /private/var var'
This should re-generate the symbolic link for the var folder in the root of your drive.
Ed
 
Hi Ed

At which point do I enter this?
Right at the start of terminal or do I go to the end of the mv var / process where I have accessed my volume & users etc?

Thanks

Mark
 
Mark
Sorry should have explained, this can be run on its own.
This command will re-generate the link you deleted earlier instead of us try to pull it out the trash.
Ed
 
Ed

Ran it but

Last login: Sun Mar 29 09:43:12 on console
Welcome to Darwin!
admins-ibook:~ admin$ cd /private/
admins-ibook:/private admin$ ls -la
total 0
drwxr-xr-x 6 root wheel 204 Mar 29 09:42 .
drwxrwxr-t 29 root admin 1088 Mar 29 09:42 ..
drwxr-xr-x 88 root wheel 2992 Mar 29 11:45 etc
drwxr-xr-x 2 root wheel 68 Dec 13 2007 tftpboot
drwxrwxrwt 5 root wheel 170 Mar 29 11:45 tmp
drwxr-xr-x 23 root wheel 782 Mar 29 09:42 var
admins-ibook:/private admin$ cd /
admins-ibook:/ admin$ In -s /private/var var
-bash: In: command not found
admins-ibook:/ admin$


Mark..
 
Mark,

that's ln -s ...

as in: LN -S
(but all lower case) not In...

Robert

PS - Sorry to but in... (in stands for link, and what you are doing is creating a symbolic link)...
 
Last edited:
Hi Robert,

Thanks for pointer, this is my first run out in terminal so a bit in the wilderness!!!

Tried but this is what I got..........

Last login: Sun Mar 29 23:29:11 on console
Welcome to Darwin!
admins-ibook:~ admin$ cd /private/
admins-ibook:/private admin$ ls -la
total 0
drwxr-xr-x 6 root wheel 204 Mar 29 23:28 .
drwxrwxr-t 29 root admin 1088 Mar 29 23:28 ..
drwxr-xr-x 88 root wheel 2992 Mar 29 23:29 etc
drwxr-xr-x 2 root wheel 68 Dec 13 2007 tftpboot
drwxrwxrwt 4 root wheel 136 Mar 29 23:29 tmp
drwxr-xr-x 23 root wheel 782 Mar 29 23:28 var
admins-ibook:/private admin$ cd /
admins-ibook:/ admin$ ln -s /private/var var
ln: var/var: Permission denied
admins-ibook:/ admin$


Mark...
 
Just to re check & make sure.

I am running terminal from a mounted volume of a powerbook g4 on a firewire connected Ibook.

Really appreciate the help I've had so far.....

Mark..
 
Back
Top