3

What are the sizes of the following swap partitions?

root@pc:~# swapon -s -v
Filename                                Type            Size    Used    Priority
/dev/sda5                               partition       4192252 0       -1
/dev/sdc1                               partition       3156736 0       -2
/dev/sdb1                               partition       4194300 0       -3

What does size mean? Is it 4k blocks? Or 512byte blocks?

4

It looks like you got 3 swap partitions. to answer your question, you can type these commands:

fdisk -l /dev/sda5
fdisk -l /dev/sdc1
fdisk -l /dev/sdb1

learn more about Linux swap here

| improve this answer | |
  • In newer util-linux versions (at least 2.27.1), swapon deprecated the -s flag in favor to the --show and is also able to tell the size in Bytes; ie: swapon --show=NAME,SIZE --raw --bytes – bufh Oct 26 '16 at 8:47
8

The sizes are in kilobytes since swapon -s is equivalent to cat /proc/swaps.

If you want to see the combined swap space use free. It can sum and convert to, for example, megabytes: free -m.

| improve this answer | |
2

It is in kilobytes. 1,024 byte units.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.