Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 1 down vote accepted
  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
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.