Installing Linux Kernel v4.10

I started using CentOS over several other Distros that I have been testing ever the years. I still have an Ubuntu laptop just to keep up to date with things seeing that it’s one of the most popular ones.

I’ve covered installing Kernels before but I wanted to refresh that topic and include how to do it on CentOS.

Continue reading Installing Linux Kernel v4.10

Advertisements

Linux Kernel Zero Day Vulnerability CVE-2016-0728

This vulnerability has existed since 2012 and it affects Android and Linux systems running Linux Kernel version 3.8+, and Linux server or desktop running kernel 3.8+ is vulnerable.

As of the date of disclosure, this vulnerability has implications for approximately tens of millions of Linux PCs and servers, and 66 percent of all Android devices (phones/tablets).

How do I fix this?

First some background on what the CVE-2016-0728 bug is. From the Perception Point Research Team

CVE-2016-0728 is caused by a reference leak in the keyrings facility. Before we dive into the details, let’s cover some background required to understand the bug. It can successfully escalates privileges from a local user to root.

Continue reading Linux Kernel Zero Day Vulnerability CVE-2016-0728

Colorful Bash and Vim in CentOS 7

CentOS comes default with a bland bash and vi setup. I prefer to have a colorful interface as I work. Here’s how I got mine working…

Bash

Most people use a colorful bash to distinguish between files and directories and such.

Open a terminal and do the following:

  • change to the root user

su -
or
sudo -i

  • run the following two commands:

echo "alias ls='ls --color=auto'" >> ~/.bashrc
source ~/.bashrc

Vim

Syntax highlighting is useful if you use Vim to edit files and create scripts and such. It ensures that you are doing it right. As per Vim’s website:

Syntax highlighting enables Vim to show parts of the text in another font or color. Those parts can be specific keywords or text matching a pattern.

Open a terminal and do the following:

  • change to the root user

su -

or

sudo -i

  • Make sure vim is installed

yum -y install vim-enhanced

  • Open the profile config file for editing

vi /etc/profile

  • Add the following line

alias vi=vim

  • Run the following to finalize the changes

source /etc/profile

That’s it… Now go have fun with your colorful ls outputs and syntax highlighted edits.

agedu for keeping up with disk usage in Linux

A few months ago I was tasked with tracking down whatever it was that kept devouring all the disk space on one of our servers. Not too hard except it’s a Linux server and I did not want to put in the effort to shell in and run commands every time something happened and I certainly did not want to have to get this one server into our production environment as it was used mostly for QA to keep their stuff.

I looked around to see if there was an easy solution and ran across agedu (age dee you) and I got them setup with it so they could do their own searches. The process to clean up disk is to track down the culprits and delete them, aged does a full drive scan and displays reports that show how much space is being used by each directory and file. It even shows the access time range for each directory.

The du vs aged thing

Yes, you could just run du and get a summary of disk usage; but, aged actually takes things to another level by distinguishing between data that is still being used and ones that are not been accessed for some time so it not only finds what is using up the most space, but also what is wasting your space by just taking up space and not being used.

From the aged site

Unix provides the standard du utility, which scans your disk and tells you which directories contain the largest amounts of data. That can help you narrow your search to the things most worth deleting.

However, that only tells you what’s big. What you really want to know is what’s too big. By itself, du won’t let you distinguish between data that’s big because you’re doing something that needs it to be big, and data that’s big because you unpacked it once and forgot about it.

Most Unix file systems, in their default mode, helpfully record when a file was last accessed. Not just when it was written or modified, but when it was even read. So if you generated a large amount of data years ago, forgot to clean it up, and have never used it since, then it ought in principle to be possible to use those last-access time stamps to tell the difference between that and a large amount of data you’re still using regularly.

agedu is a program which does this. It does basically the same sort of disk scan as du, but it also records the last-access times of everything it scans. Then it builds an index that lets it efficiently generate reports giving a summary of the results for each sub-directory, and then it produces those reports on demand.

Continue reading agedu for keeping up with disk usage in Linux

Configuring Software RAID in CentOS or RHEL

First off let’s get a bit into what RAID is for those that are not familiar.

What is RAID

Redundant Array of Independent Disks; originally Redundant Array of Inexpensive Disks (RAID) is basically a way of storing the same data across multiple disks thereby offering redundancy. Gains are made in I/O (Inout/Output) and RAIDing reduces mean time between failures (MTBF), it increases fault tolerance as well.

To the OS, a RAID array appears a a single logical drive or a series of drives depending on your choice of striping. Striping involves partitioning each drive’s storage space into units ranging from one sector (512 bytes) to several MB or GB. In a multi-user system, better performance requires establishing a stripe wide enough to hold the typical or maximum size record. This allows overlapped disk I/O across drives. Continue reading Configuring Software RAID in CentOS or RHEL