Operating System - HP-UX
1834128 Members
3289 Online
110064 Solutions
New Discussion

how to reinitialize swapon with out rebooting mserver

 
SOLVED
Go to solution
Thummalu
Frequent Advisor

how to reinitialize swapon with out rebooting mserver

Hi, I have added a secondary swap swap2 in /dev/vg00 and started the swap using swapon -a command.

Now I have extended the swap2 by lvextend command. Now if I try to run swapon -a, I am getting the following message.

root% swapon -au
Enabling device paging on /dev/vg00/swap2.
swapon: /dev/vg00/swap2 is already enabled for paging.

How to reinitialize the swap.

any help is highly appreciated.

br
thummalu
10 REPLIES 10
Arunvijai_4
Honored Contributor

Re: how to reinitialize swapon with out rebooting mserver

Thummalu
Frequent Advisor

Re: how to reinitialize swapon with out rebooting mserver

Thanks Arun.

But will it be possible to force it with out rebooting the server?

br
Thummalu
Sivakumar TS
Honored Contributor

Re: how to reinitialize swapon with out rebooting mserver

Could you try swapon -f

Nothing is Impossible !
Arunvijai_4
Honored Contributor

Re: how to reinitialize swapon with out rebooting mserver

# swapon -f should do the job.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Thummalu
Frequent Advisor

Re: how to reinitialize swapon with out rebooting mserver

No,

it did not worked

root% swapon -f /dev/vg00/swap2
swapon: /dev/vg00/swap2 is already enabled for paging.

Am I missing some thing else?

Br
Thummalu
RAC_1
Honored Contributor

Re: how to reinitialize swapon with out rebooting mserver

It would not be possible. Once you turned it on and later increased the size. Reboot would do it.
There is no substitute to HARDWORK
Steven E. Protter
Exalted Contributor

Re: how to reinitialize swapon with out rebooting mserver

Shalom thummalu,

Swap changes require a boot.

Thats the way the OS works.

Sorry.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor
Solution

Re: how to reinitialize swapon with out rebooting mserver

swap space is not changeable once it has been enabled. The reason is that the structures are integrated into the kernel memory maps. If you were to use lvreduce on an active swap space, the system would likely crash when the missing space is accessed. It isn't necessary to extend a swap area, just add another swap lvol.


Bill Hassell, sysadmin
Thummalu
Frequent Advisor

Re: how to reinitialize swapon with out rebooting mserver

Hi,

Fine and thanks for the answers. I will do a reboot and check the status.

br
Thummalu
Thummalu
Frequent Advisor

Re: how to reinitialize swapon with out rebooting mserver

After reboot swap size got increased