Skip to content

[Bug]: Long mount path is omitted by disk usage function. #342

@trim21

Description

@trim21

Type: Bug Report

Your Environment

  • Version used:
  • Environment name and version:
    • Node.js version: v14.17.0
    • npm version: 6.14.13
    • Web browser: irrelevant
  • Operating system and version: linux
  • Torrent client and version: irrelevant

Summary

this is the output of my df -T command.

文件系统        类型          1K-块       已用      可用 已用% 挂载点
udev            devtmpfs    3994480          0   3994480    0% /dev
tmpfs           tmpfs        803872     108172    695700   14% /run
/dev/nvme0n1p1  ext4      236937040   65102840 159728780   29% /
tmpfs           tmpfs       4019352          0   4019352    0% /dev/shm
tmpfs           tmpfs          5120          0      5120    0% /run/lock
tmpfs           tmpfs       4019352          0   4019352    0% /sys/fs/cgroup
tmpfs           tmpfs       4019352     592804   3426548   15% /tmp
/dev/mapper/m-m xfs      2928814848 2343870268 584944580   81% /srv/dev-disk-by-id-dm-name-m-m
/dev/sdb1       ext4      229701520   95030836 134654300   42% /srv/dev-disk-by-id-ata-SanDisk_SDSSDA240G_161755400244-part1
/dev/sda1       ext4      960380628  111292088 849072156   12% /srv/dev-disk-by-id-ata-HGST_HTS541010A9E680_JD1008DM0S2EWW-part1
overlay         overlay   236937040   65102840 159728780   29% /var/lib/docker/overlay2/72e95b1a20e559eb6d8f10d888365f898bf5da17c09cd6d2ba3fe5c0aa7c22b5/merged
overlay         overlay   236937040   65102840 159728780   29% /var/lib/docker/overlay2/cef03d67bf64ff7addc78d7938dedd6a0dcb4943412e4a9bb5b7083507420b55/merged
overlay         overlay   236937040   65102840 159728780   29% /var/lib/docker/overlay2/c95917d98168a0cc7997b0977e5e01e68eb0ab035d0e8f9aeecdf26cc4881afe/merged
overlay         overlay   236937040   65102840 159728780   29% /var/lib/docker/overlay2/1eca60cbf19c1f9799cca18f898bb63f51784c747546e95569d3c8413f97d806/merged

/dev/mapper/m-m, /dev/sdb1 and /dev/sda1 are external hard driver mount in /srv/, with a long path.

they got omitted here.

return disks.filter((disk) => typeof disk.target === 'string' && disk.target.length < 30);

Expected Behavior

diskUsage function should show all mount path including

  • /
  • /srv/dev-disk-by-id-dm-name-m-m
  • /srv/dev-disk-by-id-ata-SanDisk_SDSSDA240G_161755400244-part1
  • /srv/dev-disk-by-id-ata-HGST_HTS541010A9E680_JD1008DM0S2EWW-part1

Current Behavior

diskUsage only shows

  • /

Possible Solution

allow users to edit this un-used config field watchMountPoints, and make sure these path is not omitted.

watchMountPoints: array(string()).optional(),

Steps to Reproduce

  1. mount some fs which is not tmpfs, devtmpfs or squashfs to a long target.
  2. start flood.
  3. this fs is not showing in disk usage.

Context

I'm not sure if you want to remove all docker's overlayfs mount point, I think they should be filtered by this fs type, not by the target string length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions