Hi I m using xen 3.0.3 that come with the RHEL4 distribution i have made a virtuel machine with a disk in a file. the virtual disk is partition this way Disque /dev/hda: 37.5 Go, 37580963840 octets 255 têtes, 63 secteurs/piste, 4568 cylindres Unités = cylindres de 16065 * 512 = 8225280 octets Périphérique Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 4568 36588037+ 8e Linux LVM Is there a simple way to expand the image in order to expand the lvm? _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, 2008-09-02 at 15:50 +0200, Eric Doutreleau wrote:> Hihi,> Is there a simple way to expand the image in order to expand the lvm?kinda: add another image file as /dev/hdb to your domU, create a physical volume on the new disc and extend your volume group with vgextend. hth, tom. -- Thomas "Duke" Hager duke@sigsegv.at GPG: 1024D/D27F858C http://www.sigsegv.at/gpg/duke.gpg ================================================================"Never Underestimate the Power of Stupid People in Large Groups." _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I''m not especially familiar with dd, but couldn''t it be used for this? It seems I recall something about skipping blocks before writing, so if you skip enough blocks to go to the end of the file and then write enough blocks to extend it as much as you want, wouldn''t this make the single disk that much bigger the next time it is mounted to a domU? Obviously it would be wise to back-up the image first, and this would probably be an offline operation, but it seems to me it might be better (or at least easier to manage) than having two physical volumes (unless you want to use two real disks or something). Dustin -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Thomas Hager Sent: Tuesday, September 02, 2008 10:38 To: xen-users@lists.xensource.com Subject: Re: [Xen-users] how to expand a xen image? On Tue, 2008-09-02 at 15:50 +0200, Eric Doutreleau wrote:> Hihi,> Is there a simple way to expand the image in order to expand the lvm?kinda: add another image file as /dev/hdb to your domU, create a physical volume on the new disc and extend your volume group with vgextend. hth, tom. -- Thomas "Duke" Hager duke@sigsegv.at GPG: 1024D/D27F858C http://www.sigsegv.at/gpg/duke.gpg ================================================================"Never Underestimate the Power of Stupid People in Large Groups." _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thomas Hager a écrit :> On Tue, 2008-09-02 at 15:50 +0200, Eric Doutreleau wrote: > >> Hi >> > hi, > > >> Is there a simple way to expand the image in order to expand the lvm? >> > kinda: > > add another image file as /dev/hdb to your domU, create a physical > volume on the new disc and extend your volume group with vgextend. > > hth, > tom. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-usersit works thanks for your answer _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Eric Doutreleau
2008-Sep-02 15:22 UTC
Re: {Spam} RE: [Xen-users] how to expand a xen image?
Dustin Henning a écrit :> I''m not especially familiar with dd, but couldn''t it be used for > this? It seems I recall something about skipping blocks before writing, so > if you skip enough blocks to go to the end of the file and then write enough > blocks to extend it as much as you want, wouldn''t this make the single disk > that much bigger the next time it is mounted to a domU? Obviously it would > be wise to back-up the image first, and this would probably be an offline > operation, but it seems to me it might be better (or at least easier to > manage) than having two physical volumes (unless you want to use two real > disks or something). > Dustin > > -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Thomas Hager > Sent: Tuesday, September 02, 2008 10:38 > To: xen-users@lists.xensource.com > Subject: Re: [Xen-users] how to expand a xen image? > > On Tue, 2008-09-02 at 15:50 +0200, Eric Doutreleau wrote: > >> Hi >> > hi, > > >> Is there a simple way to expand the image in order to expand the lvm? >> > kinda: > > add another image file as /dev/hdb to your domU, create a physical volume on > the new disc and extend your volume group with vgextend. > > hth, > tom. > >well at the end i have done that and it seems to work thanks for your answer _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Am Dienstag, den 02.09.2008, 11:12 -0400 schrieb Dustin Henning:> I''m not especially familiar with dd, but couldn''t it be used for > this? It seems I recall something about skipping blocks before writing, so > if you skip enough blocks to go to the end of the file and then write enough > blocks to extend it as much as you want, wouldn''t this make the single disk > that much bigger the next time it is mounted to a domU? Obviously it would > be wise to back-up the image first, and this would probably be an offline > operation, but it seems to me it might be better (or at least easier to > manage) than having two physical volumes (unless you want to use two real > disks or something). > DustinIf you like it within one file: dd if=/dev/zero bs=1G count=5 >> imagefile adds five gigs to your imagefile. cheers Henry> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Thomas Hager > Sent: Tuesday, September 02, 2008 10:38 > To: xen-users@lists.xensource.com > Subject: Re: [Xen-users] how to expand a xen image? > > On Tue, 2008-09-02 at 15:50 +0200, Eric Doutreleau wrote: > > Hi > hi, > > > Is there a simple way to expand the image in order to expand the lvm? > kinda: > > add another image file as /dev/hdb to your domU, create a physical volume on > the new disc and extend your volume group with vgextend. > > hth, > tom. >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, Sep 3, 2008 at 7:57 AM, henry ritzlmayr <xen-list@rc0.at> wrote:> Am Dienstag, den 02.09.2008, 11:12 -0400 schrieb Dustin Henning: >> I''m not especially familiar with dd, but couldn''t it be used for >> this? It seems I recall something about skipping blocks before writing, so >> if you skip enough blocks to go to the end of the file and then write enough >> blocks to extend it as much as you want, wouldn''t this make the single disk >> that much bigger the next time it is mounted to a domU? Obviously it would >> be wise to back-up the image first, and this would probably be an offline >> operation, but it seems to me it might be better (or at least easier to >> manage) than having two physical volumes (unless you want to use two real >> disks or something). >> Dustin > > If you like it within one file: > > dd if=/dev/zero bs=1G count=5 >> imagefile > > adds five gigs to your imagefile. >Hello, I did it a couple of time the following way: shut down the VM, dd if=/dev/zero of=/VM/myxen_back_grow.img bs=1M conv=notrunc count=5000 seek=10240 count is the size that you wanna add(here 5GB more) losetup /dev/loop4 /VM/myxen_back.img kpartx -av /dev/loop4 (do I really need this in the first run? you could use it to mount the partition and backup data or something) fdisk /dev/loop4 now delete the old partition and create a new one, fill it up the whole space. save than remove the kpartx with "kpartx -d /dev/loop4", also delete the loopback "losetup -d /dev/loop4" and remap the loopback and kpartx like in the beginning. now you can/should do a "e2fsck -f /dev/mapper/loop4p1" after that do a "resize2fs /dev/mapper/loop4p1" and check the partition again. now delete the kpartx and loopback and boot into the VM, it should now be bigger. greetings> cheers > Henry > > >> -----Original Message----- >> From: xen-users-bounces@lists.xensource.com >> [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Thomas Hager >> Sent: Tuesday, September 02, 2008 10:38 >> To: xen-users@lists.xensource.com >> Subject: Re: [Xen-users] how to expand a xen image? >> >> On Tue, 2008-09-02 at 15:50 +0200, Eric Doutreleau wrote: >> > Hi >> hi, >> >> > Is there a simple way to expand the image in order to expand the lvm? >> kinda: >> >> add another image file as /dev/hdb to your domU, create a physical volume on >> the new disc and extend your volume group with vgextend. >> >> hth, >> tom. >> > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Am Mittwoch, den 03.09.2008, 08:41 +0200 schrieb Heiko:> On Wed, Sep 3, 2008 at 7:57 AM, henry ritzlmayr <xen-list@rc0.at> wrote: > > Am Dienstag, den 02.09.2008, 11:12 -0400 schrieb Dustin Henning: > >> I''m not especially familiar with dd, but couldn''t it be used for > >> this? It seems I recall something about skipping blocks before writing, so > >> if you skip enough blocks to go to the end of the file and then write enough > >> blocks to extend it as much as you want, wouldn''t this make the single disk > >> that much bigger the next time it is mounted to a domU? Obviously it would > >> be wise to back-up the image first, and this would probably be an offline > >> operation, but it seems to me it might be better (or at least easier to > >> manage) than having two physical volumes (unless you want to use two real > >> disks or something). > >> Dustin > > > > If you like it within one file: > > > > dd if=/dev/zero bs=1G count=5 >> imagefile > > > > adds five gigs to your imagefile. > > > Hello, > > I did it a couple of time the following way: > > shut down the VM, > > dd if=/dev/zero of=/VM/myxen_back_grow.img bs=1M conv=notrunc > count=5000 seek=10240 > count is the size that you wanna add(here 5GB more)If you do it that way, be careful on the seek parameter. It has to be at least bigger than the original file and for performance reasons (sparse file) it should exactly match the file size. That´t why I prefer it the way I posted it above which does the same thing but avoiding both problems. Henry _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
2008/9/3 henry ritzlmayr <xen-list@rc0.at>:>>> dd if=/dev/zero bs=1G count=5 >> imagefile > > That´t why I prefer it the way I posted it above which does the same > thing but avoiding both problems.Just make sure you don''t have finger trouble and type the ">>" as ">" ;-) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, Sep 3, 2008 at 9:38 AM, henry ritzlmayr <xen-list@rc0.at> wrote:> Am Mittwoch, den 03.09.2008, 08:41 +0200 schrieb Heiko: >> On Wed, Sep 3, 2008 at 7:57 AM, henry ritzlmayr <xen-list@rc0.at> wrote: >> > Am Dienstag, den 02.09.2008, 11:12 -0400 schrieb Dustin Henning: >> >> I'm not especially familiar with dd, but couldn't it be used for >> >> this? It seems I recall something about skipping blocks before writing, so >> >> if you skip enough blocks to go to the end of the file and then write enough >> >> blocks to extend it as much as you want, wouldn't this make the single disk >> >> that much bigger the next time it is mounted to a domU? Obviously it would >> >> be wise to back-up the image first, and this would probably be an offline >> >> operation, but it seems to me it might be better (or at least easier to >> >> manage) than having two physical volumes (unless you want to use two real >> >> disks or something). >> >> Dustin >> > >> > If you like it within one file: >> > >> > dd if=/dev/zero bs=1G count=5 >> imagefile >> > >> > adds five gigs to your imagefile. >> > >> Hello, >> >> I did it a couple of time the following way: >> >> shut down the VM, >> >> dd if=/dev/zero of=/VM/myxen_back_grow.img bs=1M conv=notrunc >> count=5000 seek=10240 >> count is the size that you wanna add(here 5GB more) > > If you do it that way, be careful on the seek parameter. It has to be at > least bigger than the original file and for performance reasons (sparse > file) it should exactly match the file size. > > That´t why I prefer it the way I posted it above which does the same > thing but avoiding both problems. >sounds and looks much better, thx for that advice, i did put it into my documentation. cheers Rupert> Henry > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users