[Fedora-xen] enlarge file backed filesystem

Jeff jeff at kreska.org
Wed Nov 8 11:53:08 UTC 2006


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 at redhat.com
>> https://www.redhat.com/mailman/listinfo/fedora-xen
>>     
>
>   




More information about the Fedora-xen mailing list