6.6 Set up swap space

 < Day Day Up > 

6.6 Set up swap space

Swap space is often set up differently, depending on whether you are installing Linux on an LPAR or under z/VM. You can query your swap space by looking at the swaps file in the /proc virtual filesystem. For example, the following command shows that there is no swap space active:

    # cat /proc/swaps    Filename                        Type         Size    Used    Priority 

6.6.1 Set up swap space on an LPAR

On an LPAR, you do not have the luxury of z/VM minidisks nor virtual disks. With the Linux fdasd command, you can create a partition of just about any size for swap space. It is easiest to add this with yast during installation. However, you can always add swap space after the install is done.

6.6.2 Set up virtual disk swap space under z/VM

A conventional swap file can be set up on Linux under z/VM. However, virtual disk allows swap spaces to be part of expanded storage (memory) that can also be paged in and out by z/VM. A small Linux machine size combined with multiple smaller virtual disk swap spaces and adequate paging space seem to be accepted as the best combination that allow you to utilize your zSeries resources most efficiently.

Setting up virtual disk is perhaps trickier than setting up conventional swap space. The tasks can be divided as follows:

  • Make virtual disk space available to the z/VM system

  • Get virtual disk space on each of the z/VM user IDs

  • On Linux, set up the virtual disk as swap spaces


One expert recommends allocating the virtual disks with varying sizes (each 1.5 or 2 times as large as the next smaller disk), and using a higher priority for the smaller disks. However, we did not learn this until after the project completed, so we cannot verify how well it works.

Make virtual disk space available to the z/VM system

On the z/VM system as a whole, virtual disk space needs to be available. Then each of the Linux user IDs can get some of that space for Linux to work with.

Log on as MAINT and query the current virtual disk limits. The query vdisk syslim command may show that the system can create an unlimited amount of virtual disk. For example, the following command shows this is true; 1500000 blocks of virtual disk is in use.

    query vdisk syslim    VDISK SYSTEM LIMIT IS INFINITE,          1500000 BLK IN USE 

If you allow the creation of virtual disks by a user, then the following command queries the amount of virtual disk space available to the user.

    query vdisk userlim    VDISK USER   LIMIT IS INFINITE 

The commands SET VDISK SYSLIM INFINITE and SET VDISK USERLIM INFINITE will make these settings. However they will only be in effect for the current system IPL. Figure 6-15 shows the syntax for the SET VDISK command.

start figure

   >>--Set--.-VDISK-.--.-Syslim--.--.-Default----------------.-----------------><            '-VDSK--'  '-Userlim-'  |-Infinite---------------|                                    |             .-Blocks-. |                                    |-nnnnnnnnnn--+---------+|                                    |             '-Blks---' |                                    |-nnnnnnnM---------------|                                    '-nnnnG------------------' 

end figure

Figure 6-15: CP Set VDISK command syntax

To make these changes permanent, the command should be added to the bottom of the SYSTEM CONFIG file. Refer to 3.3.5, "Update the SYSTEM CONFIG file" on page 40 for a discussion on how it is updated.

The changes necessary to the file are in the Vdisk section of the Features Statement:

    /**********************************************************************/    /*                          Features Statement                        */    /**********************************************************************/    Features ,     Disable ,                          /* Disable the following features */       Auto_Warm_IPL ,                  /* Prompt at IPL always           */     Retrieve ,                         /* Retrieve options               */       Default 10,                      /* Default.... default is 7       */       Maximum 20,                      /* Maximum.... default is 7       */     MaxUsers noLimit ,                 /* No limit on number of users    */     Enable  ,       Clear_Tdisk ,       Set_Privclass ,                  /*    allow SET PRIVCLASS command */       LogMsg_From_File ,               /*    LOGMSG from SYSTEM LOGMSG   */     Passwords_on_Cmds ,       Autolog  no ,       Link     no   ,       Logon    no   ,     Vdisk ,         Syslim infinite    ,         Userlim infinite 

Get virtual disk space on each of the z/VM user IDs

On the Linux user ID side, there are at least two ways that virtual disk swap space can be allocated:

  1. Manually

  2. By using the SWAPGEN EXEC (written by Dave Jones, Adam Thornton of Sine Nomine Associates, and Phil Smith III of Linuxcare)

Background about the manual method is provided in Appendix F, "Creating virtual disks manually" on page 371.

