Archive
Posts from 2009
Adjusting how often the Linux kernel checks for MCEs
I wrote about Linux mcelog utility a few weeks back, and described how it can be used to monitor the /dev/mcelog device for machine check exception (MCEs). By default, the Linux kernel will check for MCEs every five minutes. The polling interval is defined in the sysfs check_interval entry, which you can view with cat: To configure the host to use a shorter check interval, you can echo the desired value to the sysfs entry for processor 0: If you want to get additional information on check_interval, check out the machinecheck text file in the kernel documentation directory. If you are curious how the code actually detects a MCE, you can look through the source code in /arch/x86/kernel/cpu/mcheck.
$ read more →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 →Testing out live CD distributions with KVM
I read over the latest KVM putback log last night, and saw that KVM now supports booting from ISO images that are accessible via HTTP (it uses libcurl under the covers). This is pretty fricking cool, and allow you to boot in recovery mode without requiring local media or PXE, and provides a super easy way to play around with live CD distributions. To use this feature, you will first need to install KVM build 87 from source. Once that is complete, you can add the URL to your qemu-kvm command line: You can also fire up virsh and "edit" the URL into the XML data…
$ read more →Accessing the Python help facility from the Python shell
Python has a ton of useful modules, and the built-in help facility is extremely useful for gaining quick access to a description of methods in a given module. Once a module is imported with import: To get help on a specific method, you can pass the module and method name to the built-in help function: This is pretty sweet, and makes coding in Python super easy.
$ read more →