How to rebuild while preserving an LVM disk

Robin Laing Robin.Laing at drdc-rddc.gc.ca
Mon Aug 27 20:15:24 UTC 2007


Cliff Avey wrote:
> I have an ancient (FC3) Fedora that I want to move to FC8. I figure it 
> might be cleanest to just rebuild it rather that upgrading (if that's 
> even possible, it's so old). I can blow everything away except one 
> thing. Separate from my OS disk, I have to SATA drives built into a 
> raid-0 with md, and then an lvm physical volume group built on that. I 
> need to keep that, and I don't have enough room anywhere else to backup 
> and restore it.
> 
> If I unplug the raid drives, and rebuild my system, how can I hook them 
> back up? Is the configuration info describing the md array, and the lvm 
> groups stored on my os drive, which I'm blowing away. How can I save 
> and/or recreate it once I get the main system back up?
> 
> Also, I don't know if there have been major changes to md or lvm (or xfs 
> for that matter, since the logical volume is formatted as xfs). Will I 
> have any problems using drives set up with a relatively old version of 
> this software.
> 
> Thanks for your advice.
> 

That is what I did going from FC4 to FC7.

My dm raid is my /home partition.

I copied all my /etc files to a memory stick for a reference.

I made sure my LVM partitions had labels as FC7 requires labels.  Use 
something that is unique, not just home to ensure that there is no conflict.

I also wrote down my LVM and RAID settings.

I unplugged the drives to be safe.

I don't have the full details as it was my home computer, but I then 
installed FC7 on the clean HD.  I had the installer create a separate 
/home partition (which will be used for other stuff later).

I then plugged the SATA drives back in and with the CLI, re-configured 
the RAID and made sure that was working.  I then entered the LVM 
configurations into the lvm.conf file and checked to see if all was 
working by mounting the partition.

Changed the /etc/fstab to mount the partition as /home and rebooted.  It 
went much easier than I had expected.

-- 
Robin Laing




More information about the users mailing list