The SWAPGEN EXEC is run on CMS for each virtual disk swap space that is to be used before Linux is IPLed. A listing is found in the "The SWAPGEN EXEC" on page 348. This EXEC creates the virtual disk, formats, reserves, and performs the equivalent of the Linux mkswap command, all in one VM CMS EXEC. This method is described here, since it appears both cleaner and better accepted by the z/VM and Linux on zSeries communities.

The SWAPGEN EXEC is also available on the Web:

  • http://sinenomine.net/downloads/

From CMS, before Linux is IPLed, use the SWAPGEN EXEC specifying the diagnose driver to create 10 small swap virtual disks. This can be put into your PROFILE EXEC.

Here is a sample PROFILE EXEC that defines 10 virtual disks and then queries the user that is not disconnected whether it wants to IPL Linux:

    /* Sample PROFILE EXEC for Linux */     'CP SET RUN ON'     'SWAPGEN 300 100000 (DIAG'     'SWAPGEN 301 100000 (DIAG'     'SWAPGEN 302 100000 (DIAG'     'SWAPGEN 303 100000 (DIAG'     'SWAPGEN 304 100000 (DIAG'     'SWAPGEN 305 100000 (DIAG'     'SWAPGEN 306 100000 (DIAG'     'SWAPGEN 307 100000 (DIAG'     'SWAPGEN 308 100000 (DIAG'     'SWAPGEN 309 100000 (DIAG'     'PIPE CP QUERY' userid() '| var user'     parse value user with . . dsc .     if dsc = 'DSC' then       startLinux = 1     else      do       say 'Do you want to IPL Linux? Y/N'       parse upper pull answer .       if answer = 'Y' then         startLinux = 1      end     if startLinux = 1 then       'CP IPL 200'     else      do       'CP SET PF11 RETRIEVE FORWARD'       'CP SET PF12 RETRIEVE'      end 

On Linux, set up the virtual disk as swap spaces

After you have installed Linux and run the SWAPGEN EXEC for each of the swap spaces, you must configure Linux to use them. This can be done two ways: with the dasd script that is provided in "The DASD script" on page 347 (not necessarily recommended for production), or by changing the boot parameters in the /etc/zipl.conf file.

Using the dasd script

The dasd script performs different operations. The feature we use is the add command. This adds the list of DASD to the available filesystems. Use the dasd script with the add parameter to add the virtual disks at addresses 300–309, and then with the list parameter to examine the new DASD:

    # dasd add 300–309    # dasd list    0200(ECKD) at (94:  0) is dasda : active at blocksize: 4096, 600840 blocks, 2347 MB    ...    021e(none) at (94:120) is dasdae : unknown    021f(none) at (94:124) is dasdaf : unknown    0300(none) at (94:128) is dasdag : unknown    0301(none) at (94:132) is dasdah : unknown    0302(none) at (94:136) is dasdai : unknown    0303(none) at (94:140) is dasdaj : unknown    0304(none) at (94:144) is dasdak : unknown    0305(none) at (94:148) is dasdal : unknown    0306(none) at (94:152) is dasdam : unknown    0307(none) at (94:156) is dasdan : unknown    0308(none) at (94:160) is dasdao : unknown    0309(none) at (94:164) is dasdap : unknown 

Notice that we have used more DASD (42) than there are letters in the alphabet. The DASD driver names the twenty-sixth DASD /dev/dasdz, and when it gets to the twenty-seventh, it begins at /dev/dasdaa. However, the SLES-8 distribution only creates nodes in the /dev/directory for twenty-six DASD. You can see above that there are no nodes.

    # ls -l /dev/dasda*    brw-rw----    1 root     disk       94,  0 Nov 5 2002 /dev/dasda    brw-rw----    1 root     disk       94,  1 Nov 5 2002 /dev/dasda1    brw-rw----    1 root     disk       94,  2 Nov 5 2002 /dev/dasda2    brw-rw----    1 root     disk       94,  3 Nov 5 2002 /dev/dasda3 

We write a quick script named mknodDASDaa to invoke the mknod command with major number 94 (DASD) and the correct minor number and file name. This adds nodes for 26 more DASD.

    # cat mknodDASDaa    #!/bin/sh    # mknodDASDaa - add 26 nodes in the /dev/ directory for additional DASD/Vdisk    let minor=104    for i in a b c d e f g h i j k l m n o p q r s t u v w y z     do      for j in ' ' 1 2 3       do         mknod /dev/dasda$i$j b 94 $minor         let minor=minor+1       done     done    chmod 660 /dev/dasda*    chgrp disk /dev/dasda* 

