[linux-lvm] Mirroring my install. Lots of problems !

Georges Giralt georges.giralt at free.fr
Mon Jan 15 09:42:26 UTC 2007

Hi !
Disclaimer : I've tried this only on a Fedora Core 6 install with the latest
(fedora) kernel 2.6.18-xxx so take my post accordingly.
Here is what I plan to do and have trouble with :
I set up my Fedora system on a 160G IDE disk using LVM this way
hda1 is a 100 Mb plain EXT3 for /boot.
hda2 is a 55 GB LVM PV. (for my vg0 holding 4 LV for /, swap, /usr and /var)
hda3 is another pv for vg-ext (holding 2 lv, /home and /extra for extra stuff)
So far, fine.
I added another 160Gb IDE disk (quite identical, the original one is a
"Maxtor-Seagate" and the new one is a "plain" Seagate with same specs)
So I planned to switch to mirroring to survive a disk failure.
As I'm a unix system engineer working for more than 20 years on HP, Sun, IBM and
Bull AIX boxes, and practising Linux since Kernel 0.8 I was confident to
succeed. I was wrong.
Here is what I planned to do :
1) partition the second disk exactly as the first one.
2) pvcreate hdb2 and hdb3
3) vgextend /lvconvert vg0 and vg-ext to have one mirror copy
4) Enjoy, have a beer.
The conversion was a failure, because the tools asked for a THIRD disk in order
to mirror the VG. Funny. I thought GNU/Linux was clever, I was wrong. How come
HP-UX or Aix can do LVM mirror on 2 disks and not Linux ? (the corelog option
is also an issue, as reconstruction will take place at every reboot which occur
often as this is a home box, not a server)
So I decided to try a more complex approach : Create a mirror using the mdtools
(mdadm) and turn this into a VG. My plan was as follow :
1) create a critical mirror using mdadm with only one copy active on hdb2 repeat
with hdb3.
2) pvcreate md0 and md1
3) add md0 to vg0 and md1 to vg-ext
4) pvmove all vg0 lv to md0 and all vg-ext lv to md1.
5) vgreduce vg0 to remove hda2 and vg-ext to remove hda3
6) add hda2 to md0 and hda3 to md1 and force re-sync
7) have a beer, and enjoy.
Again, a disaster. I CAN'T add an md to a vg and have the vg work. I've tried to
do it using plain md0 to pvcreate, partitionning md0 to create md0p1 and
pvcreate this (it's impossible, as there is no /dev/md0p1 device...)
I've even tried to use system-config-lvm which is the Fedora graphical tool in
order to overcome my lack of knowledge, but this tools does not see the md as
unused devices, so I'm not the only one left without knowledge...
So, thanks for having read up to this point! My question is :
How do you folks do to have LVM and Mirror working at the same time on a Fedora
Core box ? And using ONLY two disks ? (I thing 160 GB is quite large for the
job, isn't it ? )
Thanks for your help and patience ;-)

More information about the linux-lvm mailing list