Gzip “No space left on device”

dfgziphard drive

Using gzip 1.3.12 / ubuntu 64bit I am getting "No space left on device" yet there appears to be plenty of disk space remaining.

gunzip 03-05-2012--22-52-01.tar.gz

gzip: 03-05-2012--22-52-01.tar: No space left on device

If you run the above gunzip twice in a row the first time it takes a while before showing the error, the second time it happens straight away.

On the other hand if I use tar it works to start with for a certain number of files before giving errors. After the errors I can see some of the files on disk.

tar -zxvf 03-05-2012--22-52-01.tar.gz

<snip>
tar: root/backups/project_x/03-05-2012--22-52-01/data/contentstore/2012/3/29/10/11: Cannot mkdir: No space left on device
tar: Exiting with failure status due to previous errors

Diskspace:

sudo du -sh /* | sort -gr | head -n 5
752M    /usr
424M    /var
160K    /run
78M     /lib
48K     /tmp

df -i -h
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/xvda1              640K     75K    566K   12% /
udev                    932K     381    932K    1% /dev
tmpfs                   934K     255    934K    1% /run
none                    934K       2    934K    1% /run/lock
none                    934K       1    934K    1% /run/shm
/dev/xvdb                27M      11     27M    1% /mnt

df -h --total
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            9.9G  6.3G  3.1G  68% /
udev                  3.7G  4.0K  3.7G   1% /dev
tmpfs                 1.5G  160K  1.5G   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  3.7G     0  3.7G   0% /run/shm
/dev/xvdb             414G  199M  393G   1% /mnt
total                 432G  6.5G  405G   2%

sudo blkid
/dev/xvda1: LABEL="cloudimg-rootfs" UUID="46e0a6b7-bb53-4d56-aba0-a2a6202d9787" TYPE="ext4" 
/dev/xvdb: UUID="a7534fe5-1538-4ebc-b553-7dfc6a37df02" TYPE="ext3" 
/dev/xvdc: UUID="a7534fe5-1538-4ebc-b553-7dfc6a37df02" SEC_TYPE="ext2" TYPE="ext3" 

Best Answer

What is the question you are asking exactly?

“No space left on device”

Would indicate that you've run out of disk space. Change the current working directory to another directory mounted on a larger partition and try again ...

Also, bear in mind that du won't always match df. It is possible for files to be deleted but the handles still remain in use by an application, so df can show less disk space available than du reports.