磁盘空间查错

磁盘空间不足可能会对 SUSE Multi-Linux Manager 数据库和文件结构造成严重影响,在大多数情况下,这种影响不可恢复。SUSE Multi-Linux Manager 会监控特定目录的可用空间,在有问题时会发出警报(可配置)。有关空间管理的详细信息,请参见 磁盘空间管理

Generally, container volumes share space with the host filesystem. When the btrfs filesystem becomes full, it can prevent you from deleting files. To resolve this, you can add a small amount of storage temporarily to the filesystem using the btrfs device add command. This will allow you to delete files to gain space for further filesystem maintenance. When done with the maintenance, you can remove the temporary storage with btrfs device delete. For more information about this topic, see https://www.suse.com/support/kb/doc/?id=000018779.

可以通过去除未使用的软件通道来恢复磁盘空间。

  • 有关如何删除供应商通道的说明,请参见 通道管理

  • 有关如何删除自定义通道的说明,请参见 自定义通道

您还可以检查自定义通道的同步频率。有关如何处理自定义通道同步的说明,请参见 administration:custom-channels.adoc#_custom_channel_synchronization

还可以通过清理未使用的激活密钥、内容生命周期项目和客户端注册来恢复磁盘空间。还可以去除多余的数据库项:

过程:去除多余的数据库项
  1. Use the spacewalk-data-fsck command to list any redundant database entries.

  2. Use the spacewalk-data-fsck --remove command to delete them.

1. Disk Check Warnings for Missing Directories

After migrating to containerized deployments from 5.0 or when using custom disk check configurations, you might see warnings for directories that no longer exist. This commonly occurs when the DISKCHECKDIRS environment variable references /var/lib/pgsql or its subdirectories.

In containerized deployments, the PostgreSQL database runs in its own container, and the /var/lib/pgsql directory no longer exists in the server container. The database files are stored in a separate database container volume.

If you see warnings like these in the logs or notifications:

DISKCHECK: Directory /var/lib/pgsql does not exist
DISKCHECK: Directory /var/lib/pgsql/data does not exist

This indicates that the disk check configuration includes directories that are no longer valid in containerized deployments.

1.1. Cause

Prior to containerization, customers could configure custom directories to monitor by setting the spacecheck_dirs parameter in /etc/rhn/rhn.conf. A common configuration included /var/lib/pgsql to monitor database disk space.

In containerized deployments:

  • The spacecheck_dirs parameter in /etc/rhn/rhn.conf is still read, but is overridden by the DISKCHECKDIRS environment variable if set

  • If DISKCHECKDIRS is not set, the system falls back to spacecheck_dirs from the configuration file

  • The database runs in a separate container and has its own dedicated disk check

1.2. Fix

Remove the obsolete directory references from the DISKCHECKDIRS environment variable.

Procedure: Removing Obsolete Directory References
  1. Check if you have a systemd override file with custom directory configuration:

    cat /etc/systemd/system/uyuni-server.service.d/diskcheck.conf
  2. If the file contains /var/lib/pgsql or other non-existent directories, update it to use only valid directories:

    cat > /etc/systemd/system/uyuni-server.service.d/diskcheck.conf << 'EOF'
    [Service]
    Environment="DISKCHECKDIRS=/var/spacewalk /var/cache /srv"
    EOF
  3. Apply the configuration by restarting SUSE Multi-Linux Manager:

    mgradm restart

1.3. 结果

The disk check warnings for missing directories will no longer appear. The server container will only monitor the directories that exist within the container.

The database container has its own separate disk check that monitors the PostgreSQL data directory (/var/lib/pgsql/data) within the database container. This check is automatically configured and does not require manual intervention.

For more information about disk space management in containerized deployments, see 磁盘空间管理.