FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Server Development

 
 
LinkBack Thread Tools
 
Old 10-05-2010, 11:55 AM
Tapas Mishra
 
Default Can I move an LVM as I can move an ISO

Can an LVM be copied or transferred to some remote server in a similar
fashion as
I can do with ISO.(Not asking rsync)

I copy the ISO one one place to some other location and on the second location
I can mount this ISO and do what ever I want.
Is similar thing possible with an LVM.

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 
Old 10-05-2010, 02:01 PM
"Serge E. Hallyn"
 
Default Can I move an LVM as I can move an ISO

Quoting Tapas Mishra (mightydreams@gmail.com):
> Can an LVM be copied or transferred to some remote server in a similar
> fashion as
> I can do with ISO.(Not asking rsync)
>
> I copy the ISO one one place to some other location and on the second location
> I can mount this ISO and do what ever I want.
> Is similar thing possible with an LVM.

There might be a nifty way of copying it as though it were a file, but
I think I would do something like

dd if=/dev/mapper/myvolume of=- | ssh $remotehost dd of=newfile

As for actually writinng it out to an LVM parition on the remote host,
I don't know how. I should think you can use fdisk on the remote host
to create the right sized partition, and then use the device name for
that partition as 'newfile'

-serge

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 
Old 10-05-2010, 04:01 PM
Tapas Mishra
 
Default Can I move an LVM as I can move an ISO

On Tue, Oct 5, 2010 at 7:31 PM, Serge E. Hallyn
<serge.hallyn@canonical.com> wrote:
>
> There might be a nifty way of copying it as though it were a file, but
> I think I would do something like
>
> * * * *dd if=/dev/mapper/myvolume of=- | ssh $remotehost dd of=newfile
This is a nice trick I had not thought of this.I will try it.

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 
Old 10-05-2010, 05:41 PM
Peter Matulis
 
Default Can I move an LVM as I can move an ISO

On 10/05/2010 12:01 PM, Tapas Mishra wrote:
> On Tue, Oct 5, 2010 at 7:31 PM, Serge E. Hallyn
> <serge.hallyn@canonical.com> wrote:
>>
>> There might be a nifty way of copying it as though it were a file, but
>> I think I would do something like
>>
>> dd if=/dev/mapper/myvolume of=- | ssh $remotehost dd of=newfile
> This is a nice trick I had not thought of this.I will try it.
>

You can transfer the volume over the network and end up with another
volume if you create one on $remotehost beforehand of the same size.
Then have netcat listen on some port, say 9000, and pipe it to that new
volume:

$ nc -l 9000 | sudo dd of=/dev/vg/backup

Then on the source:

$ sudo dd if=/dev/mapper/myvolume | nc $remotehost 9000

--
Peter Matulis

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 
Old 10-05-2010, 06:16 PM
Tapas Mishra
 
Default Can I move an LVM as I can move an ISO

On Tue, Oct 5, 2010 at 11:11 PM, Peter Matulis
<peter.matulis@canonical.com> wrote:
>
> You can transfer the volume over the network and end up with another
> volume if you create one on $remotehost beforehand of the same size.
> Then have netcat listen on some port, say 9000, and pipe it to that new
> volume:
>
> $ nc -l 9000 | sudo dd of=/dev/vg/backup
>
> Then on the source:
>
> $ sudo dd if=/dev/mapper/myvolume | nc $remotehost 9000
>
Ok this is some thing I would be trying in next 24 hours.
I am having a doubt LVM is a block device do I not need to create an
LVM of same size on the remote machine to be able to do so?
The LVM on the original server stores a guest OS running,on KVM on Lucid.
so will I be able to boot from the LVM copied with the above method on
KVM running on destination server.
Given that I create xml for guest in similar fashion.

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 
Old 10-05-2010, 11:26 PM
Ahmed Kamal
 
Default Can I move an LVM as I can move an ISO

