I am probably holding a piece of Erlang wrong but this was unexpected.
Any clues?
What if you add slash at the end, i.e. /root/
?
Mine works, but I had to do :disksup.start_link
before using it as I got the warning:
12:42:54.797 [warning] OS_MON (:disksup) called by #PID<0.110.0>, not started
iex(8)> :disksup.get_disk_info()
[
{~c"/", 488878112, 358518096, 23},
{~c"/dev", 4096, 4096, 0},
{~c"/dev/shm", 16388668, 16193968, 2},
{~c"/sys/firmware/efi/efivars", 128, 97, 22},
{~c"/run", 6555468, 6553344, 1},
{~c"/tmp", 16388672, 16303136, 1},
{~c"/boot", 1684592, 1242612, 22},
{~c"/boot/efi", 523248, 482132, 8},
{~c"/run/user/1000", 3277732, 3277576, 1}
]
iex(9)> :disksup.get_disk_info(~c"/")
[{~c"/", 488878112, 358518060, 23}]
iex(10)> :disksup.get_disk_info(~c"/run/user/100")
[{~c"/run/user/100", 0, 0, 0}]
iex(11)> :disksup.get_disk_info(~c"/run/user/100/")
[{~c"/run/user/100/", 0, 0, 0}]
Mine does not, with slash or not at the end.
Hmmm, what the. Can you try starting iex as root?
no, can’t now actually. But it works for some mount points, not for the others. I could get the stats for /boot
for example.
You actually have a typo:
Should be ~c"/run/user/1000"
. This is expected behavior as specified per documentation:
Returns [{Path,0,0,0}] if the Path is invalid or space can’t be determined. Returns [{“none”,0,0,0}] if disksup is not available.
lmao okay you’re right, I brought nothing to the conversation