Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <014501c43915$f52ba070$64fda287@docbill002> From: "Bill C. Riemers" To: "Daniel Slater" , , , References: Subject: Re: [coLinux-devel] Sparse files? Date: Thu, 13 May 2004 14:12:59 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Looks like you are right. The following sequence works: dd if=/dev/zero of=small bs=4096 seek=32 count=0 cp --sparse=always small sparse dd if=/dev/zero bs=64M of=sparse seek=2048 count=0 I seem to be limited on how much I can grow the file each time, but eventually it can grow up to 64k less than 16 terabytes as a maximum size on a partition that only has 7 gigabytes of space available. Bill ----- Original Message ----- From: "Daniel Slater" To: "'Bill C. Riemers'" ; ; ; Sent: Thursday, May 13, 2004 1:20 PM Subject: RE: [coLinux-devel] Sparse files? > To Create Sparse files under windows, you must the DeviceIoControl() API > with the FSCTL_SET_SPARSE flag to create a sparse file. I suspect cygwin's > dd program is not using this API. > > Look on the Wiki site: http://www.colinux.org/wiki/index.php/NiceTools for > some utilities for creating sparse files. > > > -----Original Message----- > From: colinux-devel-admin AT lists DOT sourceforge DOT net > [mailto:colinux-devel-admin AT lists DOT sourceforge DOT net] On Behalf Of Bill C. > Riemers > Sent: Thursday, May 13, 2004 10:51 AM > To: bhds AT earthlink DOT net; colinux-devel AT lists DOT sourceforge DOT net; > cygwin AT cygwin DOT com > Subject: [coLinux-devel] Sparse files? > > OK. Then there must be a problem in the way cygwin creates sparse files, > since the files created by seeking past the end in cygwin always take up the > full amount of disk space. I've verified this with both Windows and cygwin > tools. I'll try taking it up on the cygwin list to see what I can learn. I > would like to understand why dd works perfectly for creating sparse files > under unix, but not under cygwin. > > $ df . > Filesystem 1k-blocks Used Available Use% Mounted on > q: 42756964 17119760 25637204 41% /cygdrive/q > > $ dd if=/dev/zero bs=1k of=foo seek=25637204 count=0 > 0+0 records in > 0+0 records out > > $ df . > Filesystem 1k-blocks Used Available Use% Mounted on > q: 42756964 42756964 0 100% /cygdrive/q > > I have figured a workaround for this problem, which is if I have a sparse > file, I can then successfully truncate it to the desired size with dd. The > initial sparse file can be created under Linux where dd works correctly for > creating sparse files. > > docbill AT docbill002 /cygdrive/q > $ tar xSjf sparse.tar.bz2 huge > > docbill AT docbill002 /cygdrive/q > $ dd if=/dev/zero of=huge bs=4M seek=1024 count=0 > 0+0 records in > 0+0 records out > > docbill AT docbill002 /cygdrive/q > $ df . > Filesystem 1k-blocks Used Available Use% Mounted on > q: 42756964 15777568 26979396 37% /cygdrive/q > > Bill > > ----- Original Message ----- > From: "Brian Dunford-Shore" > To: > Sent: Thursday, May 13, 2004 1:02 AM > Subject: Re: [coLinux-devel] Re: Installer for CoLinux > > > > > Do you really save any filesystem space with NTFS? > > > > > > Certainly it is much faster to create a sparse file: > > > > > > i.e. > > > dd if=/dev/zero of=foo bs=4M seek=1024 count=0 > > > > > > is much faster than > > > > > > dd if=/dev/zero of=foo bs=4M count=1024 > > > > > > but either way Windows will still report the same amount of disk used > when > > > you are done. > > > > > > As I understand NTFS, it reserves the disk space used for filesystem > > > holes... I do not believe VFAT supports file system holes at all. > > > > > > Bill > > > > > > > If you do a right-click properties on a sparse file, it shows 'size' and > 'size > > on disk'. The 'size on disk' for a sparse file (just as for compressed > files) > > is the real amount of space that Windows uses and reserves. I have put > sparse > > files on partitions where the 'size' is larger than the whole > partition--Windows > > is not reserving the disk space. This is documented also on the articles > on the > > subject on MSDN. > > > > You are right about FAT, FAT32/VFAT--they don't support sparse files. I > haven't > > heard if Microsoft's new file system will support sparse files. > > > > Brian Dunford-Shore > > bhds AT earthlink DOT net > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: SourceForge.net Broadband > > Sign-up now for SourceForge Broadband and get the fastest > > 6.0/768 connection for only $19.95/mo for the first 3 months! > > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > > _______________________________________________ > > coLinux-devel mailing list > > coLinux-devel AT lists DOT sourceforge DOT net > > https://lists.sourceforge.net/lists/listinfo/colinux-devel > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > _______________________________________________ > coLinux-devel mailing list > coLinux-devel AT lists DOT sourceforge DOT net > https://lists.sourceforge.net/lists/listinfo/colinux-devel > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > _______________________________________________ > coLinux-devel mailing list > coLinux-devel AT lists DOT sourceforge DOT net > https://lists.sourceforge.net/lists/listinfo/colinux-devel > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/