[Discuss] iscsitarget

Bill Bogstad bogstad at pobox.com
Mon May 7 16:35:23 EDT 2012


On Mon, May 7, 2012 at 4:09 PM, Edward Ned Harvey <blu at nedharvey.com> wrote:
>> From: Matthew Kowalski [mailto:matt.kowalski at gmail.com]
>> Sent: Friday, May 04, 2012 7:15 PM
>>
>> I was able to use truncate -s 40G lun1.img and after restarting the
>> iscsitarget service Windows saw the larger disk.  It works pretty well
>> and it's fast.  Thanks for the help!
>
> That sounds like a sparse file operation to me.  Which I would normally use
> for most situations, but since you explicitly said you created the file
> using a dd command which isn't sparse...  Maybe you wanted a fully allocated
> disk?  If it is sparse now, and you want it fully allocated, I think there's
> only one way to fill it now...  Which is to fill the disk on the guest side.
> For example, install cygwin on windows, and then run:  dd if=/dev/zero
> of=junk.file bs=1024k ; rm junk.file

Better then dd or truncate for the initial creation (or extensions)
would be the Linux specific fallocate program.   On the appropriate
filesystem, it will allocate all the necessary data blocks to the
file, but won't write anything to them.   For security reasons, this
only works on filesystems which keep track of uninitialized (but
allocated blocks) so that read() returns zeroed blocks until the block
is actually written.  This can be as almost as fast as sparse
allocation, but guarantees space is available when you finally need
it.

Bill Bogstad



More information about the Discuss mailing list