Hi,
I have created my swap file using the command:
dd if=/dev/zero of=/fedora.swap bs=1M count=12288 status=progress
So this should produce a 12 GB file right ?
I can confirm it does:
$ ls -lh /fedora.swap -rw-------. 1 root root 12G Nov 27 20:23 /fedora.swap
So why is the swap memory in my system reported as 11 GB by the free command ?
$ free -h total used free shared buff/cache available Mem: 7.7Gi 1.4Gi 4.5Gi 394Mi 1.8Gi 5.6Gi Swap: 11Gi 0B 11Gi
Why is it 11 GB ? Shouldn't it be 12 GB ?
Am I missing something?
What is the reason for this?
On Fri, 27 Nov 2020, 10:58 pm Jorge Fábregas, jorge.fabregas@gmail.com wrote:
Did you:
# mkswap /fedora.swap # swapon /fedora.swap
Yes.
On Fri, Nov 27, 2020 at 11:13 PM Jorge Fábregas jorge.fabregas@gmail.com wrote:
What does the following commands show?
# free --giga
total used free shared buff/cache available Mem: 8 1 4 0 2 5 Swap: 12 0 12
# swapon -s
Filename Type Size Used Priority /fedora.swap file 12582908 0 -2
Why are the outputs of free -h different from free --giga ?
Regards, Sreyan Chakravarty
On 11/27/20 2:33 PM, Sreyan Chakravarty wrote:
Why are the outputs of free -h different from free --giga ?
https://searchstorage.techtarget.com/definition/gibibyte-GiB
HTH, Jorge
Thanks.
On Sat, 28 Nov 2020, 12:17 am Jorge Fábregas, jorge.fabregas@gmail.com wrote:
On 11/27/20 2:33 PM, Sreyan Chakravarty wrote:
Why are the outputs of free -h different from free --giga ?
https://searchstorage.techtarget.com/definition/gibibyte-GiB
HTH, Jorge _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
On 11/27/20 6:43 PM, Jorge Fábregas wrote:
On 11/27/20 1:31 PM, Sreyan Chakravarty wrote:
Yes.
What does the following commands show?
# free --giga
There is no point in using gigabytes, if the swap file was created as gibibytes. Unless one wants to mess with things just to get a 12 as output.
The file was created as exactly 12GiB and the available swap is probably very near 12GiB, with just a little loss caused by some metadata included in the partition.
A better suggestion would be to not use such a huge units of measurements that will obviously suffer from integer truncation. That 11 was probably a 11.9 or 11.99 or (and I bet on this) 11.999.
I would use "free --mebi" instead. The swap file was 12288 MiB. Let's see how much of that is available as swap.
Regards.
Mr. Ragusa,
Thank you very much for that suggestion.
Now I have a new topic to add to my bucket-list of things to have a better grasp of.
I am still trying to decide if I need a swap file or how small can it be, and or if I need a swap partition.
All of that is currently over my brain capacity.
I have 32 GB of fast RAM and play FreeCell pretty intensively LOL !
David Locklear Arcola, Texas, USA
A better suggestion would be to not use such a huge units of measurements
use "free --mebi"