Well this is cool. I had to copy my music and movies from the disks in my HTPC to my newly-built NAS, but didn't want my home network bogged down with the rsync file copy. Traditionally this would be pretty easy, as on standard ext4/ntfs/fat filesystems, you can just remove the disk from the originating PC and plug it up in the destination PC and mount it and you're all set. In my case, an extra level of complexity was introduced since I used LVM to create one logical partition across two disks in the HTPC. After a bit of Google Love, I learned that LVM can actually export and import volumes very easily:
- Umount the volume group
- Mark the volume group inactive
- Export the volume group
- Shutdown the machine, remove the disks, and hook them up in the destination system.
- Import the volume group
- Activate the volume group
- Mount the filesystem
$ umount /var/media
$ vgchange -an vgmedia
$ vgexport vgmedia
$ pvscan
$ vgimport vgmedia
$ vgchange -ay vgmedia
Hat tip to www.tldp.org for the how-to. Pretty cool. Constraining factor is that you have enough bays/ports in the destination machine to accommodate all of the disks in the Volume Group. Alternatively, you can attempt to remove one or more disks from the Volume Group if you have enough unallocated space on the other disk(s).