If you need more DASD nodes, you can either type in the above or copy the script (remember chmod +x) and run it:

    # ./mknodDASDaa 

Examine the /dev/ directory and verify that the new nodes have been created:

    # ls -l /dev/dasda*    brw-rw----    1 root     disk      94,   0  Nov 5  2002 /dev/dasda    brw-rw----    1 root     disk      94,   1  Nov 5  2002 /dev/dasda1    brw-rw----    1 root     disk      94,   2  Nov 5  2002 /dev/dasda2    brw-rw----    1 root     disk      94,   3  Nov 5  2002 /dev/dasda3    brw-rw----    1 root     disk      94, 104  Sep 4 16:04 /dev/dasdaa    brw-rw----    1 root     disk      94, 105  Sep 4 16:04 /dev/dasdaa1    brw-rw----    1 root     disk      94, 106  Sep 4 16:04 /dev/dasdaa2    brw-rw----    1 root     disk      94, 107  Sep 4 16:04 /dev/dasdaa3    ...    brw-rw----    1 root     disk      94, 203  Sep 4 16:04 /dev/dasdaz3 

You could add the swap spaces interactively using the mkswap and swapon commands. However, you will want these swap spaces to be established at boot time. Therefore, it is recommended that you back up and modify the /etc/fstab file:

    # cd /etc    # cp fstab fstab.0904    # vi fstab                     // add the following 10 swap entries    /dev/dasda1          /                    ext3       defaults             1 1    /dev/dasdb1          /opt                 ext3       defaults             1 2    /dev/domservb/domservb /domservb          ext2       defaults             1 3    /dev/domservb/mail_1   /domservb/notesdata/mail_1 ext2 defaults           1 3    /dev/domservb/mail_2   /domservb/notesdata/mail_2 ext2 defaults           1 3    /dev/domservb/translog /domservb/notesdata/translog ext2 defaults         1 3    /dev/dasdag1         swap                 swap       defaults             0 0    /dev/dasdah1         swap                 swap       defaults             0 0    /dev/dasdai1         swap                 swap       defaults             0 0    /dev/dasdaj1         swap                 swap       defaults             0 0    /dev/dasdak1         swap                 swap       defaults             0 0    /dev/dasdal1         swap                 swap       defaults             0 0    /dev/dasdam1         swap                 swap       defaults             0 0    /dev/dasdan1         swap                 swap       defaults             0 0    /dev/dasdao1         swap                 swap       defaults             0 0    /dev/dasdap1         swap                 swap       defaults             0 0    devpts               /dev/pts             devpts     mode=0620,gid=5      0 0    proc                 /proc                proc       defaults             0 0 

Before you can utilize the new swap spaces, you must load the diagnose driver with the modprobe command. You can then verify that it has been loaded with the lsmod command:

    # modprobe dasd_diag_mod    dasd(diag): DIAG discipline initializing    Sep  5 11:00:47 linuxa kernel: dasd(diag): DIAG discipline initializing    # lsmod    lsmod    Module                  Size Used by    Tainted: P    dasd_diag_mod           5768  0  (unused)    qeth                  154180  1    qdio                   33652  1  [qeth]    ipv6                  330012 -1  [qeth]    reiserfs              247952  1  (autoclean)    lvm-mod                70724  9  (autoclean)    dasd_eckd_mod          57812 20    dasd_mod               49196 23  [dasd_diag_mod dasd_eckd_mod]    ext3                   92176  1    jbd                    52916  1  [ext3]    linuxa:~ # 

You can test the changes in the /etc/fstab file for swap spaces via the swapon -a command. If all has gone well, your swap spaces should be active. Verify this by examining at the /proc/swaps file:

    # swapon -a    # cat /proc/swaps    Filename                      Type            Size   Used   Priority    /dev/dasdag1                  partition       49572  0      -1    /dev/dasdah1                  partition       49572  0      -2    /dev/dasdai1                  partition       49572  0      -3    /dev/dasdaj1                  partition       49572  0      -4    /dev/dasdak1                  partition       49572  0      -5    /dev/dasdal1                  partition       49572  0      -6    /dev/dasdam1                  partition       49572  0      -7    /dev/dasdan1                  partition       49572  0      -8    /dev/dasdao1                  partition       49572  0      -9    /dev/dasdap1                  partition       49572  0      -10 

