Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had a problem on my SunOS 5.5.1 installation, so I tried to restore from a backup. After the restoration completed, /var was empty. I have another workstation with the same OS. How could I get a copy of /var from one machine to the other?

share|improve this question

migrated from stackoverflow.com May 18 '11 at 13:21

This question came from our site for professional and enthusiast programmers.

Why is /var empty ? How did you restore the file system ? Why are you using such an old and no more supported version of Solaris ? – jlliagre May 18 '11 at 9:57

If you've lost everything in /var, you have nothing to lose by copying over the whole contents of /var. I wouldn't advise copying the files though, as many of them will be machine-specific or tied to a particular machine state and most will be created automatically as needed. What you need to have is the directory structure. On the working machine, run this as root:

cd /var
find . -type d | cpio -o >/tmp/var.cpio

Copy the file var.cpio to the damaged machine and run this as root:

cd /var
cpio -i </tmp/var.cpio

If you discover files that must be copied as well, add them to the find expression above.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.