Watch out when you move /var in Ubuntu
June 14, 2007 – 19:20 | UbuntuWhen I was installing my Ubuntu, there was this part where an experienced admin would spend some time devising a plan for which part of file system should be mounted from which partition. I decided to skip it and kept everything except /home on one single partition - just to keep it simple. Well, at an unfortunate moment during the past weekend, it suddenly hit me that I should stop being such a noob, and “make things proper”.
So I fired up gparted and broke a fat32 partition into a few ext3 ones. Reboot… enter single user mode… move /opt, /tmp, and /var into their respective parition… edit /etc/fstab… reboot. Voila! df confirms exactly what I had planned for, except…
Except the networking is completely down - “completely” as in “even the loopback 127.0.0.1 interface isn’t up”.
Rebooting with “nosplash” showed some peculiar messages:
Mount point “/var/run” does not exist. Skip mounting.
Mount point “/var/lock” does not exist. Skip mounting.
(and later)
/var/run/network does not exist…
After a bit googling, I ran into Chris Siebenmann’s wiki page on how Ubuntu requires /var/run to stay on the root file system even though /var is relocated to somewhere else. Among his comments, I found this particular sentence amusingly depressing (well at the moment it was just “depressing”):
If you started out without a separate /var filesystem and now want to move to one, apparently your life just sucks.
Eventually I fixed the problem by entering the single user mode, umounting /var, and manually creating /var/run and /var/lock in the root file system.

3 Responses to “Watch out when you move /var in Ubuntu”
I had the same problem. Thank’s for great advice!
By Bobo on Jul 22, 2007
Thanks. I was just about to put /var on another partition. But I thought it would be a good idea to google Ubuntu and moving /var partition first.
By Chris on Sep 1, 2007
I was ready to go ahead and do what you had originally done, when I stumbled on your website. Thanks for the tip - it will save me a lot of time!
By Wayne on Oct 27, 2007