1833228 Members
2486 Online
110051 Solutions
New Discussion

Re: swap problem

 
kholikt
Super Advisor

swap problem

I have a server which give a strange message during startup

Enable auxiliary swap space
Output from "/sbin/rc1.d/S500swap_start start":
----------------------------
Enabling device paging on /dev/vg02/lvswap02.
/usr/sbin/swapon: Device /dev/vg02/lvswap02 contains a file system.
The system will page in the space after the end of the file system.
Add `end' to the options field in /etc/fstab to turn off this warning.
/usr/sbin/swapon: The kernel tunable parameter "maxswapchunks" needs to be increased to add
paging on device /dev/vg02/lvswap02.
Warning: swapon returned exit code: 1
"/sbin/rc1.d/S500swap_start start" FAILED

I have checked the maxswapchunk parameter, 8000 should be sufficient for 16GB of swap space.

The primary lvol2 swap seem to be okay. The only problem is the other swap in vg02 when I use swapon /dev/vg02/lvswap02, I will get this error

swapon: Device /dev/vg02/lvswap02 contains a file system.
Use -e to page after the end of the file system, or -f to overwrite
the file system with paging.
abc
5 REPLIES 5
John Palmer
Honored Contributor

Re: swap problem

Hi,

swapon has detected that the logical volume that you are trying to use used to contain a filesytem. This quite often happens when you reuse an area of disk.

All you have to do to override this safety feature is to run swapon with the -f (force) flag (see man 1m swapon). This will overwrite the filesystem data and you won't get the error again.

swapon -f /dev/vg02/lvswap02

Regards,
John
T G Manikandan
Honored Contributor

Re: swap problem

#swapon -f /dev/vg02/lvswap02

Then reboot the machine.
This should resolve it.

Thanks
John Palmer
Honored Contributor

Re: swap problem

As to your maxswapchunk issue, maxswapchunk set to 8000 (with swchunk at the default 2048) allows up to 16384000 Mb of swap system wide. This is not a true 16Gb which requires maxswapchunk set to 8192, (16777216Mb).

Regards,
John
Donald Kok
Respected Contributor

Re: swap problem

Hi,

you can remove an create the lv again, to get rid of the filesystem on the lv. use lvremove and lvcreate. You do not have to go to runlevel 1 since the swapdevice is not in use.

Goodluck,
Donald
My systems are 100% Murphy Compliant. Guaranteed!!!
John Palmer
Honored Contributor

Re: swap problem

There's no need to reboot the machine after swapon -f, you will if you want to increase maxswapchunks to 8192 though.

Regards,
John