Move mount point to new RAID set

1

I have a CentOS 5 production server with multiple OS-managed RAID-1 sets. I'd like to add a new mirrored set and move the /var partition to the new drives. What is the best way to do this?

On a non-RAID system I would boot from the install CD to edit fstab and copy the existing files to the new drive, but I'm pretty sure booting off the install CD does not recognize my RAID setup.

user57770

Posted 2010-12-03T02:03:49.160

Reputation: 115

Answers

1

  1. Make sure all programs accessing /var are stopped (hint lsof -T -V | grep /var).

  2. Probably should just switch to init 1

  3. Setup /etc/fstab to mount the new partition as /var

Then

mount /var
mkdir /mnt/old-root; mount / /mnt/old-root -obind,ro
mv /mnt/old-root/var/* /var
umount /mnt/old-root

No need to boot a livecd, however having SystemRescueCD handy is always a good thing, and I'm positive it will load your raid just fine.

edit: I misread the question, same rules apply except for the mount part :

mount /dev/new-md /mnt/new-var
mv /var/* /mnt/new-var
umount /mnt/new-var /var
mount /dev/new-md /var

OneOfOne

Posted 2010-12-03T02:03:49.160

Reputation: 889

1

You can easily achieve your goal with a rescue CD. For example, sysrescd (http://www.sysresccd.org/Main_Page) will boot with full RAID/LVM support.

JooMing

Posted 2010-12-03T02:03:49.160

Reputation: 774