Posts tagged kernel
By default, CentOS will keep the 5 last installed kernels available. Since kernels are getting bigger and the /boot partition is, in most of the cases, a primary partition which is difficult to extent, you can run into problems like I had today. My /boot was getting too small.
I always create it with a size of 150M, but 250M is more common these days. The workaround is quite easy: limit the number of old kernels that you want to keep after installing a new one to 3 instead of the default 5.
Install the package yum-utils:
yum install yum-utils
Now remove the old kernels:
package-cleanup --oldkernels --count=2
To make this permanent, edit /etc/yum.conf and set installonly_limit:
That’s it. CentOS will now install no more than 3 kernels. The current one and two older versions. This also works with other RPM-based systems like Fedora and Redhat or Oracle Enterprise Linux.
Dell made some changes in their 12th generation servers like the R520, R620, R720, etc. These changes reflect Consistent Network Device Naming announced by the Fedora project earlier. Onboard network interfaces are no longer know as eth0, eth1, etc. by default but now named em1, em2, etc.
System Administrators can then use BIOS-provided names, which are consistent and not arbitrarily named, for their network ports. This eliminates the confusion that non-deterministic naming brings, and eliminates the use of hard-coded MAC address based port renaming which a) is racy and error-prone, and b) introduces state into an otherwise stateless system.
But there can be some problems. What if you use licensed software that used the MAC-address as unique identifier and polls hard to /dev/eth0. Well, then you have to hack around in the boot parameters of grub to use the old ethX device naming. This is also the case if you’re current PXE of Configuration Management isn’t ready for the new device naming.
- cp –preserve=context /etc/grub.conf /etc/grub.bak
- Add biosdevname=0 to the kernel boot arguments in /etc/grub.conf.
- Rename /etc/sysconfig/network-scripts/ifcfg-em1 to /etc/sysconfig/network-scripts/ifcfg-eth0, changing the line DEVICE=”em1″ to DEVICE=”eth0″
- Delete /etc/udev/rules.d/70-persistent-net.rules
Now the network devices have their old names again. I’ve tested this with CentOS 6.2. If you’re looking for a quick fix for your current PXE-environment just use the first two steps (Add biosdevname=0 to the kernel boot arguments in /etc/grub.conf).