Archive
Posts in Linux
Understanding the Linux /boot directory
When I first began using Linux quite some time ago, I remember thinking to myself WTF is all this stuff in /boot. There were files related to grub, a file called vmlinuz, and several ASCII text files with cool sounding names. After reading through the Linux kernel HOWTO, the /boot directory layout all came together, and understanding the purpose of each file has helped me better understand how things work, and allowed me to solve numerous issues in a more expedient manner. Given a typical CentOS or Fedora host, you will probably see something similar to the following in /boot: For each kernel release, you will typically see a vmlinuz, System.map, initrd and config file…
$ read more →Listing file system lock files on Linux hosts
I mentioned in a previous post that I was using the Linux flock utility to ensure that only one copy of yum would run at any given point in time (well, theoretically someone could call yum from outside of the script, but there are only so many use cases you can protect against). The lock files that are created by flock reside on a file system, and can be viewed with the lslk utility: If the file name doesn't appear in the lslk output, you can use the find utilities "-inum" option (find a file by its inode number) to locate the file using the inode number listed in the 4th column: If the process name doesn't show up, you can use the lsof utility along with the name of the lock to see which process has the lock file open: I have been using lslk off and on for years, and it's a SUPER useful tool for debugging issues with file system lock files. Nice!
$ read more →Downloading Fedora and CentOS source code with yumdownloader
One of the things I really like about Linux is the availability of source code for the kernel and userland applications. If I encounter an issue where a program is misbehaving for some given reason, I can grab a source RPM from a network repository and start poking around to see what is going on. Fedora and CentOS provide the yumdownloader utility to download binary RPMs, and source RPMs when the "--source" option is specified: Once a source RPM is downloaded, you can install it and begin looking through the source. Sweet!
$ read more →Using yum to install the latest kernels on Fedora hosts
As you may surmise from several of my recent posts, I have been doing a ton of Linux virtualization (Xen, KVM, openvz) testing. In the case of KVM, numerous bug fixes are integrated into each kernel release, so it's often beneficial to stick to the bleeding edge kernels (though great for testing, I wouldn't feel comfortable running these in production). Fedora provides the latest and greatest kernels and virtualization packages (libvirt, qemu, etc.) in the rawhide repository, which you can access by setting the enabled flag to 1 in /etc/yum.repos.d/fedora-rawhide.repo: Once you have the repository enabled, you can use yum to install the latest kernel: This will install the latest kernel, and allow you to take advantage of the latest Linux kernel features.
$ read more →Adding Machine Check Exception Logging support to the Linux kernel
In my previous post, I mentioned how the mcelog utility can be used to detect hardware problems. Mcelog relies on the /dev/mcelog device being present, which requires the kernel to be built with the following options: To enable these, you can select the following options once you run 'make menuconfig':
$ read more →