I want to clone LVM logical volume layout to another host ( = Create volumes with same size ). Does anyone know solution for this ? I know I can execute something like:

sudo LC_ALL=C lvs -o lv_name,lv_size,vg_name --units M --noheadings --separator '|' --nosuffix | LC_ALL=C awk -F \| '{ printf("lvcreate -n %s -L %.0fM %s\n",$1,$2,$3) }'

to generate commands to execute on another host.

But is there more 'standard' way to perform such task ?

I was browsing through LVM man pages and I found vgcfgexport and vgexport. First would export all metadata including stuff like PV UUIDs and second one is used just for moving volume groups, however it's not what I'm looking for.


my volume group use standard "PE Size 4.00 MB" in all servers, so the only thing that i need to archive what you want is the number of logical extend of the original volume

lvcreate -n volumename -l <number_of_extend_in_the_original_volume> vg00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.