Why does tar report not enough disk space when there is plenty of it left

disk-usagentfstar

On a Ubuntu 14.04 system I tried to extract a tar archive:

/media/ntfs-drive/target-dir$ tar --extract -v --file ../source-dir/data.tar

After extracting some of the files, tar reports that there was not enough disk space left, while in reality there is plenty of it. Here is the output of df -m for the relevant device showing that around 86 GByte of free space are left:

/dev/sdb5         226966  139075     87892   62% /media/ntfs-drive

Also, only 2% of the drive's Inodes are used as df -i shows:

/dev/sdb5      91114956  1086160 90028796    2% /media/ntfs-drive

Some more information that might be of relevance:

  • Both the source and the target dir are located on the same NTFS drive
  • The archive data.tar contains a large number of small files
  • My root partition is nearly full (1,4 GByte free)
  • mount says that the relevant drive has been mounted with options rw,nosuid,nodev,allow_other,default_permissions,blksize=4096

What could be the reason for tar's error message and how can I solve this problem?

Update

It seems that this is not really a tar problem, as the system reports the disk to be full after the failed tar extraction. E.g.

touch /media/ntfs-disk/test

fails with the error that there is not enough space left. However, as I've described above, there is plenty of disk space and Inodes left according to df. Are there any hidden temporary files that are not seen by df?

Update 2

I realized that I can change and increase files on the disk but that I cannot create new files. I'v read here that NTFS supports over 4 billion files per volume. Currently my disk contains about 1 million files. But is there another limit on the number of files?

Best Answer

GNU tar uses $TMPDIR for deciding where to write extended header information. You might try setting TMPDIR to point to a writable location on your large drive.

Related Question