Community discussions

MikroTik App
 
aboulfad
just joined
Topic Author
Posts: 23
Joined: Sun Dec 26, 2021 2:25 pm
Location: QC

Disk size in bytes ???

Wed Nov 29, 2023 1:18 am

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                                                                                               
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11621
Joined: Thu Mar 03, 2016 10:23 pm

Re: Disk size in bytes ???

Wed Nov 29, 2023 8:31 am

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.
 
aboulfad
just joined
Topic Author
Posts: 23
Joined: Sun Dec 26, 2021 2:25 pm
Location: QC

Re: Disk size in bytes ???

Wed Nov 29, 2023 11:46 am

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).
 
holvoetn
Forum Guru
Forum Guru
Posts: 5490
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: Disk size in bytes ???

Wed Nov 29, 2023 1:09 pm

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.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11621
Joined: Thu Mar 03, 2016 10:23 pm

Re: Disk size in bytes ???

Wed Nov 29, 2023 6:42 pm

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
 
aboulfad
just joined
Topic Author
Posts: 23
Joined: Sun Dec 26, 2021 2:25 pm
Location: QC

Re: Disk size in bytes ???

Wed Nov 29, 2023 7:00 pm

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.

Who is online

Users browsing this forum: aboiles and 54 guests