SWAP DISK 301 Disappears After zVM Guest Logoff

Hello all,
I’m using the shareware SWAPGEN EXEC to create two swap disks (300 & 301) for my SUSE 11 SP3 guest. First of all during installation both disks are listed as formatted but only the 300 retains a mount point of swap . I have to mkswap for the 301 and then add the following line to /etc/fstab ==> /dev/disk/by-path/ccw-0.0.0301-part1 swap swap defaults 0 0
If I reboot the system the swap disk stays intact. Once I log the guest off it’s gone.

Does anyone know how to make this permanent?

On 08/11/2013 03:14 PM, mcginlej wrote:[color=blue]

Hello all,
I’m using the shareware SWAPGEN EXEC to create two swap[/color]

Why are you using this tool vs. the system’s built-in methods for managing
swap disks/files?
[color=blue]

disks (300 & 301) for my SUSE 11 SP3 guest. First of all during[/color]

Are these both for the same virtual machine, or for different machines?
What virtualization environment are you in (Xen, KVM, VMware, VirtualBox,
etc.)?
[color=blue]

installation both disks are listed as formatted but only the 300 retains
a mount point of swap . I have to mkswap for the 301 and then add the
following line to /etc/fstab ==> /dev/disk/by-path/ccw-0.0.0301-part1
swap swap defaults 0 0[/color]

Yes, you should always have this present in /etc/fstab so that things
auto-mount on startup. If you do not then nothing is guaranteed to work
automatically when booting.
[color=blue]

If I reboot the system the swap disk stays intact. Once I log the guest
off it’s gone.[/color]

I do not understand this. What does “log the guest off” mean?

Good luck.

Hi ab,
The Linux system runs as a guest under IBM z/VM. IBM recommends running a SWAPGEN EXEC that creates virtual swap disks 300 & 301. It has been in their documentation for SUSE & RedHat z Linux for some time. So how it works is you log onto the Linux zVM id and a profile executes that sets up the virtual machine including the swap disks. Then the SUSE Linux boots and runs in that virtual machine. You can run as many Linux guests as your hardware can accommodate under VM.

So the first time I log on and boot the system I have a virtual 300 swap disk mounted but the virtual 301 is active but not mounted. I have to manually mkswap & swapon before it comes available. If I reboot from PuTTY SSH session the 301 is active and available. If I shutdown -h now the system shuts down and the z/VM id is logged off so the virtual 300 & 301 goes away. When I log on both swap disk are defined (By the SWAPGEN EXEC) but only the 300 is usable.

Does that make sense?

Jamie

Hi Jamie,

Did you try to issue the dasd_configure command for the 301 disk? The command is ‘dasd_configure 0.0.0301 1 0’. dasd-configure adds udev rules so that Linux knows about devices that should be online.

I also support SLES running under z/VM but don’t understand why you would want to have 2 virtual swap disks. You guest is swapping to memory so 1 virtual swap disk should be all that is needed. I configure most of my guests with a virtual swap disk as well as a physical disk.

Harley

I agree with you regarding having 1 swap disk. We are fairly new with Linux and have been sticking with the IBM Cook Books which suggest having the 2 swap disks. The odd thing is if I make both swap disks 256MB we’re ok. If one or both are 512MB we’re not ok. I have work with Mainframe VM a long time so I normally do not give up sorting problems out until I resolve them.

I did try the dasd_configure command and the second swap disk remained unused. The only way I can make a second 512MB swap disk work is by issing the mkswap command. After I issued the dasd_configure command I shutdown, logged off then on:

susedev3:~ # free -m
total used free shared buffers cached
Mem: 2001 560 1441 0 13 170
-/+ buffers/cache: 376 1625
Swap: 253 0 253
susedev3:~ # swapon -a
swapon: /dev/dasdc1: swapon failed: Invalid argument
susedev3:~ # lsdasd
Bus-ID Status Name Device Type BlkSz Size Blocks

0.0.0100 active dasda 94:0 ECKD 4096 2347MB 600840
0.0.0300 active dasdb 94:4 FBA 512 256MB 524288
0.0.0301 active dasdc 94:8 FBA 512 512MB 1048576
0.0.0101 active dasdd 94:12 ECKD 4096 2347MB 600840
0.0.0102 active dasde 94:16 ECKD 4096 2347MB 600840
0.0.0103 active dasdf 94:20 ECKD 4096 2347MB 600840
0.0.0104 active dasdg 94:24 ECKD 4096 2347MB 600840
0.0.0105 active dasdh 94:28 ECKD 4096 2347MB 600840
0.0.0106 active dasdi 94:32 ECKD 4096 2347MB 600840
0.0.0107 active dasdj 94:36 ECKD 4096 2347MB 600840
0.0.0108 active dasdk 94:40 ECKD 4096 2347MB 600840
0.0.0109 active dasdl 94:44 ECKD 4096 2347MB 600840
susedev3:~ # swapon -s
Filename Type Size Used Priority
/dev/dasdb1 partition 259960 0 -1
susedev3:~ # mkswap /dev/dasdc1
Setting up swapspace version 1, size = 519924 KiB
no label, UUID=09cc7def-8bdd-406f-85c0-5f43d3f177f4
susedev3:~ # swapon -a
susedev3:~ # swapon -s
Filename Type Size Used Priority
/dev/dasdb1 partition 259960 0 -1
/dev/dasdc1 partition 519924 0 -2
susedev3:~ #

Unless you have any other ideas we’re going to run with one swap disk for now and figure this out when we have more time.

Thanks,

Jamie

Harley,
I searched the Internet for the invalid argument message and found someone who had problem with SWAPGEN EXEC going from SLES 11 SP1 to SP2. I know we got the EXEC off of an SLES install disk and it may have been from SLES 9 or 10. I went to the author’s website and downloaded the latest version SWAP1308.VMARC and that one worked! Apparently the SWAPGEN (VERSION gave a 2008 date and was an old EXEC.

Thanks for your help,

Jamie