flood icon indicating copy to clipboard operation
flood copied to clipboard

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

Open trim21 opened this issue 4 years ago • 4 comments

Type: Bug Report

Your Environment

  • Version used:
    • 4.6.0
    • dafe0365
  • 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.

https://github.com/jesec/flood/blob/dafe0365e7811761bd74cd6b3163bae72318fad2/server/models/DiskUsage.ts#L62

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.

https://github.com/jesec/flood/blob/dafe0365e7811761bd74cd6b3163bae72318fad2/shared/schema/Config.ts#L117

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 avatar Jun 26 '21 05:06 trim21

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.

jesec avatar Jun 26 '21 07:06 jesec

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

trim21 avatar Jun 26 '21 07:06 trim21

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

jesec avatar Jun 26 '21 07:06 jesec

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

trim21 avatar May 03 '23 09:05 trim21