Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
trim21 opened this issue Jun 26, 2021 · 4 comments · May be fixed by #643
Open

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

trim21 opened this issue Jun 26, 2021 · 4 comments · May be fixed by #643

Comments

@trim21
Copy link
Collaborator

trim21 commented Jun 26, 2021

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.

@trim21 trim21 changed the title Long mount path is omitted by disk usage function. [Bug]: Long mount path is omitted by disk usage function. Jun 26, 2021
@jesec
Copy link
Owner

jesec commented Jun 26, 2021

I made the change to filter out stuff like /var/snap/microk8s/common/run/containerd/cffbf286-d8b7-46f4-8088-9eb041f13bc1.

More often than not, those super long mount points are not useful, and the frontend has troubles with those.

@trim21
Copy link
Collaborator Author

trim21 commented Jun 26, 2021

so how about providing a way to set watchMountPoints? only moint points in this config will show in frontend.

@jesec
Copy link
Owner

jesec commented Jun 26, 2021

It is unnecessarily complicated. I think a better option would be to simply use the paths of --allowedpath.

@trim21
Copy link
Collaborator Author

trim21 commented May 3, 2023

--allowedpath doesn't add mount path into disk usage, they are still filtered

@trim21 trim21 linked a pull request May 3, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants