0

I am trying to unzip a tar file using tar xvzf ZAP_2.7.0_Linux.tar.gz here is the file. What could be the problem?

-rw-r--r--  1 root root  32165888 Mar  6 12:06 ZAP_2.7.0_Linux.tar.gz
-rwxrwxrwx  1 root root         0 Mar  6 12:47 ZAP_2_7_0_unix.sh

When I try this [root@localhost ~]# tar xvzf ZAP_2.7.0_Linux.tar.gz

I am getting the following error.

tar: ZAP_2.7.0/plugin/diff-beta-8.zap: Cannot open: No space left on device
ZAP_2.7.0/plugin/directorylistv1-release-3.zap

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

Looks like I have enough disk space. Am I reading something incorrectly here? Sorry if its a basic question. Why is root showing 'Use%' as 100%?

[root@localhost ~]# df
Filesystem              1K-blocks    Used Available Use% Mounted on
/dev/mapper/centos-root   6981632 6981080       552 100% /
devtmpfs                  1426928       0   1426928   0% /dev
tmpfs                     1442256      84   1442172   1% /dev/shm
tmpfs                     1442256    8892   1433364   1% /run
tmpfs                     1442256       0   1442256   0% /sys/fs/cgroup
/dev/sda1                  508588  160004    348584  32% /boot
tmpfs                      288452      16    288436   1% /run/user/42
tmpfs                      288452       0    288452   0% /run/user/0
[root@localhost ~]#

What could be the problem?

[root@localhost ~]# df /dev/sda
Filesystem     1K-blocks  Used Available Use% Mounted on
devtmpfs         1426928     0   1426928   0% /dev
  • 2
    You seem to have run out of disk space on your / partition and I'm assuming that it is in a directory on this partition that you try to write the extracted archive. That is the problem. – Kusalananda Mar 6 at 10:08
  • Thanks Kusalananda, How do I fix this? – user339262 Mar 6 at 10:27
  • How to fix this by making '/' part of 'devtmpfs' ? – user339262 Mar 6 at 10:35
  • When I do a $mount [root@localhost etc]# $mount [root@localhost etc]# Don't see anything...@Kusalananda – user339262 Mar 6 at 10:50
  • tmpfs is in RAM – Rui F Ribeiro Mar 6 at 11:18
2

You seem to be having two problems:

  • the filesystem is full
  • the tar.gz file is truncated, i.e. not complete according to the error gzip: stdin: unexpected end of file

The second problem is probably due to the first problem: there was no space to save the complete tar.gz file while downloading (or whatever other means of obtaining the file).

You write "Looks like I have enough disk space". What leads you to that conclusion, as you write in the same paragraph: "Why is root showing 'Use%' as 100%?", which means that the filesystem is full... There are a couple of blocks free, but that can be due to temporary files having been removed by some daemon, for example.

Your df /dev/sda tells df to show the filesystem on which the specified file is stored; it does not show you how much space is on that device.

In short, your filesystem is full, and you either need to delete unneeded files, or you need to increase the size of the filesystem.

Your root filesystem is on LVM (logical volume manager). There is a chance that there is unused space available in the volume group. Check with

# vgdisplay

There will be a line Free PE / Size, if that is not zero then you can allocate that space to your root filesystem. If you want to allocate all available space, use:

# lvresize --extents +100%FREE /dev/mapper/centos-root

After the device has been increased in size, the filesystem itself needs to be grown to use the extra space. Here I'm assuming that the filesystem is ext4, check first with mount and see the type listed.

# resize2fs /dev/mapper/centos-root

This will use all available space for the filesystem.

EDIT / Extra info:

The 40MB that is shown as free is probably too small to be added anyway, but LVM needs to write to its configuration to perform its task, and there's no room for that... So first you have to free some space in some way, I usually go to /var/log/ to remove old log files there in such a situation.

  • Thanks for the detailed explanation. Here are the results. [root@localhost etc]# vgdisplay Free PE / Size 10 / 40.00 MiB VG UUID hdJrCc-03iu-t71o-Kmwl-rqg9-G60w-LQL7qM When I type in [root@localhost etc]# lvresize --extents +100%FREE /dev/mapper/centos-root Couldn't create temporary archive name. Volume group "centos" metadata archive failed. What could you be issue? @wurtel – user339262 Mar 6 at 12:05
  • I've added extra info to the answer. – wurtel Mar 6 at 13:09
  • Often the package manager's cache can grow surprisingly large. On a CentOS system, yum clean all will clear that cache; it might free a lot of disk space. – telcoM Mar 6 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy