Posts by psm

Boot Partition Space

If your /boot partition is mounted separately , it is always a small compare to other partitions on the server. If the older kernels are not removed, then it gets full quickly.  In order to remove the older kernels safely we can use the package manager. For REHL/CentOS systems you can use below command. sudo yum install yum-utils && sudo package-cleanup --oldkernels --count=2 For the Debian and Ubuntu systems you can use below commands. First, check your kernel version, so you won’t delete the in-use kernel image, running: uname -r Now run this command for a list of installed kernels: dpkg --list 'linux-image*' | grep ^ii and delete the kernels you don’t want/need anymore by running this: sudo apt-get remove linux-image-VERSION Replace VERSION with the version of the kernel you want to remove. When you’re done removing the older kernels, you can run this to remove ever packages you won’t need anymore: sudo apt-get autoremove And finally you can run this to update grub kernel list: sudo...

Read More

Bash Cases Statement

The case construct in bash shell allows us to test strings against patterns that can contain wild card characters. Bash case statement is the simplest form of the bash if else then condition statement. The simple example for this is if you are expecting different inputs from a user and want to execute specific command sets on the choice used.     case $variable in pattern1 ) statements ;; pattern2 ) statements ;; * ) statements ;; … esac   We can see the common use of the case statement in the init scripts of the services which has the options like start, stop, restart and status.  ...

Read More