Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Clone an LVM formatted disk to a smaller disk (VM)

  • 12-12-2011 09:50AM
    #1
    Registered Users, Registered Users 2 Posts: 10,291 ✭✭✭✭


    Anyone have any experience with this? Looknig to clone a 20Gb LVM partition to a 12Gb one in CentOS 5.7. It's a virtual machine too on vSphere 5

    Clonezilla/gparted etc don't see the contents of the disk, same with vmware converter.

    Any ideas?
    Will try a lvm mirror and then break the mirror but was hoping there might be an easier way.

    Cheers!


Comments

  • Registered Users, Registered Users 2 Posts: 10,291 ✭✭✭✭Standard Toaster


    Had some luck with vgextend/pvmove, will report back with results later tomorrow.


  • Registered Users, Registered Users 2 Posts: 10,291 ✭✭✭✭Standard Toaster


    What I ended up doing was using dd to copy /boot to second smaller harddrive and then introducing the rest of the harddrive's space to the LVM volume (smaller partition)
    Used vgextend/pvmove/vgreduce/pvremove to move the data and remove original harddrive from the volume group.
    Finally reinstalled grub and all seems fine now.

    I'll fire up the steps at some point as I can see myself doing this again.


Advertisement