qemu dd sizes
When using dd to create a disk image to boot through qemu, does the block size really matter, or can I omit that parameter? If the size of the original disk is 20 gb but there is only 2 gb of data on the disk, how can I make the image size smaller?
_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
Quoted 4 lines · jmf
When using dd to create a disk image to boot through qemu, does the block size really matter, or can I omit that parameter? If the size of the original disk is 20 gb but there is only 2 gb of data on the disk, how can I make the image size smaller?
It is a little unclear what you are asking here. dd uses the block size
and a count in order to determine how much to copy. If you are making a file with holes in it, you can use a block size, offset and then set count=0. If you omit the count and block size, it will use the default block size (512 bytes I think) and will simply copy until either the source runs out of data or the destination runs out of space.
If there is 2GB, it depends what the original filesystem was. Ext2/3 (under Linux) puts data all over the disk in a sparse manner. So, just copying the first 2GB would not get all the data. If it is a Windows partition and you are using VFAT, then running the defragmenter program will push all the data to one end of the disk (beginning?). With NTFS, I'm not sure what happens.
You could try to resize the 20GB partition down to 2.5GB and then copy that with dd. What kind of filesystem is it?
Best,
Kyle
Quoted 3 lines
If the size of the
original disk is 20 gb but there is only 2 gb of data on the disk, how can I make the image size smaller?
If you're trying to save space, I'd advise you to check the output of ls -ls. The -s flag also prints out the actual space taken on disk, as well as the nominal length of the file usually output by -l.
Most filesystems will represent zero-filled areas of a file with a small constant amount of on-disk space. If you're only using 2GB then the actual on disk size might only be just over 2GB. As you add more data, the on disk size will grow to fit.
It's worth checking this before you bother resizing!
Cheers,
Mark
Quoted 14 lines
_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel