Hello, I've got a single-drive CentOS5 system with two partitions on it, a 101 mb boot, and the rest of the disk as an lvm volume, two partitions in it, / and swap. I've got another disk, same size, and i'd like to add it in as a primary slave drive and convert this system to raid1 for redundancy. I do not want to reinstall this box, which is what the docs i've read say it's easiest to do. Some elude to a procedure, hard yes, time consuming with copying probably, that can do it. Has anyone done this? Thanks. Dave.
On Wed, 2007-05-23 at 12:03 -0400, Dave wrote:> I've got a single-drive CentOS5 system with two partitions on it, a 101 > mb boot, and the rest of the disk as an lvm volume, two partitions in it, / > and swap. I've got another disk, same size, and i'd like to add it in as a > primary slave drive and convert this system to raid1 for redundancy. I do > not want to reinstall this box, which is what the docs i've read say it's > easiest to do. Some elude to a procedure, hard yes, time consuming with > copying probably, that can do it. Has anyone done this?Yes. Roughly, one of the possible procedures is: - Make backups(!). - Add the new disk, and make two Linux RAID partitions (one for the /boot partition, and one to hold a LVM PV). - Make two RAID-1 sets both with one partition. - Make a filesystem on the smallest RAID set, and copy the files from /boot there. - Make the second RAID set a LVM PV. - Add this LVM PV to the VolumeGroup that holds / and swap. - Use pvmove to set up to move the physical extends from the 'old' disk to the PV on RAID. - Install GRUB on the new disk. - Double-check /etc/fstab and /boot/grub/menu.lst (should be ok, since the volgroup and volume names have not changed). - Remove the PV from the old disk from the VG. - Remount /boot from the new disk. - Create RAID partitions on the old disk to match the RAID setup from the new one. - Add both RAID partitions to the set, and let it reconstruct the set. - Reinstall GRUB to the old disk. Make sure that the partitions on the new disk are not larger than the partitions on the old disk. And don't do it, unless you know what you are doing. If something fails, you'll have to be able to deal with it. -- Daniel
Dave wrote:> Hello, > I've got a single-drive CentOS5 system with two partitions on it, a > 101 mb boot, and the rest of the disk as an lvm volume, two partitions > in it, / and swap. I've got another disk, same size, and i'd like to add > it in as a primary slave drive and convert this system to raid1 for > redundancy. I do not want to reinstall this box, which is what the docs > i've read say it's easiest to do. Some elude to a procedure, hard yes, > time consuming with copying probably, that can do it. Has anyone done this? > Thanks. > Dave.I've seen those procedures and it seemed crazy enough that I didn't bother saving the link... I'd probably tackle it by adding the 2nd drive and making similar-sized raid1 partitions on it with a member specified as 'missing', then make filesystems, LVM, etc., copy your existing data over, install grub, adjust it's copy of /etc/fstab, and boot the new disk. Once you are sure the new setup is good, use mdadm to add the partitions of the original drive into the raid1. The advantage of this approach is that unless you do something like copy the wrong direction you can always go back to the old version until the new one has been proven to work. -- Les Mikesell lesmikesell at gmail.com