cancel
Showing results for 
Search instead for 
Did you mean: 

To remove secondary swap

SOLVED
Go to solution
M.sureshkumar
Regular Advisor

To remove secondary swap

Hi All,

I want to remove secondary swap on our hpunix 11.23(ia) server.Please share the procedure.
I have attached swapinfo output.

Is it possiple to remove secondary swap without reboot ?

Regards,
Suresh.
15 REPLIES
Md. Farhan A Azam
Trusted Contributor

Re: To remove secondary swap

R.K. #
Honored Contributor

Re: To remove secondary swap

Hi Suresh,

To my knowledge we have to perform below steps:
- First remove the entry in "/etc/fstab" for "/dev/vgswap/swaplv"
- Reboot the server in order to remove this swap.

So by this way, reboot is necessary.

Thanks,
R.K.
Don't fix that what ain't broke
Johnson Punniyalingam
Honored Contributor

Re: To remove secondary swap

That's an easy 2 step process --

1) Comment out, or delete, the /dev/vg00/u0swap line in /etc/fstab

2) Reboot the machine. Upon reboot that swap area won't be mounted.

Swap can NOT be deleted without rebooting the machine. If this is something you wanted to accomplis without a reboot, then I'm sorry to tell you that you can't do it. A reboot will be required!

removing swap would require a system reboot

Good Luck !

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Md. Farhan A Azam
Trusted Contributor

Re: To remove secondary swap

Hi,

Can u post the output of below command.

#more /etc/fstab
Duncan Edmonstone
Honored Contributor

Re: To remove secondary swap

as already indicated, a reboot is required.

11iv3 (11.31) introduced the swapoff command, so it can be done without a reboot in the latest version of the OS.

HTH

Duncan

HTH

Duncan
Aneesh Mohan
Honored Contributor
Solution

Re: To remove secondary swap

Hi Duncan ,

swapoff ?? , I couldn`t find it on hpux 11.31.0803.Could you advice me .

fyi :-
# uname -a
HP-UX cmcrxsvr B.11.31 U ia64 3902920412 unlimited-user license
# swlist |grep -i oe
HPUX11i-DC-OE B.11.31.0803 HP-UX Data Center Operating Environment
# whereis swapoff
swapoff:
#

Thanks ,
Aneesh
Md. Farhan A Azam
Trusted Contributor

Re: To remove secondary swap

Hi,

If u got the solution, then plz go ahead and assign the points.
Aneesh Mohan
Honored Contributor

Re: To remove secondary swap

M.sureshkumar
Regular Advisor

Re: To remove secondary swap

Hi

Pls find fstab output.

root@app1#more /etc/fstab
# System /etc/fstab file. Static information about the file systems
# See fstab(4) and sam(1M) for further details on configuring devices.
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand vxfs tranflush 0 1
/dev/vg00/lvol4 /home vxfs delaylog 0 2
/dev/vg00/lvol5 /opt vxfs delaylog 0 2
/dev/vg00/lvol6 /tmp vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
/dev/vg00/lvdb2 /db2 vxfs rw,suid,largefiles,delaylog,datainlog 0 2
/dev/vgswap/swaplv ... swap pri=0 0 0




Regards,
Suresh
TTr
Honored Contributor

Re: To remove secondary swap

Which swap volume do you want to remove?

Traditionally lvol2 is the primary swap. But in your server swaplv is the primary and it is already in use. The lvol2 swap volume is secondary swap and it is NOT in /etc/fstab. If you reboot your server right now, lvol2 will be removed from being a swap volume and swaplv will be the only swap volume.

Before rebooting, you need to pick the volume you want to keep and adjust your fstab file if needed.
Johnson Punniyalingam
Honored Contributor

Re: To remove secondary swap

oot@app1#swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 22528 0 22528 0% 0 - 1 /dev/vg00/lvol2
dev 61408 4723 56685 8% 0 - 0 /dev/vgswap/swaplv
reserve - 25412 -25412
memory 28652 3919 24733 14%
total 112588 34054 78534 30% - 0 -


root@app1#more /etc/fstab
# System /etc/fstab file. Static information about the file systems
# See fstab(4) and sam(1M) for further details on configuring devices.
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand vxfs tranflush 0 1
/dev/vg00/lvol4 /home vxfs delaylog 0 2
/dev/vg00/lvol5 /opt vxfs delaylog 0 2
/dev/vg00/lvol6 /tmp vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
/dev/vg00/lvdb2 /db2 vxfs rw,suid,largefiles,delaylog,datainlog 0 2
/dev/vgswap/swaplv ... swap pri=0 0 0

Hi Suresh,

as per above "swapinfo" and /ets/fstab output of Yours

"swapinfo"
==========
>>/dev/vg00/lvol2<< shows is you primary swap <<<

/ets/fstab
===========

were is the /dev/vg00/lvol2 ..? entry under /etc/fstab..? does any one already removed


# lvdisplay -v /dev/vg00/lv0l2 |more -> post the output

Thanks,
Johnson






Problems are common to all, but attitude makes the difference
Aneesh Mohan
Honored Contributor

Re: To remove secondary swap

The default priority of the primary swap is "1" so in you case the primary swap is "/dev/vg00/lvol2" only .

You can comment /dev/vgswap/swaplv in /etc/fstab and do reboot .It should remove the secondary swap (/dev/vgswap/swaplv).

Thanks,
Aneesh
Aneesh Mohan
Honored Contributor

Re: To remove secondary swap

>> were is the /dev/vg00/lvol2 ..? entry under /etc/fstab..? does any one already removed ?

The primary swap /dev/vg00/lvol2 need not to add in /etc/fstab,the system will initiate swapon while booting.

Thanks
Aneesh
M.sureshkumar
Regular Advisor

Re: To remove secondary swap

Hi

Pls find lvol2 output.

root@app1# lvdisplay -v /dev/vg00/lvol2 |more
--- Logical volumes ---
LV Name /dev/vg00/lvol2
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 22528
Current LE 1408
Allocated PE 1408
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c0t0d0s2 1408 1408

--- Logical extents ---
LE PV1 PE1 Status 1
00000 /dev/dsk/c0t0d0s2 00064 current
00001 /dev/dsk/c0t0d0s2 00065 current
00002 /dev/dsk/c0t0d0s2 00066 current
00003 /dev/dsk/c0t0d0s2 00067 current
00004 /dev/dsk/c0t0d0s2 00068 current
00005 /dev/dsk/c0t0d0s2 00069 current
00006 /dev/dsk/c0t0d0s2 00070 current


Regards,
Suresh
Md. Farhan A Azam
Trusted Contributor

Re: To remove secondary swap

Hi,

Aneesh Mohan has alreday mentioned, you can comment this line in fstab file.
/dev/vgswap/swaplv ... swap pri=0 0 0
Because the priority of primary swap is 1.

Thnx...Farhan