I have created an xp domain and fc6 domain but I picked too small of size for the image. My xp domain is using a physical device (logical volume) and my fc6 domain is using a file for the mapped disk. Isn''t there a way to enlarge the filesystem of the guest by enlarging the backing file/device? If so, what exactly do you do to enlarge the backing file/dev? --- Thanks, Jeff
Ouch, It''s possible but not nice. Obviously the first step is to back up your existing file before you try any of this .... First step is you need to enlarge the file itself. Use dd to to this for example dd if=/dev/zero of=myImage.img seek=***** bs=1M count=1 The seek value should be big enough to seek past the current data so we don''t overwrite anything - so for example make it a 2gb past the end of the file. You now have a larger sparse file. At this point you have a larger disk but your partition table is out of whack. So you need to use a tool like parted/gparted to change the partition table. You can also use fdisk if you''re feeling brave. These tools won''t work directly on a file, so you''ll need to create a block device for that image, you can use kpartx for this, see the link below http://fedoraproject.org/wiki/FedoraXenQuickstartFC6#head-9c5408e750e8184aece3efe822be0ef6dd1871cd When you''ve enlarged the partition to the correct size then you''ll need to resize the ntfs file system - for this you''ll need ntfsresize. http://mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html Good luck, don''t forget the backup ! Aic On Tue, 2006-11-07 at 06:04 -0600, Jeff wrote:> I have created an xp domain and fc6 domain but I picked too small of > size for the image. > > My xp domain is using a physical device (logical volume) and my fc6 > domain is using a file for the mapped disk. > > Isn''t there a way to enlarge the filesystem of the guest by enlarging > the backing file/device? If so, what exactly do you do to enlarge the > backing file/dev? > > --- > Thanks, > Jeff > > -- > Fedora-xen mailing list > Fedora-xen@redhat.com > https://www.redhat.com/mailman/listinfo/fedora-xen
If you''re using LVM on your domU than it should be pretty easy to just add another file-backed disk to your domU and expand its size that way.... On Tue, 7 Nov 2006, Jeff wrote:> I have created an xp domain and fc6 domain but I picked too small of size for > the image. > > My xp domain is using a physical device (logical volume) and my fc6 domain is > using a file for the mapped disk. > > Isn''t there a way to enlarge the filesystem of the guest by enlarging the > backing file/device? If so, what exactly do you do to enlarge the backing > file/dev? > > --- > Thanks, > Jeff > > -- > Fedora-xen mailing list > Fedora-xen@redhat.com > https://www.redhat.com/mailman/listinfo/fedora-xen >
Woops, I guess I should work on my reading comprehension.... of course you''re not using LVM if you''ve got an XP domU. On Tue, 7 Nov 2006, Ben wrote:> If you''re using LVM on your domU than it should be pretty easy to just add > another file-backed disk to your domU and expand its size that way.... > > On Tue, 7 Nov 2006, Jeff wrote: > >> I have created an xp domain and fc6 domain but I picked too small of size >> for the image. >> >> My xp domain is using a physical device (logical volume) and my fc6 domain >> is using a file for the mapped disk. >> >> Isn''t there a way to enlarge the filesystem of the guest by enlarging the >> backing file/device? If so, what exactly do you do to enlarge the backing >> file/dev? >> >> --- >> Thanks, >> Jeff >> >> -- >> Fedora-xen mailing list >> Fedora-xen@redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-xen >> > > -- > Fedora-xen mailing list > Fedora-xen@redhat.com > https://www.redhat.com/mailman/listinfo/fedora-xen >
> > Isn''t there a way to enlarge the filesystem of the guest by enlarging the > > backing file/device? If so, what exactly do you do to enlarge the backing > > file/dev?For ext3 I use (in this case adding 1GB): dd if=/dev/zero bs=1M count=1024 >> file.image e2fsck -f file.image resize2fs file.image e2fsck -f file.image Paul
this is the correct way to resize dd if=/dev/zero of=root_fs.ext3 bs=1 count=1 seek=2G conv=notrunc e2fsck -f root_fs.ext3 -y resize2fs -p root_fs.ext3 replace root_fs.ext3 with the filesystem name replace 2g with new size of the filesystem image more details here http://user-mode-linux.sourceforge.net/resize.html -------------------- Itamar Reis Peixoto e-mail: itamar@ispbrasil.com.br msn: itamarjp@starmedia.com skype: itamarjp icq: 81053601 +55 34 3238 3845 +55 11 4063 5033> >> > Isn''t there a way to enlarge the filesystem of the guest by enlarging >> > the >> > backing file/device? If so, what exactly do you do to enlarge the >> > backing >> > file/dev? > > For ext3 I use (in this case adding 1GB): > > dd if=/dev/zero bs=1M count=1024 >> file.image > e2fsck -f file.image > resize2fs file.image > e2fsck -f file.image > > Paul >
I guess I don''t understand how to fix the partition size using unix tools. Here is what I tried for a ntfs file backed system: #add a gig to file dd if=/dev/zero bs=1M count=1024 >> file.image parted file.image Disk /vserver/images/xp.img: 3171MB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 2093MB 2093MB primary ntfs boot 2093MB 3171MB 1078MB Free Space (parted) resize 1 32.3kB 3171MB No Implementation: Support for opening ntfs file systems is not implemented yet. Not sure how to fix partition table and image is not bootable at this point. I tryed ntfsresize ntfsresize v1.13.1 (libntfs 9:0:0) Device name : /dev/mapper/loop1p1 NTFS volume version: 3.1 Cluster size : 2048 bytes Current volume size: 2093253120 bytes (2094 MB) Current device size: 2093253120 bytes (2094 MB) New volume size : 2999996928 bytes (3000 MB) ERROR: New size can''t be bigger than the device size. If you want to enlarge NTFS then first enlarge the device size by e.g. fdisk. Andrew Cathrow wrote:> Ouch, > It''s possible but not nice. > > Obviously the first step is to back up your existing file before you try > any of this .... > > First step is you need to enlarge the file itself. > Use dd to to this for example > dd if=/dev/zero of=myImage.img seek=***** bs=1M count=1 > > The seek value should be big enough to seek past the current data so we > don''t overwrite anything - so for example make it a 2gb past the end of > the file. > You now have a larger sparse file. > At this point you have a larger disk but your partition table is out of > whack. > So you need to use a tool like parted/gparted to change the partition > table. You can also use fdisk if you''re feeling brave. > These tools won''t work directly on a file, so you''ll need to create a > block device for that image, you can use kpartx for this, see the link > below > http://fedoraproject.org/wiki/FedoraXenQuickstartFC6#head-9c5408e750e8184aece3efe822be0ef6dd1871cd > > When you''ve enlarged the partition to the correct size then you''ll need > to resize the ntfs file system - for this you''ll need ntfsresize. > http://mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html > > Good luck, don''t forget the backup ! > > Aic > > > > > On Tue, 2006-11-07 at 06:04 -0600, Jeff wrote: > >> I have created an xp domain and fc6 domain but I picked too small of >> size for the image. >> >> My xp domain is using a physical device (logical volume) and my fc6 >> domain is using a file for the mapped disk. >> >> Isn''t there a way to enlarge the filesystem of the guest by enlarging >> the backing file/device? If so, what exactly do you do to enlarge the >> backing file/dev? >> >> --- >> Thanks, >> Jeff >> >> -- >> Fedora-xen mailing list >> Fedora-xen@redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-xen >> > >