You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Prometheus Node Exporter磁盘问题求助:无卷信息及设备错误

Troubleshooting Node Exporter Disk Volume Issues: Missing Metrics & node_filesystem_device_error

Yep, this is a super common pain point with Node Exporter—lots of folks hit these exact issues when dealing with non-root filesystems. Let’s walk through how to fix both problems step by step:

1. Unable to Retrieve Disk Volume Information

First, let’s rule out the most common culprits:

  • Check collector flags: By default, Node Exporter enables the filesystem collector, but it ignores certain filesystem types (like tmpfs, devtmpfs, squashfs) out of the box. If your /dir uses a filesystem that’s being filtered, adjust the --collector.filesystem.ignored-fs-types flag to exclude your filesystem type. For example, if it’s ext4, update your startup command to:
    ./node_exporter --collector.filesystem.ignored-fs-types="^(tmpfs|devtmpfs|squashfs)$"
    
  • Verify mount status: Double-check that /dev/vdb is actually mounted at /dir using the mount command. If the mount is broken or incomplete, Node Exporter won’t pick up the volume.
  • Check permissions: The user running Node Exporter needs read access to the /dir mount point. If you’re using a non-root user, make sure they have at least r-x permissions on /dir (run chmod 755 /dir if needed).

2. node_filesystem_device_error=1 for Non-Root Disks

This error almost always boils down to permissions or filesystem compatibility issues:

  • Fix permissions with capabilities: If you’re running Node Exporter as a non-root user, it likely lacks the permissions to read disk metrics from /dev/vdb or system paths like /proc/mounts. Instead of running it as root (which isn’t ideal for security), add Linux capabilities to the binary:
    sudo setcap cap_dac_read_search,cap_sys_admin+ep /path/to/node_exporter
    
    This gives Node Exporter the necessary permissions to access filesystem stats without full root access.
  • Check mount options: If you mounted /dev/vdb with restrictive options like noexec, nodev, or nosuid, these can block Node Exporter from reading critical filesystem data. Test by remounting without these options:
    sudo mount -o remount,rw /dir
    
    If the error goes away, adjust your /etc/fstab entry to remove the problematic options.
  • Upgrade Node Exporter: Older versions may have bugs or limited support for newer filesystem types (like XFS or Btrfs). Grab the latest stable version and try again—v1.8+ has improved filesystem handling for many edge cases.

Quick Verification Steps

After making changes:

  1. Restart Node Exporter to apply the new flags/capabilities.
  2. Run this command to check if your /dir metrics show up and the error is resolved:
    curl http://your-node-ip:9100/metrics | grep -E "(node_filesystem_size_bytes.*dir|node_filesystem_device_error.*dir)"
    
  3. Check Node Exporter’s logs for any startup errors related to the filesystem collector—this can clue you in on missing permissions or unsupported types.

内容的提问来源于stack exchange,提问作者James Pei

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 23:02:43