Re: swapon reports wrong swapsize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 16 Feb 2010, Karel Zak wrote:

The number from /proc/swaps is in KiB. The swapsize= from swapon
verbose message is a size calculated from the 'lastpage' field from
swap header.

Hi Karel,

I'm not worried by a discrepancy of a few pages, but rather by a factor of
two.  To be on the safe side I just did this:

  # swapoff -av
  swapoff on /dev/sda2
  # mkswap /dev/sda2
  Setting up swapspace version 1, size = 7823648 KiB
  no label, UUID=ed23d244-73d6-4c8f-b1a2-25659c15e73b
  # swapon -av
  swapon on /dev/sda2
  swapon: /dev/sda2: found swap v1 signature string for 4 KiB PAGE_SIZE

  swapon: /dev/sda2: pagesize=4096, swapsize=3716452352, devsize=8011422720
  # cat /proc/swaps
  Filename                                Type            Size    Used    Priority
  /dev/sda2                               partition       7823644 0       -1

i.e., 'mkswap' and '/proc/swaps' report a swapsize of about 8GiB whereas
'swapon' correctly reports devsize as 8GiB but swapsize as <4GiB. Why?

Regards
Peter Breitenlohner <peb@xxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux