Getting to know /var

Today I found out the best way to find out what /var really means on
a Gentoo system: I removed it.

Something strange happened. There was a shortage of disk space on the
/ partition, which also housed /var, so I created
/home/var on a different partition, did

tar -c --atime-preserve /var/* | tar -x -C /home

, added

/var /home/var auto bind 0 0

to /etc/fstab and rebooted into single user mode. There, umounted
/var to get back to the original partition (of course, the new
fstab-rule as followed already), and rm -rf‘d /var.

So far, so good.

Reboot…

Empty /var!

This means that almost no services can start up (no ssh, no syslog, no
portmap, no nothing…) as things like /var/spool, /var/log,
/var/run and /var/lock are gone an away…

But what’s worse: /var/www is bye-bye (luckily it contained only
localhost-websites) and /var/lib/portage/world as well. Now, portage
thinks nothing is installed and wants to re-emerge every tiny little dependency
out there. regenworld, I hear you think? Won’t work.
/var/log/emerge.log is gone, remember?

Add a Comment   Trackback  

Add a Comment