[GRASS5] mysterious disk full error in r.resamp.rst

Hi,

we have an error when using r.resamp.rst to downsample
a raster map:

Input data:

r.info -s max11
nsres=10
ewres=10

g.region -p
projection: 99 (Transverse Mercator)
zone: 0
datum: rome40
ellipsoid: international
north: 5157110
south: 5059580
west: 1612510
east: 1728650
nsres: 10
ewres: 10
rows: 9753
cols: 11614

GRASS 6.0.cvs: > r.resamp.rst in=max11 ew_res=110 ns_res=110 elev=resmax11
...
mapset for input demetri

Processing all selected output files will require
3746688 bytes of disk space for temp files

zmin=56.751999,zmax=3760.000000
Temporarily changing the region to desired resolution...
Changing the region back to initial...
Percent complete: 40%
Not enough disk space--cannot write files
Not enough disk space--cannot write files
Not enough disk space--cannot write files
Not enough disk space--cannot write files
...

The lsof command below shows that (only) around 4MB are used as indicated
above.
The df -h command below shows that more than 3GB are available:

/usr/sbin/lsof -p 4729
...
r.resamp. 4729 demetri 3r REG 8,3 187093184 49753 /hardmnt/vanga0/ssi/grassdata_demetri/pat/demetri/fcell/max11
r.resamp. 4729 demetri 4u REG 8,3 3743744 49659 /hardmnt/vanga0/ssi/grassdata_demetri/pat/demetri/.tmp/vanga/4729.0

df -h /hardmnt/vanga0/ssi/grassdata_demetri/pat/demetri/.tmp/vanga/
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 25G 21G 3.2G 87% /hardmnt/vanga0

Is it possible that the fwrite() in main.c of r.resamp.rst doesn't report
the correct error (since we have plenty of disk space)? Which error
could it be (in general the module seems to work)?

Thanks

Markus

Markus Neteler wrote:

we have an error when using r.resamp.rst to downsample
a raster map:

Not enough disk space--cannot write files

Is it possible that the fwrite() in main.c of r.resamp.rst doesn't report
the correct error (since we have plenty of disk space)? Which error
could it be (in general the module seems to work)?

Looking at the code, you will get tat error message if fwrite() fails
for any reason.

      if (!(fwrite (zero_array_cell, sizeof (FCELL), nsizc, Tmp_fd_z)))
  clean_fatal_error ("Not enough disk space -- cannot write files");

There may be other limitations, e.g. process resource limits
(corresponding to "ulimit -f"), quotas, or reservations (on ext2fs,
typically 5% of each partition is reserved for root, but the amount
can be changed via tune2fs).

Or there may be other errors, e.g. an I/O error (bad sector) or an
attempt to write beyond the 2GiB limit (if the file is sparse, it
doesn't need to actually use 2GiB of disk space).

--
Glynn Clements <glynn@gclements.plus.com>