Wednesday, July 12, 2017

Adding additional swap when primary is almost full 

Scenario : Primary swap lvol2 already exists in vg00.  Now  the space is occupied with all the processes. The better way to extend the size of the swap is add another disk and create secondary swap.

Note : Reboot is must to effect the changes.

Procedure :

1) Create physical volume on disk
     # pvcreate /dev/rdsk/c1t0d0

2) Create vg directory
     # mkdir /dev/vg14

3) Create the device file for your new character device
     # mknod /dev/vg14/group c 64 0x014000

NOTE: "vgnn: nn" is the vg number in decimal, "c" = character device, "64" = driver number, "0xnn0000: nn" is the vg number in hexadecimal)

4) Create the volume group which will contain your secondary swap.
     # vgcreate /dev/vg14 /dev/dsk/c1t0d0

5) Create the logical volume for your secondary swap
     # lvcreate -L 128 /dev/vg14

6)  Verify the physical volume
      # pvdisplay /dev/dsk/c1d0d0

7) Verify the physical volume assigned to volume group
     # vgdisplay -v

8) Verify the logical volume
     # lvdisplay /dev/vg14/lvol15

9) Use SAM to declare your new secondary swap or use the command line
     # swapon /dev/vg14/lvol15

10) Verify it has been added in "/etc/fstab" when using SAM, or add it manually when using the command line.

No comments:

Post a Comment