Operating System - HP-UX
1849679 Members
7234 Online
104044 Solutions
New Discussion

Urgent! Can I allocate swap on other volume group besides root volume group?

 
Rashid Ali
Frequent Advisor

Urgent! Can I allocate swap on other volume group besides root volume group?

Anybody got an idea whether swap can be allocated on other volume group besides root volume group /dev/vg00?

Thanks in advance
9 REPLIES 9
Bill McNAMARA_1
Honored Contributor

Re: Urgent! Can I allocate swap on other volume group besides root volume group?

yes,
make sure to create the lvol with
-C y -r n
then swapon or add to /etc/fstab.

The only problem you can possibly run into is booting into maintenance modes. Apparently with systems with lots of mem, if pseudoswap id on and additional secondary swap is not activated. You cannot boot at all...

Later,
Bill
It works for me (tm)
Alexander M. Ermes
Honored Contributor

Re: Urgent! Can I allocate swap on other volume group besides root volume group?

Hi there.
Yes, you can, if you set it as secondary swap.
/dev/vg00/lvol2 /swap ignore sw,pri=1 0 1 # 2 GB Pri. Swap
/dev/vg09/lvol1 /swap swap sw,pri=2 0 1 # 2 GB Sec. Swap
/dev/vg02/lvol6 ... swap pri=3 0 0
/dev/vg16/lvol1 ... swap pri=1 0 0

This is an extract from /etc/fstab
Rgds
Alexander M. Ermes


.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Vincenzo Restuccia
Honored Contributor

Re: Urgent! Can I allocate swap on other volume group besides root volume group?

If you are using logical volumes, you may want to first attempt to extend the disk space allocated for the primary swap logical volume using the lvextend command or SAM. However, you will only succeed if disk space (physical extents) contiguous with the existing swap space is still available, which is unlikely. You must reboot the system for the changes to take effect.

If contiguous disk space is not available, you will need to create a new contiguous logical volume for primary swap within the root volume group, the volume group that contains the root logical volume. You do not need to designate a specific disk. For example:
lvcreate -C y -L 48 -r n -n pswap /dev/vgroot
After creating a logical volume that will be used as primary swap, you will need to use lvlnboot (1M):
lvlnboot -s /dev/vgroot/pswap

Vincent Stedema
Esteemed Contributor

Re: Urgent! Can I allocate swap on other volume group besides root volume group?

A few tips:

If you're going to create extra swap by hand (not via SAM), don't forget to increase the maxswapchunks kernel parameter as it determines how much swap space can actually be allocated by the system. If you add secondary swap via SAM, it will prompt you if you want to increase maxswapchunks as well.

Also, it's advisable to make your secondary swap equally big as your primary swap and set the pri option in /etc/fstab to the same value. The OS will then alternately swap to your secondary and primary swap space, which is good for performance if the disks aren't connected to the same SCSI bus.

Regards,

Vincent
Rasika Wije
Occasional Advisor

Re: Urgent! Can I allocate swap on other volume group besides root volume group?

Yes You can set up "secondary" swap on volume groups other than vg00.
The only catch is that you will not be able to use this space as the "dump" space
MANOJ SRIVASTAVA
Honored Contributor

Re: Urgent! Can I allocate swap on other volume group besides root volume group?

Hi Zhao

Please try using SAM , it will do the operation perfectly , if you are not confident doing it from the command line and it is very easy too. Incase you have ONLINE JFS installed then you can do it w/o rebooting the machine.


Manoj
Rashid Ali
Frequent Advisor

Re: Urgent! Can I allocate swap on other volume group besides root volume group?

Thank you so much for your advices. I managed to create a secondary swap on volume group other than root VG. Here it is.
#swapinfo -tm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 704 0 704 0% 0 - 1 /dev/vg00/lvol2
dev 704 0 704 0% 0 - 1 /dev/vg13/lvol4
reserve - 546 -546
memory 765 516 249 67%
total 2173 1062 1111 49% - 0 -
But, From lvlnboot I noticed that this secondary swap was not assigned as dump.
Does it mean dump can only reside within root VG? There is some restriction such as swap/dump must be within first 2GB of physical volume. Is that true?

Regarding priority of swap, I run sam to check that the priority of both primary/secondary are set to 1. But how come there is the difference in the following?
# grep swap /etc/fstab
/dev/vg00/lvol2 swap ignore sw 0 0
/dev/vg00/lvol2 ... swap pri=1 0 2 #why 2?
/dev/vg13/lvol4 ... swap pri=1 0 0

Thanks,


Bill Hassell
Honored Contributor

Re: Urgent! Can I allocate swap on other volume group besides root volume group?

> Does it mean dump can only reside within root VG?

In the shared design, that is correct. Shared means that swap is also used as a dump area. The use of dump space is quite different on 11.0 however.

> Regarding priority of swap, I run sam to check that the priority of both primary/secondary are set to 1. But how come there is the difference in the following?

> # grep swap /etc/fstab
> /dev/vg00/lvol2 swap ignore sw 0 0
> /dev/vg00/lvol2 ... swap pri=1 0 2 #why 2?
> /dev/vg13/lvol4 ... swap pri=1 0 0

SAM has had an annying habit of creating meaningless backup and fsck pass numbers for swap areas. swap areas are normally raw partitions--there is no filesystem. The pri=1 is all there is for swap areas. The rest of the numbers are ignored.


Bill Hassell, sysadmin
Rashid Ali
Frequent Advisor

Re: Urgent! Can I allocate swap on other volume group besides root volume group?

The fact that dump cannot reside on other VG except Root VG does not allow dump to share disk space with secondary swap when the swap is on VG other than root VG. Thus I am getting the warning message "WARNING: Insufficient space on dump device to sav
e full crashdump." Previous, dump was sharing space with secondary swap(220MB) on root VG. But the sufficient contiguous space is not available. What can I do?
Is there any way to move a disk from one VG into another VG such as root VG?