Avamar:由于索引节点数量导致的设备上没有剩余空间错误

Summary: 本文提供了尽管 df 命令显示可用空间,但仍报告 /var 文件系统的“No space left on device”问题的解决方案。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Symptoms

运行 logrotate error 生成一个错误,指示没有空格:

logrotate -f /etc/logrotate.conf
error: error creating output file /var/log/firewall: No space left on device 
error: error creating output file /var/log/mail.err: No space left on device 
error: error creating output file /var/log/wtmp-nnnnnnnn: No space left on device 
 

df 命令显示可用空间:

df -h
Filesystem     Size  Used  Avail  Use%  Mounted on 
/dev/sda5      7.9G  4.2G   3.4G   56%  / 
devtmpfs       5.8G  248K   5.8G    1%  /dev 
tmpfs          5.8G     0   5.8G    0%  /dev/shm 
/dev/sda1      114M   53M    56M   49%  /boot 
/dev/sda3      256G  19G    237G    8%  /data01 
/dev/sda7      1.5G  524M   899M   37%  /var 
 

尝试在 /var 文件系统上创建文件也会导致空间错误:

touch /var/log/test
touch: cannot touch '/var/log/test': No space left on device

Cause

文件系统已耗尽 inodes

使用“-i”开关重新运行 df 命令可以确认这一点:

df -i 
Filesystem      Inodes   IUsed     IFree  IUse%  Mounted on 
/dev/sda5       524288  106337    417951    21%  / 
devtmpfs             0      0          0     -   /dev 
tmpfs          1513794      1    1513793     1%  /dev/shm 
/dev/sda1        30120     49      30071     1%  /boot 
/dev/sda3    267691072   5438  267685634     1%  /data01 
/dev/sda7        97536  97536          0   100%  /var


这通常是由碎片化的文件系统、大量非常小的文件、临时文件或大型邮件队列引起的。

Resolution

提醒:这些命令必须以根用户身份运行。
 

可以运行 du 命令来查看占用空间的内容:

du -x -h /var --max-depth=1 
 

输出示例显示 /var/spool 目录占用了 /var 中的大部分空间:

8.0K    /var/state 
4.0K    /var/X11R6 
4.0K    /var/crash 
45M     /var/lib 
4.0K    /var/named 
4.0K    /var/opt 
12K     /var/yp 
380M    /var/spool 
132K    /var/run 
4.0M    /var/cache 
25M     /var/adm 
16K     /var/lost+found 
8.0K    /var/tmp 
28K     /var/lock 
37M     /var/log 
56K     /var/games 
489M    /var
 

然后,可以在目录树中再次运行 du 命令:

du -x -h /var/spool --max-depth=1
 

需要进一步调查,具体取决于占用空间的原因。

如果需要帮助,请向 Dell Technologies Avamar 支持团队 提出服务请求 (SR)。

 

在此示例中:问题在于许多非常小的文件。

        • 最大的目录是 /var/spool/postfix/maildrop,包含数千个小文件:
ls -l /var/spool/postfix/maildrop| wc -l 
96559
 
        • 每个文件都包含以下内容:
admin : /etc/sudoers is mode 0777, should be 0440
 
        • sudoers 文件的权限和所有权已更新:
chmod 0440 /etc sudoers
chown root:root /etc/sudoers
 
        • /var/spool/postfix/maildrop 目录中的文件已删除,问题已解决。

Affected Products

Avamar

Products

Avamar
Article Properties
Article Number: 000165842
Article Type: Solution
Last Modified: 04 Sept 2025
Version:  6
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.