LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Software Raid with LVM and Live System Partitions (https://www.linuxquestions.org/questions/linux-software-2/software-raid-with-lvm-and-live-system-partitions-679239/)

centos82 10-26-2008 10:24 PM

Software Raid with LVM and Live System Partitions
 
Hi,

I am trying to setup a software raid on a system that is already up and running using LVM for filesystem management. I know how to create the raid device /dev/md1 using /dev/sda2 and /dev/sdb2 (Which holds the LVM LVs for root, var, usr, etc) but I'm not sure how to get LVM to recognize that the physical volume on VolGroup00 should be /dev/md1 instead of /dev/sda2 now. Any suggestions?

Thanks.

centos82 10-26-2008 10:56 PM

Wow, I guess I spoke too soon. It looks like mdadm took care of this for me. For those who are interested I took my blank hard drive /dev/sdb, ran fdisk on it and created identical partitions sizes as I had on /dev/sda. I changed the partition type on /dev/sdb2 to 'fd' aka 'Linux raid autodetect'. Then I created the array using `mdadm --create /dev/md1 --level=1 --raid-devices=2 missing /dev/sdb2` Then I ran `mdadm /dev/md1 -a /dev/sda2`. Adding /dev/sda2 to my raid (which /dev/sda2 was originally an LVM PV partition for VolGroup00) took care of changing my LVM PV to /dev/md1 automatically.

I'm still using /dev/sda1 for my boot partition. I haven't decided/figured out what I am going to do with that yet. Any suggesstions here would be helpful.

Thanks.

mostlyharmless 10-27-2008 04:20 PM

Quote:

I'm still using /dev/sda1 for my boot partition. I haven't decided/figured out what I am going to do with that yet. Any suggesstions here would be helpful.
What's wrong with setting up RAID 1 for /dev/sda1 and /dev/sdb1 and booting off of that?

centos82 11-05-2008 11:55 PM

OK, so I have my raid going for LVM. To make my boot redudant I just made a mirror copy of /dev/sda1 onto /dev/sda2. I did this manually using dd. I tried removing /dev/sda and /dev/sdb individually and everything worked. Awesome. But I got greedy and thought I could create and array device for /dev/sd[ab]1. So I zeroed out /dev/sdb1, used fdisk to make /dev/sdb1 of parition type "fd". I created the raid device /dev/md0 with one missing device and /dev/sdb1. Then I mirrored /dev/sda1 to /dev/md0. Then I unmounted /dev/sda1 and added /dev/sda1 to /dev/md0 and let linux sync the partition. I am having boot problems now though. I get into grub and the OS begins to boot. It finds my root volume group and all associated logical volumes, but (and the screen moves very fast) sometime after setting up udev, all of the sudden commands start flying on the sreen saying file not found. Commands used to setup the network and other things. Finally, if I let it sit it drops me to a text login prompt where any username I enter it says invalid login, and INIT keeps complaining that X is respawning to quickly.

I booted into the live CD and found /dev/rootvg/rootlv was corrupt, so I fixed that. Later, I mounted this filesystem and found the /etc/fstab was missing. Not sure how that happened? Luckily I had a backup copy. So I added /etc/fstab back, but I'm still getting the file not found errors, etc.

Any ideas at all? I am completely stumped.

Thanks.

mostlyharmless 11-13-2008 10:59 AM

While it's possible to boot LVM off Raid in the manner you describe, it sounds like you may have done something else to your system that makes it a more complicated problem than that right now. Unfortunately I'm not a CentOS expert and the boot/LVM/RAID sequence varys quite a lot per distro.

I presume you've googled it and found this:

http://www.linuxquestions.org/questi...draid1-680543/

and this

http://www.flmnh.ufl.edu/linux/linux_software_raid.htm

Good luck!


All times are GMT -5. The time now is 12:40 PM.