Wednesday, December 30, 2009

Sample Linux interview questions

I have compiled some sample interview questions for use in testing a potential systems administrator or systems engineer. I have created most of them but have reused some of them from the recent interviews that I have had. It should be one way to separate candidates as well as prepare others for interviews.

Sample questions:

What is a way to find the current running kernel version level?

Various iterations of the uname command (uname -a or uname -r)

How do you update the system on Red Hat 4? Red Hat 5?

up2date -u (RHEL 4) and yum update (RHEL 5)

What is a way to see what service pack and version the Red Hat system is at? CentOS?

cat /etc/redhat-release (Same for both RHEL and CentOS)

What is a way to change a kernel parameter?

sysctl -w parameter=value (persistent)

or

echo 32768 > /proc/sys/fs/file-max (not reboot persistent)

or

change a kernel parameter in /boot/grub/menu.lst as such:

kernel /boot/vmlinuz-2.6.18-128.1.16.el5 ro root=LABEL=/ elevator=deadline (persistent)

or

change the parameter in /etc/sysctl.conf (persistent)

You have a 32 bit system but want to allow RHEL to be able to use more than 4GB of RAM. What kernel do you use to accomplish this task?

Install and boot into the PAE kernel.

Of these filesystems--XFS, EXT3, EXT4, reiserFS, what is the best for large files?

XFS

Of these filesystems--XFS, EXT3, EXT4, reiserFS, what is the best for small files?

reiserFS

Of these filesystems--XFS, EXT3, EXT4, reiserFS, which ones are supported as of RHEL 5.3?

EXT3 and EXT4 (technology preview)

What has Microsoft contributed to the Linux kernel (trivia)?

A kernel module which enabled better performance with its Hyper-V virtualization technology.

You have tried to install an RPM but it has failed because of broken dependencies. How do you override and force the installation anyway?

rpm -i myprogram.rpm --nodeps

How do you set the maximum interval between fsck checks on /dev/sda1 to be one week?

tune2fs -i 1w /dev/sda1

Define dom0 and domU.

dom0 (domain zero) is the server running the Xen, KVM, or QEMU hypervisor. domU (domain unprivileged) is a virtual machine within a Xen, KVM, or QEMU server.

By default, what is the first disk known as within a VMWare virtual machine?

/dev/sda

By default, what is the first disk known as within a Xen domU?

/dev/xvda

Hope this is helpful.

Monday, December 28, 2009

Comb through Red Hat hair after initial install

Yes, you can also do this with a kickstart file, but if you want to clean up some unnecessary pieces of a Red Hat install, use the command:

yum remove blue* autofs at* anacron* cups* hid* gpm firstboot* iptables isdn* lvm* md* nfs* oddjob pcsc* portmap rpc* sendmail ypbind winbind* wpa* nscd* samba* smb*

Of course, analyze what you are using the server for and whether you will need any of these packages. But, for a vanilla install, for me this command seems to be useful to clean up some unnecessary packages.

Friday, December 18, 2009

Show module information

Use the command modinfo to find detailed module information.

# modinfo ext3
filename: /lib/modules/2.6.18-164.6.1.el5/kernel/fs/ext3/ext3.ko
license: GPL
description: Second Extended Filesystem with journaling extensions
author: Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
srcversion: 51D84081C475FE078B1D891
depends: jbd
vermagic: 2.6.18-164.6.1.el5 SMP mod_unload 686 REGPARM 4KSTACKS gcc-4.1