Setting up mdraid array $ mdadm --create /dev/md0 --name=mdvol --level=raid0 --raid-devices=2 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 mdadm: Defaulting to version 1.2 metadata mdadm: a...
Linux Software RAID
What is RAID? RAID stands for either Redundant Array of Independent Disks, or Redundant Array of Inexpensive Disks. The intention of RAID is to spread your data across several disks, such that a s...
RAID - Redundant Array of Inexpensive Disks
RAID stands for Redundant Array of Inexpensive (Independent) Disks. On most situations you will be using one of the following four levels of RAIDs. RAID 0 RAID 1 RAID 5(6) RAID 10 (also k...
Upgrade kernel version in centos 7
Before upgrade $ cat /etc/centos-release CentOS Linux release 7.4.1708 (Core) $ uname -r 3.10.0-693.el7.x86_64 $ cat /boot/grub2/grubenv saved_entry=CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)...
Migrate docker data to different directory
This post guides us how to migrate the docker data from the existing directory to a target directory in the case that the old directory runs out of space. Stop the docker daemon $ cat /etc/centos...
Using gstack for docker container process
In a Docker container environment, we won’t get a valid stack trace directly on the container host as below. $ ps -ef |grep smbd root 171118 167977 0 Apr22 ? 00:00:02 /usr/sbin/smbd -...
Network bonding
Introduction Network bonding enables the combination of two or more network interfaces into a single-bonded (logical) interface, which increases the bandwidth and provides redundancy. If a specifi...
Enable ssh passwordless login
Install sshpass package To install sshpass package on the source server from which to enable ssh passwordless login to remote servers: -bash-4.2# rpm -ivh sshpass-1.06-1.el7.x86_64.rpm Enable s...
Tuning kernel parameters in Docker
Configure namespaced kernel parameters(sysctl) at runtime The –sysctl sets namespaced kernel parameters (sysctls) in the container. For example, to turn on IP forwarding in the containers network ...
Sorting algorithm
In this post, it includes the following sorting algorithms. The code is self explained. selection sort insert sort bubble sort quick sort merge sort import java.util.Arrays; public c...
Thread synchronization
Mutexes A mutex is basically a lock that we set (lock) before accessing a shared resource and release (unlock) when we’re done. While it is set, any other thread that tries to set it will block un...
Interprocess communication(IPC)
Pipes Pipes are the oldest form of UNIX System IPC and are provided by all UNIX systems. Pipes have two limitations. Historically, they have been half duplex (i.e., data flows in only one dire...
Using bcc-tools for dynamic kernel tracing
In Red Hat Enterprise Linux 8.1, Red Hat ships a set of fully supported on x86_64 dynamic kernel tracing tools, called bcc-tools, that make use of a kernel technology called extended Berkeley Packe...
blktrace - A block layer IO tracing utility
What can blktrace do? Let’s dive into the block device layer and see how the I/O are handled in disk queues. The following stack shows the I/O paths including the block device layer. The applicat...
Understanding await in iostat
What’s meaning of await in iostat? The following is the description provided for await field in iostat man page. $ man iostat await The average time (in milliseconds) for I/O requests issued ...
Buffered and Direct IO
Buffered and Direct I/O The VxFS responds with read-ahead for sequential read I/O. This results in buffered I/O. The data is prefetched and retained in buffers, in anticipation of application aski...
Network ring buffer
Introduction Receive ring buffers are shared between the device driver and NIC. The card assigns a transmit (TX) and receive (RX) ring buffer. As the name implies, the ring buffer is a circular bu...
Semaphore
What is semaphore A semaphore is a very relaxed type of lockable object. A given semaphore has a predefined maximum count, and a current count. You take ownership of a semaphore with a wait operat...
Max open files limit
System wide open files limit To check system wide files limit: $ cat /proc/sys/fs/file-max 4875932 $ sysctl -a | grep file-max fs.file-max = 4875932 To change system wide files limit: $ echo "...
Iozone - A filesystem benchmark tool
Introduction IOzone is a filesystem benchmark tool. The benchmark generates and measures a variety of file operations. Iozone is useful for performing a broad filesystem analysis of a vendor’s co...