Saturday 1 March 2014

Resize swap memory in linux

We needed to to increase swap memory for one of our client who was using SUSE linux. There are two methods to overcome this and we used the following method.

Switch off swap

swapoff -a
First create a file named myswapfile and in this command count=1024 means 1GB so forexample our client needed swap memory of 44GB so we change count=45056

dd if=/dev/zero of=/root/myswapfile bs=1M count=1024
after file is created change the permission to root only

chmod 600 /root/myswapfile
enable the newly created swap

swapon /root/myswapfile
Add the following enteries in the fstab to keep the swap space after reboot

cat /etc/fstab /root/myswapfile swap           swap    defaults        0 0
after entry to make sure new swap is used:

swapoff -a

swapon -a
then verify using the top command. Hope it helps !


Ref: http://www.thegeekstuff.com/2010/08/how-to-add-swap-space/

VNC server idle timeout SUSE Linux

Recently one of our client using OpenSUSE VM had issues in using VNC viewer for installation of some software and he was facing logout issue when the system was idle. (Although this is good in terms of security but on his request we needed to switch off this feature)

There were several ways but we needed to resolve this quickly so following changes were made.


go to vi /etc/xinetd.d/services

Change the wait parameter from NO to YES

Session out issue resolved! 

VMware Guest VM Disk size greater than 2TB

Recently we needed to give our client a VM and additional disk of around 7TB. Issue that we were facing was when adding a disk of 7TB we were getting following errors:

Hot-extend was invoked with size (*** sectors) > =2TB. Hot-extend beyond or equal to 2TB is not supported. This disk extend operation failed: msg.disklib.INVAL

To resolve the issue power off the Virtual Machine and then retry the drive extend operation.

Or detach it from the Virtual machine it is connected to and then attach to a virtual machine that is powered off and perform the re-size operation.

Hope it solves the issue!.