Getting empeg's available disk space via Hijack

Posted by: Roger

Getting empeg's available disk space via Hijack - 26/03/2016 20:17

If I'm connecting to the player by using Hijack, is there a way to figure out the available disk space?

Why? When you write a FID using emplode (i.e. the native car player protocol), the player decides which disk to put it on based on free disk space, such that the disks tend to fill up evenly (thus providing you with *two* single points of failure, but I digress...).

To write a FID using Hijack's HTTP server, I need to figure out which disk to write it to myself. So: how do I figure out which disk has the most space available?
Posted by: mlord

Re: Getting empeg's available disk space via Hijack - 27/03/2016 14:46

Something like this through the FTP server?

site exec df -a


[EDIT] Mmmm.. no, not quite. The Hijack "SITE EXEC" doesn't capture/return stdout. But using the built-in telnet server makes it easier:

telnet yeller
Trying 10.0.0.37...
Connected to yeller.localnet.
Escape character is '^]'.
bash: no job control in this shell
empeg:/# df /drive0
df /drive0
df: Warning: cannot read table of mounted filesystems: No such file or directory
Filesystem 1k-blocks Used Available Use% Mounted on
- 29181695 23860788 5320907 82% /drive0
empeg:/# exit
Posted by: mlord

Re: Getting empeg's available disk space via Hijack - 27/03/2016 14:51

Enable telnet with this in config.ini:

[hijack]
ktelnetd_port=23
Posted by: mlord

Hijack v519 is released. - 27/03/2016 16:23

I'll make it easier for you. smile

Hijack v519 is released, with a new /proc/df entry, which you can read from over HTTP, Telnet, and/or FTP.

Not exactly the same output as from the df command, but similar. Sizes are given as filesystem block counts.

Code:
Filesystem           MountPoint   Type         Size       Free
/dev/root            /            ext2        15863       4480
none                 /proc        proc            0          0
/dev/hda4            /drive0      ext2     29181695    5320907

Posted by: Roger

Re: Hijack v519 is released. - 27/03/2016 18:03

Originally Posted By: mlord
Hijack v519 is released, with a new /proc/df entry


Perfect. Thanks Mark. I'll play with that later this weekend.
Posted by: mlord

Re: Hijack v519 is released. - 28/03/2016 01:35

Hah. Interesting.
The difference between the telnet "df" output, and the new /proc/df entry, is the "total Size" of the filesystem. The former shows the real size as well as the "size available to Joe Blow", whereas the latter only shows the real size (available to "root"). The difference is the "reserved" count.