New on LowEndTalk? Please Register and read our Community Rules.
No swap on CentOS 6 with kernel 2.6.32-754.3.5 ?
With kernel 2.6.32-754.3.5 (the latest available) swap is reduced to 4k on CentOS 6.
With the previous kernel this KVM box had 512MB swap. Swap partition is still there and functioning, it's just tiny
[[email protected]:~] fdisk -l /dev/vda ... Device Boot Start End Blocks Id System /dev/vda1 * 1 1240 9959232 83 Linux /dev/vda2 1240 1306 524288 82 Linux swap / Solaris
[[email protected]:~] cat /etc/fstab ... /dev/vda1 / ext4 defaults 1 1 /dev/vda2 swap swap defaults 0 0 ...
[[email protected]:~] grep swap /var/log/dmesg Adding 4k swap on /dev/vda2. Priority:-1 extents:1 across:4k
[[email protected]:~] free total used free shared buffers cached Mem: 510432 114600 395832 236 12608 62224 -/+ buffers/cache: 39768 470664 Swap: 4 0 4
I see the same thing on a Xen VM also.
Ideas?
Comments
I do not see the same issue.
I would unmount and remount the swap partition as it should be 512MB.
/dev/vda2 1240 1306 524288 82 Linux swap /
check the partition size?
Maybe it resized wrong.
Francisco
Why do you think that's a problem? I usually build my VM's without any swap space.
This sounds exactly like the problem I had on a Debian 9 Xen machine, and I wasn't the only one:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906992
For now I'm running the old kernel vmlinuz-4.9.0-7-686-pae
fdisk shows 524288 blocks.
Perhaps because you're 64bit? I'm 32bit.
If I reboot to the previous kernel (2.6.32-754.2.1.el6.i686)...
Then reboot to the latest kernel (2.6.32-754.3.5.el6.i686)...
I created an 80M swapfile. It also is seen as 4k.
Lots of references to swap in the 2.6.32-754.3.5 kernel changelog. Methinks someone broke something -- at least for 32bit systems.
Anyone else with a CentOS 6 32bit VM?
@sleddog swapon, swapoff?
Tried. No error, but result is 4k swap space as before.
Then tried swapon -f. No error, no change.
Using swapon -v it looks like everything is OK:
But I still have only 4k swap:
/var/log/messages...
I saw the same issue on my 32 bit install and reverted to the previous kernel, I was doing a quick update and I didn't have the time to properly diagnose.
Before I reverted, I did try adding additional swap on the regular file system using a loop back device, it also only gave me 4k.
It's probably not related since it looks like you are using less than 4Gb mem but are you using a kernel with PAE?
From your output - it doesn't look like you will have any benefits from having a swap partition. Is lack of swap actually a problem?
BTW - I noticed that you are using paravirtualized drivers. Maybe there's a quota being set by the hypervisor for that device. That's probably where I would look.
No.
Lack of swap is not a problem. Total inability to have swap is.
I think this is ruled out by the fact the swap works as expected when using the previous kernel.
Thanks for the comments.
Hmmm. I am curious about your problem. I just installed Centos 6 - 32bit using kernel 2.6.32-754.3.5 and I don't see the problem.
The only difference from what I can tell is that I am not using paravirtualization.
It's a KVM. What are you running on?
@sleddog I spun a CentOS 6 Vultr instance (KVM) in attempt to re-produce this issue but couldn't:
@sleddog - I am using a VMWare host. And I used a LVM partition for swap.
If you need swap space, your other option instead of using a partition is to use a swapfile instead. The example provided by @akb is for a swapfile. Perhaps there's an issue with paravirtualized swap partitions with KVM.
I already did this (as explained above). After 'swapon', the swapfile is also 4k. So I get a total of 8k swap...
Different kernel version. I think you're one behind. I have:
2.6.32-754.el6.i686 doesn't have the issue for me.
My bad. Launched another instance and did a yum update this time to update to the latest kernel: 2.6.32-754.3.5.el6.i686 in CentOS 6 repo before testing. Still unable to re-produce the issue:
So there's something different between Vultr KVM and my KVM provider.
I've opened a ticket with the provider asking for comment.
I have one other CentOS 6 VM, XEN virtualization (XEN PV I think), which shows the same problem.
Any providers who'd like to chime in here, experiment, and share their knowledge are welcome
Summary:
On some CentOS 6 VMs:
On Vultr, I had no swap on Debian. It might a customization on their end.
Seen and reproduced on a fresh minimal install. Appears to depend in VM platform. dediserve and brightbox vm's exhibit this issue.