LVM (single HDD) to SW RAID 1 w/o LVM

Issues related to applications and software problems
Post Reply
mclien
Posts: 43
Joined: 2012/01/23 15:15:41

LVM (single HDD) to SW RAID 1 w/o LVM

Post by mclien » 2012/02/15 14:33:45

After running in unsolvable issues with mondorescue (still have NO way to recover), I will try another path to solve this problem.

I'm currendly running the server in question with asingle HDD and LVM (set up in defaukt installtion mode by a colleague). I'm planning to get that system converted in a software raid without LVM.
Is there any howto to get this working? I found this:
http://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-lvm-system-incl-grub-configuration-centos-5.3
But I'm not sure how to use that for my scenario (OK I can follow that by setting up the second disc as discribed and wihtout configuring it to LVM, but how do I transfer the data from the LVM to the non-lvm partitions?). Setting up the boot parameters should fit, but trasnfering the data with pvmove obviously won't do the trick.

Thanks
mcline

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

LVM (single HDD) to SW RAID 1 w/o LVM

Post by pschaff » 2012/02/15 20:43:13

I'd suggest you get the RAID all set up and partitioned as you want it first, then [url=http://wiki.centos.org/HowTos/MigrationGuide#line-46]clone[/url] the system to the new partitions, modify the target /etc/fstab and /boot/grub/grub.conf accordingly, remove the original disk, [url=http://wiki.centos.org/TipsAndTricks/ReinstallGRUB]set up GRUB[/url] on the target, possibly [url=http://wiki.centos.org/TipsAndTricks/CreateNewInitrd]make a new initrd[/url], and then (cross your fingers, make a wish :-) ) boot to the new system.

mclien
Posts: 43
Joined: 2012/01/23 15:15:41

Re: LVM (single HDD) to SW RAID 1 w/o LVM

Post by mclien » 2012/02/16 08:10:23

Thanks for all the hints. To make this even more "exciting". I have only 2 HDDs altogether, so I have to setup the RAID with a missing HDD (like done in the link from my first post). And then when/if I have that running, I have to re-use the first HDD I have now running in LVM to be the second HDD from the RAID.
and hopefully my devicenames don't get messed up on the way....
BTW: is there a trick to have the second HDD bound to /dev/sdb in EVERY case (even when no other HDD is physically installed in the system)

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: LVM (single HDD) to SW RAID 1 w/o LVM

Post by pschaff » 2012/02/17 10:49:34

You might be able to do it with udev rules, but why? Disk LABELs and/or UUIDs should take care of unique drive identification, and GRUB will not see that, and may result in confusion. Better IMHO to just deal with the ordering explicitly if needed than to try to "fix" it, and possibly break things in the process.

Post Reply