[linux-lvm] Query regarding conversion of root partition to LV

Georges Giralt georges.giralt at free.fr
Wed Feb 4 14:23:31 UTC 2009


Prateek Donni a écrit :
> I have a fedora 9 installation with two partitions swap and /
> partition. Now i want to mirror the files on the root partition to
> another disk using LVM mirroring. Since i dint make root on a LV and
> have no allocated space left so i am thinking of using the free space
> on the root partition as a block device that can be converted into PV
> and then mirrored after making it a LV.
> Is this feasible?
> Can someone let me know wht can be done?
> 
> Thanks
> Prateek
>
Hi Prateek !
IMHO this won't work.
As you spoke about mirroring, you can do this :
1) add another disk to the system (ideally same size of the original one)
2) partition it as :
	part #1 used as /boot (about a 100 MB, Ext2/3 FS )
	part #2 the remaining of the disk tagged as LVM.
3) boot your system under Fedora 9 and using LVM mamger create a PV ont 
the second partition, then a VG on the PV and then as much LV as you 
need. Do not forget to create the swap LV.
4) Format and temporary mount each LV ont the filesystem, recreating the 
correct layout but under, say, /mnt.
5) copy the data using a command like : cd / && tar cf - . |(cd /mnt && 
tar xf -)
6) under the /mnt layout correct the Grub menu file, then using this as 
the root with chroot, re-run grub-install.
7) boot under the new disk and test your system.
If fine,
8) create the same partition layout on the old disk as the new one and 
create 2 software raid 1 (mirror) using mdadm, one for the first 
partition used as /boot , the other one for the PV.
9) synchronize the md.
Enjoy.
Be carefull and read the man pages before proceding. A complete backup 
may prove usefull, also.
Hope this helps.

-- 
If the only tool you have is a hammer, you tend to see every problem as 
a nail.
                 Abraham Maslow
A British variant :
Any tool can serve as a hammer but a screwdriver makes the best chisel.




More information about the linux-lvm mailing list