Virtual box - How to add disks and move var, opt and home to them?
Posted
by
Jarrod Roberson
on Server Fault
See other posts from Server Fault
or by Jarrod Roberson
Published on 2011-06-30T15:23:53Z
Indexed on
2011/06/30
16:24 UTC
Read the original article
Hit count: 369
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 fdisk
ed, 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?
© Server Fault or respective owner