Updated Facter 4 to show same values as diskutil, the only difference is that Facter calculates with 1024 (same as Facter 3) and diskutil uses 1000. Even with this difference the values in bytes are the same. In this example I updated the conversion to use 1000 as a multiplier.
wet-credulity:facter root# bundle exec bin/facter mountpoints./private/var/vm |
{ |
available => "28.29 GiB", |
available_bytes => 28288929792, |
capacity => "33.81%", |
device => "/dev/disk1s4", |
filesystem => "apfs", |
options => [ "noexec", "local", "nobrowse", "journaled", "noatime" ], |
size => "42.74 GiB", |
size_bytes => 42739916800, |
used => "14.45 GiB", |
used_bytes => 14450987008 |
}
|
wet-credulity:~ root# diskutil info /dev/disk1s4 |
Device Identifier: disk1s4 |
Device Node: /dev/disk1s4 |
Whole: No |
Part of Whole: disk1 |
Volume Name: VM |
Mounted: Yes |
Mount Point: /private/var/vm Partition |
Type: 41504653-0000-11AA-AA11-00306543ECAC |
File System Personality: APFS |
Type (Bundle): apfs |
Name (User Visible): APFS |
Owners: Enabled |
OS Can Be Installed: No |
Booter Disk: disk1s2 |
Recovery Disk: disk1s3 |
Media Type: Generic |
Protocol: SCSI SMART |
Status: Not Supported |
Volume UUID: EE755C0A-F3C6-4693-A6C5-B728C50495CD |
Disk / Partition UUID: EE755C0A-F3C6-4693-A6C5-B728C50495CD |
Disk Size: 42.7 GB (42739916800 Bytes) (exactly 83476400 512-Byte-Units) |
Device Block Size: 4096 Bytes |
Volume Total Space: 42.7 GB (42739916800 Bytes) (exactly 83476400 512-Byte-Units) |
Volume Used Space: 14.5 GB (14450987008 Bytes) (exactly 28224584 512-Byte-Units) (33.8%) |
Volume Free Space: 28.3 GB (28288929792 Bytes) (exactly 55251816 512-Byte-Units) (66.2%) |
Allocation Block Size: 4096 Bytes |
Read-Only Media: No |
Read-Only Volume: No |
Device Location: Internal Removable |
Media: Fixed Hardware |
AES Support: No
|
|