This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: [coLinux-devel] Sparse files?
- From: "Bill C. Riemers" <docbill at freeshell dot org>
- To: "Daniel Slater" <dan_slater at yahoo dot com>, <bhds at earthlink dot net>, <colinux-devel at lists dot sourceforge dot net>, <cygwin at cygwin dot com>
- Date: Thu, 13 May 2004 14:12:59 -0400
- Subject: Re: [coLinux-devel] Sparse files?
- References: <BACCHUS5kHkLV1hMRHr00000004@h0080c6faba15.ne.client2.attbi.com>
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" <dan_slater@yahoo.com>
To: "'Bill C. Riemers'" <cygwin@docbill.net>; <bhds@earthlink.net>;
<colinux-devel@lists.sourceforge.net>; <cygwin@cygwin.com>
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@lists.sourceforge.net
> [mailto:colinux-devel-admin@lists.sourceforge.net] On Behalf Of Bill C.
> Riemers
> Sent: Thursday, May 13, 2004 10:51 AM
> To: bhds@earthlink.net; colinux-devel@lists.sourceforge.net;
> cygwin@cygwin.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@docbill002 /cygdrive/q
> $ tar xSjf sparse.tar.bz2 huge
>
> docbill@docbill002 /cygdrive/q
> $ dd if=/dev/zero of=huge bs=4M seek=1024 count=0
> 0+0 records in
> 0+0 records out
>
> docbill@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" <bhds@earthlink.net>
> To: <colinux-devel@lists.sourceforge.net>
> 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@earthlink.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@lists.sourceforge.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@lists.sourceforge.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@lists.sourceforge.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/