Operating System - HP-UX
1833776 Members
2184 Online
110063 Solutions
New Discussion

How to change primary swap lvol?

 
SOLVED
Go to solution
Kenneth Platz
Esteemed Contributor

How to change primary swap lvol?

Hello everyone,

I've got a rp7420 server (configured as a vPar) where the original admin seriously underconfigured the amount of swap space on here, and I'd like to just go ahead and create a new swap volume and set that to be the system's primary swap/dump device.

So I've gone ahead and done an lvcreate (with the -C y and -r n options), swapon'ed the new device, and now I'm trying to do an lvlnboot to set the new swap device, and it gives me:

[/] root@sedan #lvlnboot -v -s /dev/vg00/lvswap
lvlnboot: A Logical Volume has already been assigned
to be the Root or Swap Logical Volume.

How do I get around this?
I think, therefore I am... I think!
4 REPLIES 4
Victor BERRIDGE
Honored Contributor

Re: How to change primary swap lvol?

Hi,
I believe there is no alternative other than using ignite if its /dev/vg00/lvol2 you want to change (lvlnboot...) but there is nothing stopping you to in /etc/fstab assign /dev/vg00/lvswap ... swap pri=1 0 0

Here is a sample:
# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4000 0 4000 0% 0 - 1 /dev/vg00/lvol2
dev 4064 0 4064 0% 0 - 1 /dev/s4vg01/lvol2
reserve - 418 -418
total 8064 418 7646 5% - 0 -


All the best
Victor
Steven E. Protter
Exalted Contributor

Re: How to change primary swap lvol?

I believe you can establish a new swap area.


Then you can use the same utility to delete the old one.

Then you can use lvremove to remove the old one.

This will require at least one boot of your system.

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
golfnut
Frequent Advisor
Solution

Re: How to change primary swap lvol?

I am working on exactly the same problem.

Here is the procedure I found on the net..


*****************************************


#

As root, use SAM to create a new contiguous /swap volume of the required size, for example, 300 MB. Name the new volume /dev/vg00/swap.
#

Using SAM, verify that there is no bad block relocation and the new /swap volume is contiguous.
#

As root from a console window, remove and add primary swap and dump devices:

1.

Remove the current dump device:

lvrmboot -v -d lvol2 /dev/vg00
2.

Add a new dump device:

lvlnboot -d /dev/vg00/swap
3.

Remove the current swap device:

lvrmboot -s /dev/vg00
4.

Add a new swap device:

lvlnboot -s /dev/vg00/swap

#

Verify your change:

lvlnboot -v

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

#

If your changes are correct, reboot the system.
#

After the system reboots, view swap information:

swapinfo

Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 307200 45936 216208 0% 0 - 1 /dev/vg00/swap
reserve - 113748 -113748
memory 85584 23492 62092 27%

#

To verify that the same configuration exists as before the reboot, enter (again):

lvlnboot -v
#

As root, use SAM to remove the old lvol2 entry from /dev/vg00.


********************************************


Here is the problem I am having...


ux01adm01.newcorp.com:0-hptest-root $ lvlnboot -d swap /dev/vg00
lvlnboot: Logical Volume "/dev/vg00/swap" must be contiguous.


How do i make sure it is contiguous?
Does not look like sam has any options for that..
thank

Steve White_7
Advisor

Re: How to change primary swap lvol?

The primary swap has to be within the first 4 GB of the disk. The only way I know to permanently fix this is to rebuild the system from an ignite recovery.

The fact that the swap is too small is not that big of a deal anymore. HPUX v11 only performs a dump of active memory now a days.

I would just add that second swap device as a priority 1 instead of pri 0.