July 27, 2024

Part-3: Basic 10 Linux Interview Questions and Answers

In this article, we’ve included 3rd set of 10 basic Linux Interview Questions and detailed answers that will help candidates prepare for the Linux interview.

These Linux interview questions and answers will be useful for both freshers and experienced users.

Q.1) What’s BIOS

BIOS refers to a Basic Input/Output System, is a firmware (Power-On Self-Test (POST)) used to perform hardware initialization during the boot process.

This became a legacy boot because the BIOS did not evolve and improve over time. Also, it has more serious limitations.

Q.2) What’s UEFI Boot?

UEFI stands for Universal Extended Firmware Interface, which replaces traditional BIOS in systems due to lack of improvement and limitations on it.

It uses the GUID Partition Table (GPT) and maintains a list of valid boot volumes called EFI Service Partitions.

During the POST process, the UEFI firmware scans all bootable storage devices attached to the system to find an EFI service partition to boot.

Q.3) What’s MBR?

MBR stands for Master Boot Record that sits in the first 512 bytes of a storage device. It contains an operating system bootloader and the storage device’s partition table.

Normally, the MBR detects a bootable device and loads the GRUB/GRUB2 boot loader into memory under BIOS systems.

MBR contains three portions:

  • 1st 446 bytes: Primary boot loader information
  • 2nd 64 bytes: Partition table information
  • Last 2 bytes: It perform mbr validation check

Q.4) What is GPT Partition Table?

GPT stands for GUID Partition Table, is a partitioning scheme that is part of the Unified Extensible Firmware Interface specification, which uses globally unique identifiers (GUIDs), or UUIDs, to define partitions and partition types.

Q.5) What is Linux Bootloader?

The bootloader loads the “vmlinuz” kernel image file into memory and extracts the contents of the initrd/initramfs image file into a temporary, memory-based file system (tmpfs).

  • LILO: LILO stands for Linux Loader, is a boot loader for Linux and the default boot loader for most Linux distributions for years before GRUB was introduced.
  • GRUB: GRUB stands for GRand Unified Bootloader, is a boot loader that allows users to choose different operating systems when you have more than one OS on your computer. Additionally, it allows you to select a different kernel to boot the system.
  • GRUB2: GRUB2 stands for “GRand Unified Bootloader, Version 2”. GRUB1 is now considered legacy and has been replaced with GRUB2 in most modern distributions, mainly designed to provide flexibility and performance to today’s operating systems.

Q.6) What is Linux tmpfs?

tmpfs and udev are virtual file systems that are resides in memory and not on a disk. These file systems dynamically used by RAM to store their files, and a tmpfs partition is set to half of its maximum available RAM.

These contents are automatically cleared upon reboot and temporary files in tmpfs directories can be recreated at boot by using systemd-tmpfiles.

You may have noticed that many tmpfs are mounted on your system but they are all different file systems and they are used for different purposes. What they have in common is the file system type: they use the tmpfs driver.

How do I list tmpfs in Linux?

Use the ‘df’ command to list mounted tmpfs on your Linux system.

df -h | grep tmpfs

Q.7) What’s initrd?

initrd stands for Initial RAM Disk. This is an initial or temporary root file system that is loaded before the actual root file system is available.

For Initrd, a “ramdev” block device was created. This is a RAM based block device that uses memory instead of disks. It contains the image of a file system, so the driver must be compiled into the kernel to enable it.

Q.8) What’s initramfs?

initramfs stands for Initial RAM file system used on modern Linux operating systems. This is an initial or temporary root file system that is mounted before the actual root file system is available.

For initramfs, this is directly linked to “tmpfs”. tmpfs does not require a driver, it is always in the kernel, so no additional drivers and devices are needed.

Q.9) What is an Inode in Linux?

Inode is an index node or index number, is a data structure on a Linux file system that stores information about a file and directory.

File systems typically have two parts: metadata and real data.

Each file contains an inode that contains metadata about the file. Each file in the file system has a unique inode number. It is guaranteed that inode numbers are unique to a file system only.

Inode stores the following information about a file.

  • Size of the file
  • Device ID
  • User ID (UID)
  • Group ID (GID)
  • Information about permissions (read, write, execute, etc)
  • File access privileges (owner, group and others)
  • Time stamps information such as file access, file modification, file deletion and inode number change.
  • Information about soft links and hard links
  • Location of the file on the file system

How do i check inode usage in Linux?

Use the ‘df’ command with ‘-i’ option to check the inode usage of active file system on your Linux system.

df -hi

Filesystem     Inodes IUsed IFree IUse% Mounted on
devtmpfs         976K   340  975K    1% /dev
tmpfs            978K     1  978K    1% /dev/shm
tmpfs            978K   914  977K    1% /run
tmpfs            978K    16  978K    1% /sys/fs/cgroup
/dev/vda1         80M  1.1M   79M    2% /
tmpfs            978K     1  978K    1% /run/user/0

Q.10) What is the use of Ctrl+Alt+Del keys in Linux?

The combination of ‘Ctrl + Alt + Del’ keys is very dangerous in Linux and should be disabled in the production environment.

Don’t use this combination, especially when you are working on the console, because if you accidentally hit it, it restarts the system immediately without any notice.

In the desktop environment, this combination brings you ‘Power Off / Restart / Cancel’ options, which allow you to prevent the power off within ’60’ seconds if you do not want to power off the system, while the Linux server environment restarts the system immediately without any notice.

Conclusion

In this guide, we’ve included the most frequently asked another 3rd set of 10 basic Linux Interview Questions and detailed answers for your reference purpose and we hope it will be very useful.

If you have any questions or feedback, feel free to comment below.

Leave a Reply

%d bloggers like this: