Virtual box - How to add disks and move var, opt and home to them?
- by Jarrod Roberson
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?