Maintaining Software Using RPM (Red Hat Package Manager) RPM is a powerful software manager which can be used to build, install, query, verify, update, and uninstall individual software packages. An RPM package consists of an archive of files, and package information such as name, version, a description and information about dependencies on other RPM packages. […]
Archives for May 2019
Volume “test_vg/lvol0” is not active locally – Error while running lvcreate
The Problem While trying to create a logical volume, lvcreate fails with error “Volume “test_vg/lvol0″ Is Not Active Locally” even though the volume group is active, with an error output such as the following: # lvcreate -L 4G test_vg Volume “test_vg/lvol0” is not active locally. Aborting. Failed to wipe start of new LV. The Root […]
Command ntpstat Shows unsynchronised (CentOS/RHEL)
The ntpstat command output shows “unsynchronised”: # ntpstat unsynchronised time server re-starting The “ntpq -p ” command output shows none of ntp servers is chosen: # ntpq -p ========================================== remote refid st t when poll reach delay offset jitter =============================================== ntp-server .INIT. 16 u – 16 0 0.000 0.000 0.000 ntp-server .INIT. 16 u – […]
How To Check Swap Usage of Each Processes in Linux
This post shows how to check swap usage of each process, answering “How can I know what process would consume the largest swap space?” For all kernels Swap usage is shown as “Swap” columns in /proc/[PID]/smaps. This indicates swapped memory size of the each memory ranges, thus the sum of all of these values shows […]
How to Check Swap Usage Live via the ‘top’ Command in Linux
Question: How to view the system-wide swap usage on a CentOS/RHEL server via the top command to identify the highest consumers. Below are the steps for CentOS/RHEL 5 and 6 which are the same, followed by CentOS/RHEL 7 as they differ on this release: NOTE: Performing this task will not cause any changes to top […]
Unable To Boot Up Linux OS with Auditd (CentOS/RHEL)
The Problem A Linux OS failed bootup, from console log we can see all goes well in the very beginning, kernel loaded and init scripts were running OK. But suddenly the Linux OS was shutting down (received TERM signal) after auditd daemon started. … dracut: Switching root mount: mount point /proc/bus/usb does not exist Welcome […]
“WARNING: Duplicate VG name [vgname]” – error while running LVM commands
The Problem LVM commands report Duplicate VG names. When vgdisplay is run to check for free space the following message is received: # vgdisplay WARNING: Duplicate VG name testvg2: Existing OEsLyZ-ueap-D66F-6LEB-BKqC-A5B1-exlfZ5 (created here) takes precedence over q7jsuu-f3f8-mVVu-HpMm-FXdK-Xe3Y-d2nVfU The Root Cause Below are a few of the changes which can cause this issue: 1. Some changes […]
How to Disable Ctrl+c or Ctrl+z Using the “trap” Command in Linux
The purpose is to disable CTRL+C or CTRL+Z interrupt for the root user or a general user account by the trap command. So basically, when the user tries to interrupt any command or script using CTRL+C or CTRL+Z, he will not be able to do so. The trap command can be used to trap these […]
How to Disable Daylight Savings Time (DST), and Modify the Timezone on Linux
Many countries do not follow DST changes, and by default, they are configured so DST time changes alter their system times and even the database times running on them. This post outlines steps to disable DST and modify the timezone on a Linux server. In this example, the time is set as per Brazil country, […]
How to disable a specific command for a specific user in Linux
Question: How to prevent a given user from being able to run a specific command. This technique uses a filesystem access control list (ACL) to prevent unwanted access. Caution: The sudo facility is not suitable for this purpose. In particular, “subtracting” an executable from the allowed ALL preset does not work as expected. The example […]