Linux Interview Questions and Answers – Part 2

Linux Interview Questions - Part 2
Linux Interview Questions – Part 2

This is the second part of Linux Interview Questions and Answers series, this may be helpful to prepare yourself for Linux interview. I will share you the questions, along with the answers and the links to topics so that you have no need to google it.


Linux Interview Questions and Answers – Part 1

Linux Interview Questions and Answers – Part 2

Caution: The following questions are shared purely on personal, does not mean that these questions reflect the actual interview.

1. How will you troubleshoot if the server is not reachable? Steps?

1. Ping to server
2. Check the network link status
3. Check the network card
4. Check the ip address and network configuration
5. Check the firewall settings
6. Check the remote access (SSH service on server)

2. What is the command to see the status of cluster?

# clustat

3. What is the command to move the cluster resources?

# clusvcadm -r resource_name -m node_name

4. What is split brain in cluster?

Split brain is a state in which a cluster of nodes gets divided into smaller clusters of equal numbers of nodes, each of the node believes it is the only active cluster. Believing the other clusters are dead, each cluster may simultaneously access the same application data or disks, which can lead to data corruption.

This may occur when all of the private links (heartbeat network) go down simultaneously, but the cluster nodes are still running, each one believing they are the only one running.

5. What is the use of fence devices in cluster?

Fence device is a hardware device that can be used to cut a node off an inoperable node. This can be accomplished in a variety of ways: powering off the node via a remote power switch or reset the node via ILO device.

6. How fencing works?

When CMAN determines that a node has failed, it communicates to other cluster-infrastructure components that the node has failed. fenced, when notified of the failure, fences the failed node. Other cluster-infrastructure components determine what actions to take — that is, they perform any recovery that needs to done. For example, DLM and GFS, when notified of a node failure, suspend activity until they detect that fenced has completed fencing the failed node. Upon confirmation that the failed node is fenced, DLM and GFS perform recovery. DLM releases locks of the failed node; GFS recovers the journal of the failed node.

7. How to get a UUID of san devices from file?

UUID is a mechanism to give each filesystem a unique identifier, can be used to identify a device instead of using normal device name. Linux now prefers to use UUID (Universally Unique Identifier), LABEL, or symlinks to identify media storage devices on a system. Directly using /dev/hd*# or /dev/sd*# is no longer preferred since these device assignments can change when you are replacing hard disks.

# ll /dev/disk/by-uuid/

lrwxrwxrwx. 1 root root 10 Sep 22 20:10 30997e3a-e7c7-463c-b497-48d81bd0047b -> ../../sda1
lrwxrwxrwx. 1 root root 10 Sep 22 20:10 bd0bd69c-6b76-4815-b4c1-747213cc4f05 -> ../../dm-0
lrwxrwxrwx. 1 root root 10 Sep 22 20:10 d92420c9-0bf8-41ab-82a2-4b00aea33de9 -> ../../dm-2
lrwxrwxrwx. 1 root root 10 Sep 22 20:11 f110cb7a-7927-401d-b0be-a1ac102e6072 -> ../../dm-1

8. How to block particular lun using multipath.conf file?

Edit /etc/multipath/multipath.conf file and add your device in blacklist section.

blacklist {
      wwid 26353900f02796769
      devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
      devnode "^hd[a-z]"

The wwid line in the following blacklist section is shown as an example of how to blacklist devices by wwid.  The 2 devnode lines are the compiled in default blacklist. If you want to blacklist entire types of devices, such as all scsi devices, you should use a devnode line.However, if you want to blacklist specific devices, you should use  a wwid line.  Since there is no guarantee that a specific device will not change names on reboot (from /dev/sda to /dev/sdb for example) devnode lines are not recommended for blacklisting specific devices. More.

9. How to recover the vg from meta data corruption?

Follow this page.

10. How to scan scsi and fc devices for new disks?


# echo "1" > /sys/class/fc_host/host0/issue_lip
# echo "1" > /sys/class/fc_host/host1/issue_lip


# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "- - -" > /sys/class/scsi_host/host1/scan

Note: Run these commands when you really in need as this may cause I/O operation timeout and remove devices unexpectedly from OS.

11. How to configure Network bonding in Linux?

Network bonding is nothing but combining multiple network interface into single interface for redundancy or getting increased throughput.

Detailed document on configuring Network bonding is here.

12. How to configure yum client?

More information is here.

13. What is the command to see the package’s list of configuration file?

# rpm -qc

14. What is the command to see the load on NFS server?

# nfsiostat

15. What is GFS?

GFS, stands for Global File system, is a shared disk file system for Linux computer clusters. It allows all nodes to have direct concurrent access to the same shared block storage.

More information is here.

16. What is the command to list the open files?

# lsof

17. What are the tool you use to check the system performance?

# top

# sar

# vmstat

# iostat

18. What are the tool you use to see network status?

 # ntop

# netstat

# traceroute

# tcpdump

# iptraf

19. What is the command to see disk usage?

#   du

More to come, stay tuned.


Share This Post