简体   繁体   English

(linux) gzip 失败,设备上没有剩余空间

[英](linux) gzip fails with No space left on device

I need to compress a directory on my Ubuntu server.我需要在我的 Ubuntu 服务器上压缩一个目录。 The directory is about 3.2 Go, and I have 15 Go left over 20 Go available on my server.该目录大约是 3.2 Go,我的服务器上还有 15 个 Go 可用,超过 20 个可用。 I'm using the command: tar -zcvf test src_directory我正在使用命令: tar -zcvf test src_directory

The command fails with the message:命令失败并显示以下消息:

gzip: stdout: No space left on device gzip:标准输出:设备上没有剩余空间
tar: test: Wrote only 6144 of 10240 bytes tar: test: 只写了 10240 个字节中的 6144 个
tar: Child returned status 1 tar:子返回状态 1
tar: Error is not recoverable: exiting now tar:错误不可恢复:现在退出

Why is it failing as I have enough space on my server ?为什么我的服务器上有足够的空间会失败? (15 Go should be enough) (15 Go应该就够了)

thanks谢谢

EDIT编辑

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            463M     0  463M   0% /dev
tmpfs            98M  2.2M   96M   3% /run
/dev/xvda1       20G   17G  2.2G  89% /
tmpfs           490M     0  490M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           490M     0  490M   0% /sys/fs/cgroup
tmpfs            24K     0   24K   0% /var/gandi
$ lsblk 
NAME    MAJ:MIN  RM  SIZE RO TYPE MOUNTPOINT
xvda    202:0     0   20G  0 disk 
└─xvda1 202:1     0   20G  0 part /
xvdz    202:6400  0  512M  0 disk 
├─xvdz1 202:6401  0  502M  0 part [SWAP]
└─xvdz2 202:6402  0   10M  0 part 

with df, I can see there is only 2.2G left on the disk.使用df,我可以看到磁盘上只剩下2.2G。 How can I have details about what is taking so much space ?我如何获得有关占用这么多空间的详细信息? Because I know that my application files only take 4.6G.因为我知道我的应用程序文件只占用 4.6G。

thanks谢谢

Check whether you have enough memory available on the partition you want the archive to be stored in检查要存储存档的分区上是否有足够的可用内存

$: df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          476G  300G  176G  63% /

Also check if you have the permissions necessary to archive the desired directory.还要检查您是否具有存档所需目录所需的权限。

If the problem still persists, I may suggest a filesystem check如果问题仍然存在,我可能会建议进行文件系统检查

$: lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 698.7G  0 disk 
├─sda1   8:1    0   500M  0 part /boot
├─sda2   8:2    0   5.8G  0 part [SWAP]
├─sda3   8:3    0    50G  0 part /
├─sda4   8:4    0     1K  0 part 
└─sda5   8:5    0 642.4G  0 part /home

# Find the device that matches the mountpoint of the directory in question
# Replace X with the appropriate device
# Replace Y with the appropriate partition
$: sudo fsck -vcck /dev/sdXY 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM