How can I move my /var directory to my 2nd hard drive?
I have been searching around the past 2 days trying to figure out how to move my /var directory to my 2nd HDD.
I really can not figure this out and all the pages google brings me to are "How to move your /home directory to its own disk partition". Which is not what I am trying to accomplish here. I'm not sure what kind of information you would need to help me out but I will post my disk partitions. OS - Centos 6.3 Code:
[root@localhost ~]# fdisk -l |
If you want to install a Linux system in partitioning step just make a partition there and make a mount point for it like /var.
And if you have a installed Linux system, it's easy as make a partition in the second hard drive you want. then copy your exiting /var files into it and at last modify your /etc/fstab file to automatically mount your new partition as /var directory. I didn't really test it. but it has to be easy like this ;-) |
Following links may be helpful:
(1) http://www.linuxquestions.org/questi...d-disk-745489/ (2) http://how-to.linuxcareer.com/learni...ux-commands-dd (Note: Before taking any actions, don't forget to take backup your important data.) |
It appears the entire drive is being used as a LV for /home.
Since the entire drive is an LVM partition it isn't as simple as just creating another partition or copy using the dd command. If /home uses the entire disk space then you will need to: Resize the filesystem Resize the LV Create a new LV Format the new LV copy data from the old /var to the new /var Edit /etc/fstab to add /var LV. Boot up using the installation disk to the rescue mode. |
Quote:
Will I still be able to do this remotely? Also what exactly is a LV? I think it stands for logical volume, but what exactly is it? |
You can find lots of info on the web about LVM
http://www.howtoforge.com/linux_lvm You should be able to perform LVM operations and copy the files on a live system. Since /var contains lots of open files/variable data that are changed on a running system so it is safest to boot into a rescue mode. In addition since there are open files that can not be simply moved so at the moment I do not know of an easy method to delete the original files to free up space. Others might have a better idea. |
As per michaelk, I think you'd really want to go through rescue mode for the final re-naming.
I guess you'd do all the setup as specified, inc a new entry in fstab (which won't take effect until you reboot), then ask your Provider to do the final steps for you. |
|
All times are GMT -5. The time now is 01:21 AM. |