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 > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 04-30-2008, 08:43 PM
Kai Schaetzl
 
Default determining correct size for LV copy operations

I have some problems with copying LV volumes and determining correct size.
For instance, if I want to copy an LV from one machine to another. I dd
the LV to a file on the other machine, then dd the file to the new LV.
That fails, because a few MB are missing.

source:
LV Name /dev/VolGroup01/LogVol01
LV Size 4.62 GB

target:
LV Name /dev/xenvm/lvmtest1
LV Size 4.62 GB

Both were created with lvcreate -L 4.62GB, but there's obviously a small
rounding or whatever difference. The size of the physical extents seems to
be different.

I can determine the size of the output file
-rw-r--r-- 1 root root 4966055936 Apr 30 21:19 lvmtest1.img

That is 4849664K which is the smallest size unit that lvcreate accepts.
lvcreate -L 4849664K --name lvmtest1 xenvm - and then it fits.
But I hope there's a better way to determine the *exact* size?

Kai

--
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-30-2008, 08:56 PM
John R Pierce
 
Default determining correct size for LV copy operations

Kai Schaetzl wrote:

I have some problems with copying LV volumes and determining correct size.
For instance, if I want to copy an LV from one machine to another. I dd
the LV to a file on the other machine, then dd the file to the new LV.

That fails, because a few MB are missing.




I'd probably use dump ... | restore ... to copy it, assuming its an
e2fs/e3fs on that logical volume. then the volume sizes are immaterial.





_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 05-01-2008, 11:31 AM
Kai Schaetzl
 
Default determining correct size for LV copy operations

John R Pierce wrote on Wed, 30 Apr 2008 13:56:32 -0700:

> I'd probably use dump ... | restore ... to copy it, assuming its an
> e2fs/e3fs on that logical volume. then the volume sizes are immaterial.

Well, these are mostly xen volumes with xvda. It's indeed the difference in
physical extent. I can check the size of the PE with vgdisplay. Most vg's
have 4MB, but the ones on small disks have 32MB (which is a bit surprising,
I would expect the opposite). Then I can check with lvdisplay the actual
number of extents and multiply that with the PE size. Gives me a difference
of 4 MB. So, I better set the PE size on small disks in the future. And for
existing volumes I can use -l instead of -L which sets the size in physical
extents and not in bytes.

Kai

--
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 07:15 PM.

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