On 10/05/2010 08:16 PM, Tapas Mishra wrote:
> On Tue, Oct 5, 2010 at 11:11 PM, Peter Matulis
> <peter.matulis@canonical.com> wrote:
>> You can transfer the volume over the network and end up with another
>> volume if you create one on $remotehost beforehand of the same size.
>> Then have netcat listen on some port, say 9000, and pipe it to that new
>> volume:
>>
>> $ nc -l 9000 | sudo dd of=/dev/vg/backup
>>
>> Then on the source:
>>
>> $ sudo dd if=/dev/mapper/myvolume | nc $remotehost 9000
>>
> Ok this is some thing I would be trying in next 24 hours.
> I am having a doubt LVM is a block device do I not need to create an
> LVM of same size on the remote machine to be able to do so?
> The LVM on the original server stores a guest OS running,on KVM on Lucid.
> so will I be able to boot from the LVM copied with the above method on
> KVM running on destination server.
> Given that I create xml for guest in similar fashion.
>
Yes you need to create the target LVM volume on the target server before
copying over network.
use lvdisplay and lvcreate to create the second LVM volume of "exactly"
the same size (in LE logical Extent units), or if in doubt, just create
a larger one

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 
Old 10-06-2010, 03:01 AM
Tapas Mishra
 
Default Can I move an LVM as I can move an ISO

On Wed, Oct 6, 2010 at 4:56 AM, Ahmed Kamal <ahmed.kamal@canonical.com> wrote:

> Yes you need to create the target LVM volume on the target server before
> copying over network.
Here lies the problem.
When on Server A whose LVM backup I am taking when I created LVMs
I created 4 different LVM within same Volume Group but these four have
different OSeS
I did not partitioned them into swap or ext4 type of things.
I just installed the Guest OS from virt-manager and that broke the LVM into two
even if I do an lvscan I see only one LVM but inside it is divided
into two parts.
One holds ext4 and another holds swap partition how can I repeat this
thing on Server B
but this time I have to do manually.

Even if on Server B I create same sort of structure how will I
partition an LVM into two?
I am not asking to created 2 LVM and convert one to ext4 and another to swap.
The same thing exist on A but probably this was taken care by the
Ubuntu Installer
i.e. process of breaking an LVM into two parts and converting one to
> use lvdisplay and lvcreate to create the second LVM volume of "exactly" the
> same size (in LE logical Extent units), or if in doubt, just create a larger
> one
>

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 
Old 10-06-2010, 05:41 AM
Soren Hansen
 
Default Can I move an LVM as I can move an ISO

On 06-10-2010 05:01, Tapas Mishra wrote:
>> Yes you need to create the target LVM volume on the target server before
>> copying over network.
> Here lies the problem.
> When on Server A whose LVM backup I am taking when I created LVMs
> I created 4 different LVM within same Volume Group but these four have
> different OSeS
> I did not partitioned them into swap or ext4 type of things.
> I just installed the Guest OS from virt-manager and that broke the LVM into two
> even if I do an lvscan I see only one LVM but inside it is divided
> into two parts.

That's how it's supposed to work.

> One holds ext4 and another holds swap partition how can I repeat this
> thing on Server B
> but this time I have to do manually.

Just copy the contents of the logical volume. That's all. The logical
volume contains a partition table which your guest OS sees and then it
sees its two partitions.

> Even if on Server B I create same sort of structure how will I
> partition an LVM into two?

You don't. Your guest did.

> I am not asking to created 2 LVM and convert one to ext4 and another to swap.
> The same thing exist on A but probably this was taken care by the
> Ubuntu Installer
> i.e. process of breaking an LVM into two parts and converting one to

Yes. And when you copy the contents of the logical volume to the other
server, this does not disappear.

--
Soren Hansen
Ubuntu Developer http://www.ubuntu.com/
OpenStack Developer http://www.openstack.org/

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 
Old 04-29-2012, 03:00 AM
Andy Smith
 
Default Can I move an LVM as I can move an ISO

Hello,

[Apologies for thread necromancy]

On Tue, Oct 05, 2010 at 09:01:36AM -0500, Serge E. Hallyn wrote:
> Quoting Tapas Mishra (mightydreams@gmail.com):
> > Can an LVM be copied or transferred to some remote server in a similar
> > fashion as
> > I can do with ISO.(Not asking rsync)

[...]

> There might be a nifty way of copying it as though it were a file, but
> I think I would do something like
>
> dd if=/dev/mapper/myvolume of=- | ssh $remotehost dd of=newfile

You can also use something like this:

http://theshed.hezmatt.org/lvmsync/

which has the advantage that you can do the first run from a
snapshot while the guest is running, then the final run from the
real LV with the guest shut down.

Cheers,
Andy

--
http://bitfolk.com/ -- No-nonsense VPS hosting
--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 

Thread Tools




All times are GMT. The time now is 01:18 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org