Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lvm without tools to clone/duplicate a volume easily?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Fri Jul 05, 2013 5:34 pm    Post subject: lvm without tools to clone/duplicate a volume easily? Reply with quote

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
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7849
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Jul 05, 2013 5:39 pm    Post subject: Reply with quote

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
_________________
This space intentionally left blank.
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Fri Jul 05, 2013 6:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7849
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Jul 05, 2013 7:04 pm    Post subject: Reply with quote

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
_________________
This space intentionally left blank.
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Fri Jul 05, 2013 9:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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