Making the swap spaces permanent

Some of the steps you have performed so far will work for the current Linux session, but will not work across IPLs. To ensure that the swap spaces will be the same after a re-IPL (reboot), you must set the dasd diagnose driver to load, and you must set the swap device addresses to be loaded. These tasks are done with the mkinitrd and zipl commands.

A good way to ensure that the DASD diagnose driver will be loaded is to add it to the file /etc/sysconfig/kernel in the variable INITRD_MODULES, then run mkinitrd:

    # cd /etc/sysconfig/    # cp kernel kernel.orig    # vi kernel -> add    INITRD_MODULES="jbd ext3 dasd_diag_mod"    # mkinitrd    ...    - insmod jbd                 (kernel/fs/jbd/jbd.o)     - insmod ext3                (kernel/fs/ext3/ext3.o)     - insmod dasd_mod dasd=$dasd (kernel/drivers/s390/block/dasd_mod.o)     - insmod dasd_diag_mod       (kernel/drivers/s390/block/dasd_diag_mod.o)     - insmod dasd_eckd_mod       (kernel/drivers/s390/block/dasd_eckd_mod.o)    Run zipl now to update the IPL record! 

You will need to edit the file /etc/zipl.conf and run zipl to add the VDISK DASD. First back up the /etc/zipl.conf file and add devices 300–309 to the parameter line. Then run zipl:

    # cd /etc    # cp zipl.conf zipl.conf.0904    # vi zipl.conf                   //add devices 300–309    # Generated by YaST2    [defaultboot]    default=ipl    [ipl]    target=/boot/zipl    image=/boot/kernel/image    ramdisk=/boot/initrd    parameters="dasd=200-21f,300–309 root=/dev/dasda1"    ...    # zipl    building bootmap    : /boot/zipl/bootmap    adding Kernel Image : /boot/kernel/image located at 0x00010000    adding Ramdisk      : /boot/initrd located at 0x00800000    adding Parmline     : /boot/zipl/parmfile located at 0x00001000    Bootloader for ECKD type devices with z/OS compatible layout installed.    Syncing disks....    ...done 

It is now time to reboot and test your changes:

    # shutdown -r now    # exit 

When the system comes back, ssh in and verify the swap spaces are valid with the cat /proc/swaps command.

6.6.3 Turning off unneeded services

Some services on SLES-8 are running, but are probably not needed. We turned off the following six services with the chkconfig command for the duration of the project and the Domino server performed fine:

    # chkconfig atd off    # chkconfig fbset off    # chkconfig hotplug off    # chkconfig postfix off    # chkconfig smbfs off    # chkconfig xdm off 

Congratulations! At this point you should be ready to install Domino.

6.6.4 Back up your system (optional)

You may consider backing up your two system DASD at this point (200 and 201, in this example). If you were to back them up to two other DASD and your system were to become corrupted somehow, you would be able to restore your system back to its original state. You may also prefer to wait and do this step after installing Domino.

A simple REXX EXEC named copydisk can be used that invokes DDR, the DASD dump and restore program. To use the EXEC, simply supply the DASD to be copied from and to.

For example, to copy the DASD at addresses 200 and 201 to 400 and 401, the following two copydisk commands would be used:

    copydisk 200 400    Copy minidisk 200 to 400?    y    z/VM DASD DUMP/RESTORE PROGRAM    HCPDDR711D VOLID READ IS 0X0200    HCPDDR711D VOLID READ IS 0X0400    COPYING   0X0200    COPYING DATA 09/09/03 AT 12.02.09 GMT FROM 0X0200 TO 0X0400    INPUT CYLINDER EXTENTS     OUTPUT CYLINDER EXTENTS          START       STOP        START        STOP       00000000   00003337     00000000    00003337    END OF COPY    END OF JOB    copydisk 201 401    ... 

For a listing of the EXEC, see "The COPYDISK EXEC" on page 347.

 < Day Day Up > 

IBM Lotus Domino 6. 5 for Linux on zSeries Implementation
IBM Lotus Domino 6.5 for Linux on Zseries Implementation
ISBN: 0738491748
EAN: 2147483647
Year: 2003
Pages: 162
Authors: IBM Redbooks

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net