Page 1 of 1

Disk size in bytes ???

Posted: Wed Nov 29, 2023 1:18 am
by aboulfad
Hello,

it seems /disk print shows free/total size in bytes, is there a way to change to a higher factor (M, G,..) ? The webUI displays correctly in G not in bytes, it is odd that the CLI shows the disk size in bytes...

RouterOS 7.11.2
RB5009
/disk print
Flags: E - EMPTY, B - BLOCK-DEVICE; M - MOUNTED; g - GUID-PARTITION-TABLE
Columns: SLOT, MODEL, SERIAL, INTERFACE, SIZE, FREE, FS
#     SLOT  MODEL              SERIAL                INTERFACE                    SIZE            FREE  FS  
0 BM  usb1  SanDisk Ultra Fit  4C53000xxxx  USB 3.00 5000Mbps  30 752 636 928  30 442 242 048  ext4
1 E g usb2                                                                                               

Re: Disk size in bytes ???

Posted: Wed Nov 29, 2023 8:31 am
by mkx
What's not correct by displaying exact size in bytes instead of some rounded multiple?

One thing is your request for option to have size displayed in MB / GB / TB, another thing is claim that CLI current behaviour is not correct.

Re: Disk size in bytes ???

Posted: Wed Nov 29, 2023 11:46 am
by aboulfad
Most *nix provide option to show human readable formats (-h), I expected for ease of readability that ROS CLI would too, furthermore it isn’t aligned to the web UI where it shows only in human readable format (or maybe that’s the default for the webUI).

Re: Disk size in bytes ???

Posted: Wed Nov 29, 2023 1:09 pm
by holvoetn
I understand the confusion.
Also because in R6 it was shown in Gb from CLI...

Wiki pages (R6) show it with Gb.
Help pages (R7) however are all in bytes.

My advice:
Divide the number 3 subsequent times by 1024, a bit of free mental training :)
Or simple place mentally a decimal sign between 9th and 10th digit from the right. Ballpark figure, it's usually good enough for those things.

If you want to move to scripting, plenty of solutions around to fix it there.

Re: Disk size in bytes ???

Posted: Wed Nov 29, 2023 6:42 pm
by mkx
Divide the number 3 subsequent times by 1024, a bit of free mental training :)
Now days every disk manufacturer uses decimal "human readable" prefixes ... it makes "human readable" number higher (roughly by 7.4% when talking about Giga bytes). And in modern times there are even different prefixes for "binary" multipliers (210=1024), they are "decimal" prefix + 'i' ... e.g. 300GB=279.4GiB .

So the correct number is actually according to this suggestion:
simple place mentally a decimal sign between 9th and 10th digit from the right
https://simple.wikipedia.org/wiki/Gibibyte

Re: Disk size in bytes ???

Posted: Wed Nov 29, 2023 7:00 pm
by aboulfad
I wanted to confirm that there is no user configurable settings to display in -h fashion in CLI, and I think that point was confirmed.