Results 1 to 2 of 2

Thread: Move var directory to another partition

  1. #1
    Join Date
    Nov 2009
    Beans
    2

    Move var directory to another partition

    Hi all,

    I am trying to move /var directory located in / to another partition in other disk, but when I try to boot the system with the new location for the /var directory, I get a management console because at boot the system fails trying to access to /var/run and /var/lock (they are unavailable).

    I have only one partition with the whole filesystem in the / directory and I would like to separate /var /tmp and /home to another disk/partition.

    how can I get this?

    Thanks in advance
    Last edited by aelorenzo; November 6th, 2009 at 11:03 PM.

  2. #2
    Join Date
    Dec 2005
    Location
    New Zealand
    Beans
    132
    Distro
    Ubuntu Development Release

    Re: Move var directory to another partition

    This is hard to do on a live system. Essentially you need to do the following:

    1. copy the files from /var to your new partition: ie cd /var ; find . -print | cpio -pdmua /newvar

    2. You then need to edit /etc/fstab to have set you newvar to be mounted as /var when your system boots.

    The tricky bit is removing all the old stuff from /var before you can safely reboot. I would suggest you boot of the install CD, then mount the ubuntu parition (may be done automatically. Then

    sudo mv /var /oldvar # (on the correct partition.
    sudo mkdir /var # so there is an empty partiction to mount your newvar onto.

    The after you have edited /etc/fstab you can reboot and all should be well.

    Once you are happy with everything you can delete /oldvar

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •