Operating System - HP-UX
1753464 Members
4820 Online
108794 Solutions
New Discussion юеВ

Re: remove swap, i think secondary

 
SOLVED
Go to solution
MSwift
Regular Advisor

remove swap, i think secondary

Here is the swapinfo -atm
swapinfo -atm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 12000 0 12000 0% 0 - 1 /dev/vg00/lvol10
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
reserve - 3306 -3306
memory 6289 958 5331 15%
total 22385 4264 18121 19% - 0 -

Here is the lvlnboot -v

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c0t6d0 (0/0/0/3/0.6.0) -- Boot Disk
/dev/dsk/c0t5d0 (0/0/0/3/0.5.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c0t6d0
/dev/dsk/c0t5d0
Root: lvol3 on: /dev/dsk/c0t6d0
/dev/dsk/c0t5d0
Swap: lvol10 on: /dev/dsk/c0t6d0
/dev/dsk/c0t5d0
Dump: lvol10 on: /dev/dsk/c0t6d0, 0

In the /etc/fstab the lvol10 line is commented.

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/lvol2 ... swap defaults 0 0
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2
/dev/vg00/lvol6 /opt vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
/dev/vg00/lvol9 /var/adm/crash vxfs delaylog 0 2
#/dev/vg00/lvol10 ... swap pri=0 0 0

I want to remove the swap on lvol10, but keep lvol2. Please let me know the procedure for doing this. If i try to remove that lvol and it says to use lvrmboot -s to remove the swap. Please advise!

Thanks

Mike.
16 REPLIES 16
Michal Kapalka (mikap)
Honored Contributor

Re: remove swap, i think secondary

hi,

you allready uncomented the swap, that you like to remove, if you rebooted the server after uncommenting the line in /etc/fstab

just simple use lvremove for removing of the lvol10.

mikap
James R. Ferguson
Acclaimed Contributor

Re: remove swap, i think secondary

Hi Mike:

If you want to remove a secondary swap device and you are not running 11.31 (with 'swapoff') then you must do the following:

1. Remove the '/etc/fstab' secondary swap entry.
2. Reboot
3. lvremove [the secondary swap device --- /dev/vg00/lvol10 in this case'

You don't need to do 'lvrmboot -s' since this isn't a primary swap device. Only '/dev/vg00/lvol2' is that.

Currenly, 'lvol10' is in use. You might want to add such secondary device swap to another volume group. Adding secondary swap doesn't require a reboot. Simply use 'swapon' to activate it once added and remember to update your '/etc/fstab' so that it is activated again on subsequent reboots.

Regards!

...JRF...
Regards!

...JRF...
Shailendran V Naidu
Frequent Advisor

Re: remove swap, i think secondary

You cannot disassociate the swap space without rebooting the server.

Your secondary swap has been disassociated upon next reboot.

All you need to do is:

Reboot the server
lvremove /dev/vg00/lvol10
MSwift
Regular Advisor

Re: remove swap, i think secondary

Thanks JRF!

i saw the comment in the fstab and the server was rebooted yesterday, so i was not sure why lvremove was not working on lvol10, (asking for lvrmboot -s), rebboting again now (just the comment again in fstab). Will let you all know

Thanks

Mike.
Michal Kapalka (mikap)
Honored Contributor

Re: remove swap, i think secondary

hi,

sorry my misteake,

comment instead of uncomment.

mikap
MSwift
Regular Advisor

Re: remove swap, i think secondary

OK the server rebooted..but the same issue !
# swapinfo -atm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 12000 0 12000 0% 0 - 1 /dev/vg00/lvol10
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
reserve - 200 -200
memory 6289 96 6193 2%
total 22385 296 22089 1% - 0 -
#lvremove /dev/vg00/lvol10
Couldn't remove Logical volume "/dev/vg00/lvol10"
You must lvrmboot -s before removing a swap device.
#uptime
2:08pm up 9 mins, 1 user, load average: 0.25, 0.20, 0.10
# 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/lvol2 ... swap defaults 0 0
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2
/dev/vg00/lvol6 /opt vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
/dev/vg00/lvol9 /var/adm/crash vxfs delaylog 0 2
#/dev/vg00/lvol10 ... swap pri=0 0 0

Not sure what is wrong!

Thanks

Mike
Patrick Wallek
Honored Contributor

Re: remove swap, i think secondary

Judging by your 'lvlnboot' output, it appears that your /dev/vg00/lvol10 swap space is actually your primary swap.

What you would need to do is make /dev/vg00/lvol2 you primary swap space, via lvlnboot commands, and then reboot so that lvol10 is not used.
Patrick Wallek
Honored Contributor

Re: remove swap, i think secondary

I would try doing:

# lvlnboot -s /dev/vg00/lvol2

Then do an 'lvlnboot -v' to see if the swap lines changed from:

Swap: lvol10 on: /dev/dsk/c0t6d0
/dev/dsk/c0t5d0

to:

Swap: lvol2 on: /dev/dsk/c0t6d0
/dev/dsk/c0t5d0
James R. Ferguson
Acclaimed Contributor

Re: remove swap, i think secondary

Hi (again) Mike:

My apologies for not reading your post more carefully.

I'm not sure how or why you appear to have ended up with 'lvol10' as a primary swap.

I think you need to remove 'lvol2' from your 'etc/fstab' (since is should be the primary swap device and thus should not be listed in '/etc/fstab'). Then, I think you need to do:

# lvlnboot -s /dev/vg00/lvol2
# lvlnboot -d /dev/vg00/lvol2
# lvrmboot -s /dev/vg00/lvol10
# lvrmboot -d /dev/vg00/lvol10

...which should set 'lvol2' as your primary swap and dump device and remove 'lvol10' from that capacity.

Regards!

...JRF...