Re: More than 2 Gb of swap



Hi,

On a system with Linux RedHat AS 3.0 (kernel 2.4.21-20.ELsmp) with an
AMD Opteron, I have got 4 GB of RAM and 8 GB of swap. These 8 GB of
swap are on only one partition.

According to the man of mkswap (The maximum useful size of a swap area
now depends on the architecture. It is roughly 2GiB on i386, PPC,
m68k, ARM, 1GiB on sparc, 512MiB on mips, 128GiB on alpha and 3TiB on
sparc64).
This rule imposes 4 partitions of 2G to have 8 GB.

I have conducted the following test:
I have disabled the swap partition and created 4 swap files of about 2
Gb each.
The snmp information for the total swap is still wrong (2 Gb instead of
8 Gb). The top stills seem to be ok.

# snmpwalk -c public -v 1 127.0.0.1 1.3.6.1.2.1.25.2.3.1.5.102
HOST-RESOURCES-MIB::hrStorageSize.102 = INTEGER: 2097151
# snmpwalk -c public -v 1 127.0.0.1 1.3.6.1.2.1.25.2.3.1.6.102
HOST-RESOURCES-MIB::hrStorageUsed.102 = INTEGER: 146528

# cat /proc/swaps
Filename Type Size Used
Priority
/sysout/test_swap1 file 1999992 146500 -2
/sysout/test_swap2 file 1999992 0 -3
/sysout/test_swap3 file 1999992 0 -4
/sysout/test_swap4 file 1999992 0 -5

Top:
Swap: 7999968k av, 145484k used, 7854484k free 2384872k cached

I assume that information given by 'top' is correct while information
given by snmp is wrong. Moreother, I assume that contrary to the man of
mkswap, I can use a swap partition of more than 2 Gb. If you have
contrary information, I'm interested in.

Sylvain

.



Relevant Pages

  • Re: [opensuse] Swap Software RAID 1 not working, SuSE 10.3
    ... I do notice I do have swap space detected when I use ... didn't have to go raid 0 in order to fix this problem and now it works ... physical drives to make up multiple raid arrays, if my swap partition ... I have 3 G of RAM and I rarely use any swap on disk, ...
    (SuSE)
  • Re: dumpon to an encrypted swap partition?
    ... The swap partition is encrypted by its /etc/fstab entry, ... I am getting sporadic kernel panics on reboot, ... Cannot dump. ...
    (freebsd-hackers)
  • Re: Newbie Question About Swap Partition
    ... My swap partition is set to approximately double the RAM ... Think of swap as 'emergency memory' which the system can ...
    (comp.os.linux.setup)
  • Re: hibernate and swap partition size (newbie question)
    ... > able to hibernate/suspend to disk properly, the swap partition has to ... > be big enough to hold all of the RAM inside it, ... shut down without properly taking care of nvidia, so that is why I had ...
    (Debian-User)
  • Re: Gparted resize linux swap partition
    ... I wanted to try Ubuntu. ... partition during initial installation. ... I thought I was specifying 2Gb of swap, ... Ubuntu be aware of the newly shrunk swap partition WITHOUT reinstalling ...
    (Ubuntu)