Interview Questions and Answers - Linux Administrator - 3


What is the major difference between ext2 and ext3 file systems?
The main difference between ext2 and ext3 is, ext3 allows journaling. (Journaling is a type of log file, which tracks all the file system changes. so that you can recover in case of filesystem crash)
Explain Linux Booting Process?
  • When the computer is switched on, it automatically invokes BIOS [a ROM chip embedded in the motherboard].
  • The BIOS will start the processor and perform a POST [power on self test] to check whether the connected device are ready to use and are working properly.
  • Once the POST is completes BIOS will check for the booting device. The boot sector is always the first sector of the hard disk and BIOS will load the MBR into the memory. MBR holds the boot loader of the OS.
  • From here the boot loader takes the control of the booting process.
  • GRUB is the boot loader for Linux. 
  • Depending on the boot option selected the kernel is loaded first.
  • After kernel is loaded the kernel will take the control of the booting process
  • Initrd will be loaded which contains drivers to detect hardware (Initialization of RAM Disk)
  • Then it will initialize all the hardware including I/O processors etc.
  • Kernel then mounts the root partition as read-only
  • INIT is loaded as the first process.
  • INIT will mount the root partition and other partitions as read/write and checks for file system errors.
  • Sets the System Clock, hostname etc..
  • Based on the Runlevel, it will load the services and runs the startup scripts which are located in /etc/rcX.d/ (Network, cups, nfs, SSH etc.)
  • Finally it runs the rc.local script.
  • Now the login prompt will appear.

How do you extend a LV? For example, How do you expand /var file system with additional 2GB space?
  • Check which logical volume (LV) holds the  /var file system using df –h
  • Now, find out this particular LV belongs to which VG using lvdisplay <lv_name>
  • Check the free space available in that Volume Group (VG) using vgdisplay <vgname>. Look for "Free PE / Space" line in the ouput.
  • If the free space available in VG, now you can expand the LV using lvextend –L +2G <lv_name>. Now, Logical Volume has been expanded. Now we have to expand the file system using resize2fs /var. All these can be done in online without unmounting the filesystems.
How do you find out hardware errors inside Linux?
  • dmesg
  • /var/log/messages
  • dmidecode –t system 
  • IML (Integrated Management Logs) - An iLO console feature
  • hpacucli - To check RAID array status
  • use grep or less commands on
    • /var/log/messages and /var/log/warn
    • /var/log/debug
    • /var/log/kern.log
    • /var/log/mcelog
How do find out what are the files inside an RPM before installing it?
rpm -qlp package.rpm  (Example : $ rpm -qlp rpm -qlp gnupg-1.4.5-1.i386.rpm)