View previous topic :: View next topic |
Author |
Message |
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Fri Jul 05, 2013 5:34 pm Post subject: lvm without tools to clone/duplicate a volume easily? |
|
|
hi,
I was expecting lvm to have built in tool to make an exact copy of a volume, yet it doesn't.
Am I missing something here? Given the dynamic nature of LVM how can something as simple as volume copy be missing?
There's no such an option as lvcopy. This is what I would like of such an option:
lvcopy 'original volume' 'vg name' (this creates an automated copy with a different name)
This LVM option could have more options such as specifying name of new copy and possibly others.
lvcopy 'original volume' -n 'name of copy' 'vg target'
Current solutions have crazy steps involving manually creating another volume, mounting, unmounting, gzipping, unziping, deleting something else, etc.
My solution is more elegant.
thanks
Last edited by _______0 on Fri Jul 05, 2013 5:56 pm; edited 1 time in total |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10587 Location: Somewhere over Atlanta, Georgia
|
Posted: Fri Jul 05, 2013 5:39 pm Post subject: |
|
|
Because it's part of the standard *nix toolset. Use dd. Unless I misunderstand you. Do you want to clone something else other than the contents of the volume?
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Fri Jul 05, 2013 6:14 pm Post subject: |
|
|
John R. Graham wrote: | Because it's part of the standard *nix toolset. Use dd. Unless I misunderstand you. Do you want to clone something else other than the contents of the volume?
- John |
dd cant't magically create an LVM volume. This option defeats the purpose of an automated approach. To dd first I need to find out the EXACT size of the original volume, an insane task. Then create a lvm partition of EXACT sime size to. I said insane because each tool involving block device have their own metric convention.
Do you get my idea? Avoiding having to calculate size of new partition. There's such a tool that creates a partition on the fly partclone.ntfs, but it's only for ntfs and not in portage.
Hard disks /dev/sdX are to static, I would love to be able to copy a partition to a blank drive which automatically re-creates the tables.
Given blank /dev/sdb copy /dev/sda1 to it:
dd_superpowers if=/dev/sda1 of=/dev/sdb1
would be could even with cat!!
cat /dev/sda1 > /dev/sdb1
I think only a superhero would be able to pull this off. |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10587 Location: Somewhere over Atlanta, Georgia
|
Posted: Fri Jul 05, 2013 7:04 pm Post subject: |
|
|
Okay, yes, I do get your idea. I would call that cloning the volume structure, though. Of course, as you've found out, that capability doesn't exist with any volume or filesystem type as a standard feature. It's just that lvm is especially complex. Not more complex than a ZFS zpool, mind you, but still.
Let me think about it.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Fri Jul 05, 2013 9:40 pm Post subject: |
|
|
John R. Graham wrote: | Okay, yes, I do get your idea. I would call that cloning the volume structure, though. Of course, as you've found out, that capability doesn't exist with any volume or filesystem type as a standard feature. It's just that lvm is especially complex. Not more complex than a ZFS zpool, mind you, but still.
Let me think about it.
- John |
Do you know if zfs or btrfs solve this dilemma? Well it has to be something that can be treated as raw device, meant for VM's. If it doesn't exist such a solution it's ok, but it's weird that LVM couldn't have this option. Seems relatively simple and effortless to implement, almost free.
Playing with partitions made me realize how inflexible are filesystems in general. For instance m$$ craps out if you move it ONE bit to the left or to the right while staying same partition number. And to be fair LVM2 snapshot looks like a non solution, no different than manual work. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|