The "rescan-scsi-bus.sh" can be used to scan new LUNs in a CentOS/RHEL machine. When 'rescan-scsi-bus.sh -i' is run, script execute as well a LIP_RESET (ISSUE_LIP) which may cause a disruption in I/O on the server and even cause an outage in case of a system running on heavy load. What is LIP (Loop Initialization Protocol)? LIP scans the interconnect and causes the SCSI layer to be updated to reflect the devices currently on the bus. A LIP is, essentially, a bus reset, and will cause device … [Read more...] about When to use rescan-scsi-bus.sh -i (LIP flag) in CentOS/RHEL
CentOS/RHEL 7
How to Disable rpc.quotad Service in CentOS/RHEL 6 and 7
This post explains how to disable rpc.quotad service on CentOS/RHEL 6 or 7 machines. The protocol used by rpc.rquotad is an unsecured and obsolete protocol and should be disabled. Note: This procedure can disrupt NFS clients relying on disk quotas. To avoid issues, schedule a maintenance outage and stop these NFS clients. For CentOS/RHEL 6 or earlier 1. Edit the configuration file /etc/sysconfig/nfs to have an entry which reads RQUOTAD="no". For example: # grep RQUOTAD … [Read more...] about How to Disable rpc.quotad Service in CentOS/RHEL 6 and 7
How to Recover from a Corrupted or empty /etc/mtab file in CentOS/RHEL 7
Sometimes you may get an error while running the df command saying that tat the /etc/mtab file is either corrupt or empty(removed). It may be a case that someone accidentally edited the /etc/mtab file and has incorrect data. Well, this post will help you restore your correct mtab file. What is the use of /etc/mtab file Before we begin let's see what an mtab file is. /etc/mtab is the file that maintains a list of currently mounted filesystems. So when you run a "df" command, it referes to … [Read more...] about How to Recover from a Corrupted or empty /etc/mtab file in CentOS/RHEL 7
CentOS/RHEL : Unmounting a Windows Share Fails – “device is busy”
The Problem Unable to unmount a Windows share mount point using umount command. This Windows share is not being used by any processes recently. When executing umount command, the following error is seen; umount: /data01: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) The Solution The error 'umount: device is busy' means that the mount point is being held up by the server due to some reason. An lsof command is executed … [Read more...] about CentOS/RHEL : Unmounting a Windows Share Fails – “device is busy”
How to Set CPU Affinity for SYSTEMD Process in CentOS/RHEL 7
CPUAffinity is one of the directives to control the CPU affinity of the systemd executed processes. from the man page of systemd.exec: # man systemd.exec CPUAffinity= Controls the CPU affinity of the executed processes. Takes a list of CPU indices or ranges separated by either whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a dash. This option may be specified more than once in which case the specified CPU affinity masks are merged. If … [Read more...] about How to Set CPU Affinity for SYSTEMD Process in CentOS/RHEL 7
How to verify if NX/XD is Enabled or Disabled in CentOS/RHEL 7 and 8
NX stands for No eXecute and XD stand for eXecute Disable is a technology used in processors to prevent the execution of certain types of code. NX/XD is a hardware cpu feature which is provided in almost all the hardware. Some BIOS has an advanced option of enabling or disabling it. This post will help to check NX/XD the feature is enabled or disabled. Use the following command to check the status of NX/XD from the OS level. For example: 1. From dmesg command: # dmesg | grep "Execute … [Read more...] about How to verify if NX/XD is Enabled or Disabled in CentOS/RHEL 7 and 8
How to Set Environment Variables for a systemd Service in CentOS/RHEL 7
Question: How to do set environment variables for use with a systemd service of MySQL Server? There are a number of different methods that can be used to set environment variables for a systemd service. The method used can vary depending on the Linux distribution and the version of the distribution. The MySQL manual states the service setup is done simply as (example only): [Service] LimitNOFILE=max_open_files PIDFile=/path/to/pid/file Nice=nice_level LimitCore=core_file_limit Method … [Read more...] about How to Set Environment Variables for a systemd Service in CentOS/RHEL 7
How to Set Resource Limits for a Process with Systemd in CentOS/RHEL 7 and 8
Some specific applications or processes may need higher resource values than the default systemd assigned values. It's possible to override the default resource limits assigned by systemd. Basically systemd sets the default limits for any process when it starts. For example: # cat /proc/1696/limits | grep "Max locked memory" Max locked memory 65536 65536 bytes From the above example, the Max Locked memory is 64K for the PID 1696, and for some process … [Read more...] about How to Set Resource Limits for a Process with Systemd in CentOS/RHEL 7 and 8
How to add a Custom Script to systemd in CentOS/RHEL 7
The systemd facility replaces the older System-V initialization scripts from earlier releases. The systemd is an event-driven facility which allows non-dependent subsystems to be started, controlled, or stopped in parallel. Here we explain how to add a custom script to the systemd facility. 1. Write And Debug The Custom Script Typically a systemd script is written as a shell script. Begin by writing your custom script using the normal conventions. We will call our script my-custom-script.sh … [Read more...] about How to add a Custom Script to systemd in CentOS/RHEL 7
How to Configure GNOME Console Login Banner in CentOS/RHEL 7 and 8
Question: How to set the banner shown as part of a console in CentOS/RHEL 8? GNOME console banner is a screen with a certain message that is shown before any user logins into the system using his/her login credentials. Login is performed by the Gnome Display Manager (GDM) tool. The steps to configure the GNOME login screen banner are outlined below. All steps are performed as the root user. 1. Create the GDM profile (if it doesn't exist) in /etc/dconf/profile/gdm which contains the … [Read more...] about How to Configure GNOME Console Login Banner in CentOS/RHEL 7 and 8