Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

[Discuss] iscsitarget



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



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org