Skip to main content

Posts

Showing posts from September, 2017

telinit or init Command

Purpose Initializes and controls processes. Syntax { telinit | init } { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | h | Q | q | S | s | M | m | N } Description The init command initializes and controls processes. Its primary role is to start processes based on records read from the /etc/inittab file. The /etc/inittab file usually requests that the init command run the getty command for each line on which a user can log in. The init command controls autonomous processes required by the system. The process that constitutes the majority of the init command's process dispatching activities is /usr/sbin/getty . The /usr/sbin/getty process initiates individual terminal lines. Other processes typically dispatched by the init command are daemons and the shell. The telinit command, which is linked to the init command, directs the actions of the init command. The telinit command takes a one-character argument and signals the init com

Linux Kernel Version Numbering

Because there are numerous revisions and releases of the Linux kernel and new ones are developed at frequent intervals, it is important to have a system for clearly identifying them. A kernel is a program that constitutes the central core of a computer operating system and which has complete control over everything that occurs in the system. The Linux kernel was originally developed by Linus Torvalds , who based it on (but did not copy) both UNIX and MINIX (an open source clone of UNIX). The initial Linux kernels had a very simple numbering system. The first, which was released by Torvalds in September 1991, was designated 0.01. This was followed the next month by the 0.02 kernel. The current version numbering system began with the kernel 1.0, which was released in March 1994. Linux kernels are now identified by a set of four numbers, sometimes supplemented by several additional characters . The first number denotes the kernel version . It is changed least frequently

Check and list luns attached to HBA in RHEL6

This article will show you the mapping from physical HBA card to luns, I use SAN as example below, in general, it's also applys to any other devices whichever use sysfs, for example direct sas connect. First, use  lspci get HBA card  info installed on the host # lspci | grep Fibre 15:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02) 15:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02) HBA detail info # lspci -v -s 15:00.0 15:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)     Subsystem: QLogic Corp. Device 015d     Physical Slot: 2     Flags: bus master, fast devsel, latency 0, IRQ 24     I/O ports at 2200 [size=256]     Memory at 97b00000 (64-bit, non-prefetchable) [size=16K]     Expansion ROM at 90000000 [disabled] [size=256K]     Capabilities: [44] Power Management version 3     Capabilities: [4c] Express Endpoint, MSI 00     Capabilit

Linux performance monitoring and tuning Introduction

Linux system administrators should be proficient in Linux performance monitoring and tuning. This article gives a high level overview on how we should approach performance monitoring and tuning in Linux, and the various subsystems (and performance metrics) that needs to be monitored. To identify system bottlenecks and come up with solutions to fix it, you should understand how various components of Linux works. For example, how the kernel gives preference to one Linux process over others using nice values, how I/O interrupts are handled, how the memory management works, how the Linux file system works, how the network layer is implemented in Linux, etc., Please note that understanding how various components (or subsystems) works is not the same as knowing what command to execute to get certain output. For example, you might know that “uptime” or “top” command gives the “load average”. But, if you don’t know what it means, and how the CPU (or process) subsystem wor

Difference between Unix and Linux Operating Systems

UNIX is copyrighted name only big companies are allowed to use the UNIX copyright and name, so IBM AIX and Sun Solaris and HP-UX all are UNIX operating systems. The Open Group holds the UNIX trademark in trust for the industry, and manages the UNIX trademark licensing program.   Most UNIX systems are commercial in nature. Linux is a UNIX Clone But if you consider Portable Operating System Interface (POSIX) standards then Linux can be considered as UNIX. To quote from Official Linux kernel README file: Linux is a Unix clone written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX compliance. However, “Open Group” do not approve of the construction “Unix-like”, and consider it misuse of their UNIX trademark. Linux Is Just a Kernel Linux is just a kernel. All Linux distributions includes GUI system + GNU utilities (such as cp, mv, ls,date, bash etc) + installation & management tools + GNU c

What is a Superblock, Inode, Dentry and a File?

First and foremost, and I realize that it was not one of the terms from your question, you must understand metadata . Succinctly, and stolen from Wikipedia, metadata is data about data. That is to say that metadata contains information about a piece of data. For example, if I own a car then I have a set of information about the car but which is not part of the car itself. Information such as the registration number, make, model, year of manufacture, insurance information, and so on. All of that information is collectively referred to as the metadata. In Linux and UNIX file systems metadata exists at multiple levels of organization as you will see. The superblock is essentially file system metadata and defines the file system type, size, status, and information about other metadata structures (metadata of metadata). The superblock is very critical to the file system and therefore is stored in multiple redundant copies for

Special File Permissions (setuid, setgid and Sticky Bit)

Three special types of permissions are available for executable files and public directories. When these permissions are set, any user who runs that executable file assumes the user ID of the owner (or group) of the executable file. You must be extremely careful when you set special permissions, because special permissions constitute a security risk. For example, a user can gain superuser privileges by executing a program that sets the user ID (UID) to root . Also, all users can set special permissions for files they own, which constitutes another security concern. You should monitor your system for any unauthorized use of the setuid and setgid permissions to gain superuser privileges. To search for and list all of the files that use these permissions, see How to Find Files With setuid Permissions . A suspicious listing grants ownership of such a program to a user rather than to root or bin . setuid Permission When set-user identification ( setuid ) permission is set o

What Is SU & Why Is It Important to Using Linux Effectively?

Linux has a lot of security measures in place that are meant to protect your system from threats and sometimes (admittedly) our own stupidity. There are three main features that exist to limit and provide access as needed — file permissions, file ownership, and the root user account. Although widely known as the super user account, SU actually refers to substitute user, and instructs the computer to execute commands with the file permissions of another user, by default the root account. This shortcut is a powerful tool that can be very helpful when used correctly or absolutely devastating if used recklessly. Today, we’re going to go into deeper detail about SU and why you should be responsible when using it. Admin Accounts All of the major operating systems have the concept of an administrator account, offering heightened privileges compared to otherwise “normal” user accounts. Normal users have access to their own files, but not other users’ files and only read-