[CentOS] Disc Cloning Question

Tue Apr 6 20:28:12 UTC 2010
Les Mikesell <lesmikesell at gmail.com>

On 4/6/2010 3:02 PM, Joseph L. Casale wrote:
>> Even if there is a way to do a live migration, it's probably faster and
>> safer to just build a new raid with or without lvm and copy the stuff
>> over.  You'll just have to reinstall grub on the new disks to make them
>> boot.
> It needn't be live, I just haven't seen an app like clonezilla that can
> go big to small with lvm and md devices...
> On that note, the data is all static so it's very safe:
> 1. I wonder if I actually could place the two new discs in
> 2. create two new md devices, md2/3
> 3. pvmove VolGroup00 into it md3, then pvremove md1's pv's, ignore the
>     md1->3 difference here, lvm should find the unchanged vg/lv.
> 4. copy md0's /boot into md2
> 5. edit fstab for the new /boot on md2 instead of md0
> 6. install grub
> 7. have local guy pull out two old drives and send back.
> I don't have a concern about data, it has a long kickstart which actually
> sets everything up, it's just downtime I want to avoid.

If I were doing it, I'd forget lvm on the new drive and just make the md 
devices, mkfs them, mount them somewhere temporarily, copy stuff over 
with 'cp -a', 'tar | tar', 'dump | restor', 'rsync -av', etc.,
edit fstab to mount the new md devices for / and /boot, fix grub and 
swap the drives.  If you have to worry about growing files, do an rsync 
once live, then go to single user mode and repeat (the second run will 
fix anything that changed and will go pretty quickly).

   Les Mikesell
    lesmikesell at gmail.com