Re: [et-mgmt-tools] Manually creating a sparse file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2007-04-06 at 16:21 -0400, Caetano, Greg wrote:
> I would like to manually create a VM sparse file that I can use fdisk to
> partition then copy a running root partition into the loopback sparse
> file.
> 
> How would I manually generate the proper vm sparse file?

virt-install creates a sparse file by default for file-backed guests; if
you have qemu-img, that can do the same thing. 

Or you can use your favorite scripting language as long as it can seek
in a file. Here's what that would look like in ruby:

        File::open("/tmp/s.txt", "w") do |file| 
          file.seek(1024*1024*1024)
          file.print("\000")
        end

That creates a 1GB sparse file /tmp/s.txt

David



[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux