walt writes: > I know there are a few lvm2 experts lurking here :) > > I have a 500gig disk that is split roughly in half between two volume > groups, each containing four physical volumes, and each vg is formatted > into an ext4 filesystem of roughly 250GB. > > What I plan to do is merge the two volume groups into one, containing > one big ext4 filesystem, which will contain all of the files currently > on the disk. > > Can this be done without copying one of the existing ext4 filesystems > to a separate drive first, and then copying it back after extending > the remaining vg/filesystem? (One filesystem has 24GB free and the > other has 25GB free.) > > I'm expecting a "no" but I'd like to be wrong :)
I think you are right. But if you had more free space, it might be possible. So your physical volumes are about 63 G each. If you free that much space on one filesystem, reduce the file system, then reduce the LV, you can use pvmove to move stuff from one PV you want to empty to the others. When done, you can remove the now empty PV from the VG with vgreduce. Then use vgextend to add the PV to the other VG. Extend the LV of that VG and enlarge the file system, copy stuff from the other FS over until you can free another PV. And so on. But copying all stuff of one VG to another location would be much easier. And less error-prone. Wonko