Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 created a CentOS 5.6 Guest OS Virtual Machine. I made the first disk 10GB, I am rapidly outgrowing it.

It was suggested that I make disks for my /var, /opt and /home directories and move them so I can better manage the disks for backing up and what not.

This sounds like a good idea.

I know how to create the disks in Virtual Box. I have dug around Google and the internet in general and all my attempts at doing this have failed. Snapshots are awesome!

I can get the drives fdisked, and I have had limited success mounting them to /mnt/var, /mnt/home and /mnt/opt, but even in single user mode ( init 1 ) I can't get the entire contents of the directories to move over, and then the machine won't reboot correctly.

cd /var
cp * -ax /mnt/var

The /var directory in particular is not wanting to move everything to the new location.

How do I format, mount and move the /var, /opt and /home to my new disks?

share|improve this question

The problem probably is that the filesystem continuosly change by writes from the OS and various daemons.

It's expecially true for /var (less likely for /home or /opt if in single user mode).

The easiest way IMHO is to boot the VM with a Linux Live CD of some kind (you can download an .iso and mount it as CDROM drive, then set it as first device to boot). Then you can mount your old and new disks and make the copies you need.

Don't delete anything.

When done with copying you should modify /mount_point/etc/fstab (the old disk) with the new values for /var, /opt and /home (possibly using UUIDs) and reboot.

Then, only if everything went ok, you should re-boot the Live CD, mount the old disk, and delete the old data to make room.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.