[CentOS] CentOS 6 x64 - Changing /var folder to raid 1 disk after install

Mon Nov 21 22:19:15 UTC 2011
Kahlil Hodgson <kahlil.hodgson at dealmax.com.au>

On 21/11/11 22:50, Adil BOYUN wrote:
> I have fresh install CentOS 6 x64 running on my server. I have a raid
> 1 drive 3 tb ready to be mounted. I want to mount this as var folder,
> could achive this but after reboot, server didn't start, maybe i had
> problem with command cp -rf.
> Is this possible to do in a proper manner, with what commands?
> I used rsync and diff game me like 10+ output.

If this is a fresh install, I gather selinux is enabled, so the above 
approach is likely to have issues: many files/dirs under /var have 
special selinux contexts.

I'd normaly use something like

rsync -aX /var/ /mnt/new_raid_array/

(the -X option preserves selinux contexts and note the trailing slashes)

Hope this helps.


Kahlil (Kal) Hodgson                       GPG: C9A02289
Head of Technology                         (m) +61 (0) 4 2573 0382
DealMax Pty Ltd                            (w) +61 (0) 3 9008 5281

Suite 1005
401 Docklands Drive
Docklands VIC 3008 Australia

"All parts should go together without forcing.  You must remember that
the parts you are reassembling were disassembled by you.  Therefore,
if you can't get them together again, there must be a reason.  By all
means, do not use a hammer."  -- IBM maintenance manual, 1925