Tuesday, September 30, 2014

Deleting unnecessary osimages

To get the list of all images use the following and then decide which you don't want to keep around:
lsdef -t osimage
To delete images that you don't need use the following command:
rmdef -t osimage -o <imageName>

xCAT 2.8.5 stateless bug

When trying to create a stateless xCAT image using the following commands:
  1. genimage centos6.5-x86_64-netboot-compute
  2. packimage centos6.5-x86_64-netboot-compute
  3. nodeset n1 osimage=centos6.5-x86_64-netboot-compute
The following error appears when trying to boot the node:
dracut: FATAL: No or empty root= argument
dracut: Refusing to continue
/lib/dracut-lib.sh: line 101: /emergency/01-die.sh: No such file or directory
dracut Warning: Signal caught! (when trying to boot the machine).
The problem is that there is a directory missing, it was skipped by xCAT installation for some reason, therefore, we need to create it manually:
  1. cd /opt/xcat/share/xcat/netboot
  2. ln -s ../rh/dracut dracut
Repeat the three commands above and you all set to go ! 

Modify partitioning in xCAT's images

To modify the partition layout, edit /opt/xcat/share/xcat/install/scripts/pre.rh at line 274:
vi /opt/xcat/share/xcat/install/scripts/pre.rh
echo "part /boot --size 256 --fstype $BOOTFSTYPE --ondisk $instdisk" >> /tmp/partitioning
echo "part swap --recommended --ondisk $instdisk" >> /tmp/partitioning
echo "part / --size 1 --grow --ondisk $instdisk --fstype $FSTYPE" >> /tmp/partitioning

Save history immediately

To force bash to save each command you type instead of waiting for the session to terminate, edit .bash_profile that is located in your home directory:
vi ~/.bash_profile
export PROMPT_COMMAND='history -a'

Don't store specific commands in history

To force bash not to save duplicate commands, edit .bash_profile that is located in your home directory:
vi ~/.bash_profile
export HISTCONTROL=ignoredups
To force bash not to save lines that start with a space, edit .bash_profile that is located in your home directory:
vi ~/.bash_profile
export HISTCONTROL=ignorespace
To force bash not to save both(space and duplicates), edit .bash_profile that is located in your home directory:
vi ~/.bash_profile
export HISTCONTROL=ignoreboth

Increase history size limit

To increase your history size limit, edit .bash_profile that is located in your home directory:
vi ~/.bash_profile
export HISTSIZE=
export HISTFILESIZE=

Disable IPv6 on CentOS 6

To disable IPv6 on CentOS 6, run the following commands:
echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'NETWORKING_IPV6=no' >> /etc/sysconfig/network