Wednesday, December 6, 2017

Linux Performance issues - How/where to start with?


Let's talk on "how to troubleshoot or analyze performance issues in Linux". There are many a times that we find a server performing slow (specifically a Linux system ) compared to previous days or sluggish or in a worst case system responds slow i.e running a simple command such as “ls” would take more time to respond. So, at that juncture a system admin or person in charge of system would be in a dilemma on what is causing such slowness, is that the processor (CPU overloaded), or memory (high memory usage) or network (slower network channels) or disk (poor performance of disk drives) or a bug with an application or kernel. No amount of tuning would help if a hardware component is broken. Identifying bottlenecks at this point of time would need a proper analysis of system sub-components. Therefore, I came up with this page which documents simple steps/instructions/navigation which can be used to identify culprit for system slowness and later more advanced steps/commands could be used to dig further (only a few most followed commands and steps are documented here i.e native).

Thursday, October 26, 2017

Step By Step Procedure To Change Boot Device In RHEL6


If you’ve ever come across a situation where there is a need to change the boot device then this document explains a step by step procedure with screen images on how to get this done. There are situations wherein the initial boot device selected is of less capacity and later there is a need to change this to something bigger one. So there is no way to increase the size of this drive since the next block device which is usually “/dev/sda2” starts from the sector wherein the “/dev/sda1” ended (*considering installation done in default mode).  Hence, we’ve to plan to move all the boot files onto a new, bigger block device and make that as a boot device.

I’m going to document each step with screenshots in this post which would help anyone who wish to perform the job of changing the boot device.

Friday, October 13, 2017

Main Differences Between MBR & GPT


A few points about GPT(GUID Partition Table) when compared with MBR(Master Boot Record) partitioning method for hard disk drives. The GPT is the standard for laying out partitions on physical hard drives for systems running with Unified Extensible Firmware Interface (UEFI). It is a standard disk partition layout for storage devices used in a desktop or server.

Friday, October 6, 2017

Simply Services Cheat Sheet

This is a simple table which would list out commonly used services with a quick look. I’ve tried to sum-up service configuration at the basic level, so, this table would provide a quick look on packages required to start service, config files to be used, ports to be opened via firewall, command to check for syntax errors(if any) and commands to bring up service. This is not an exclusive information regarding configuring a service in Linux, but just a quick look sheet. Also note that I've tried to list out most commonly used services.

Friday, September 15, 2017

Best Practices Of Running File System Check On EXT4 Or XFS


linux dvd.png
Generally, running a file system check/repair command in Linux is expected to automatically repair at least some of the inconsistencies it finds. In some cases, severely damaged i-nodes or directories may be discarded if they cannot be repaired, hence, significant changes to the file system may occur which may result in data loss.


To ensure that unexpected or undesirable changes are not permanently made, perform the following precautionary steps:



Dry run (read-only mode)
-----------------------------------------
Most file system checkers have a mode of operation which checks but does not repair the file system. In this mode, the checker will print any errors that it finds and actions that it would have taken, without actually modifying the file system. Using "e2fsck" on EXT4 (ext family file systems) and "xfs_repair" for XFS.



Saturday, September 9, 2017

Generate E-mail Alert Whenever An User Is Added



R
ecently I came across a situation wherein there was a requirement to trigger an email alert whenever a new user is added to the system (Linux).
By default an alert would get logged in "/var/log/secure" file as and when a user is added or removed. However, I wanted a similar e-mail alert to be sent. Hence, I thought of coming up with a script to get this done. I found that this can be achieved in 2 ways as explained below (there could many other ways as well):

Thursday, January 12, 2017

Lets Automate Kdump


Kdump is a kernel crash dumping mechanism and is reliable because the crash dump is captured from the context of a freshly booted kernel and not from the context of the crashed kernel. Kdump uses Kexec to boot into a second kernel whenever system crashes. This second kernel, often called a capture kernel, boots with very little memory and captures the dump image.