30 common questions and answers for Linux System Administrator interviews
In this article, we will discuss 30 most common questions for the Linux System Administrator interview and answers from experienced professionals. The questions mentioned below can help readers identify the Linux interview. If you like these questions, don't hesitate to share them with Weibo, Renren, Facebook, Google +, and Twitter.
1. Why is LVM necessary?
LVM refers to the logical volume manager, which helps us adjust the LVM partition size in Linux Online Based on the file system size. We can use the lvextend and lvreduce commands to increase or decrease the LVM partition size.
2. How is the statistical data of memory and CPU?
We can use the 'free' and 'vmstat' commands to view the statistics of physical memory and virtual memory respectively. Using the 'Sar 'command, we can see CPU usage and other information.
3. What does Sar provide? Where is the storage location of Sar logs?
Sar collects, reports, and stores system activity information. The default version of the Sar command (CPU usage report) may be the first to be used when you perform a system activity survey because it monitors most system resources. When the CPU usage is close to 100%, the sampling workload is CPU-intensive.
The default log file of the Sar command is located in the/var/log/sa/sadd file, where dd represents the current date.
4. How to Increase the LVM partition size?
The logical steps are as follows:
-Run the lvextend command (lvextend-L + 100 M/dev/<Name of the LVM Partition>. Here, we increase the size of the specified Partition by 100 MB)
-Resize2fs/dev/<Name of the LVM Partition>
-Run the 'df-H' command to check the partition size.
5. How to Reduce the LVM partition size?
The following are the logical steps to reduce the LVM partition size:
-Run the umount command to uninstall the file system.
-Use the resize2fs command, for example, resiz2fs/dev/mapper/myvg-mylv 10G
-Then use the lvreduce command, for example, lvreduce-L 10G/dev/mapper/myvg-mylv
The preceding command will reduce the file system size by 10 Gb.
6. How to Create a partition from the original disk?
Using fdisk, we can create partitions from the original disk. The procedure is as follows:
-Fdisk/dev/hd * (IDE) or/dev/sd * (SCSI)
-Enter n to create a new partition.
-After creating a partition, enter the w command to save the disk partition information.
7. Where is the kernel module located?
All kernel modules and compiled drivers in the Linux operating system are stored in the '/lib/modules/kernel-version/' directory. You can also run the 'lsmod' command to view all installed kernel modules.
8. What is umask?
Umask indicates "User File Creation mask", which determines which files are controlled by a mask when files and directories are created.
9. How to Set umask permanently for the user?
To permanently set the umask value for the user, This value must be stored in a suitable configuration file determined by the user's default shell.
10. How to change the default running level in Linux?
To change the running level, you must edit the "/etc/inittab" file and change the default running level (id: 5: initdefault :). Use the 'init' command, we change the current running level. For example: 'init 3', this command will change the system running level to level 3.
11. How to Use nfs shared directories?
To use the nfs shared directory, first edit the '/etc/exportfs' file and add an entry, for example,'/<directory-name> <ip or Network> (Options )', then restart the nfs service.
12. How do I check and mount nfs sharing?
Using the 'showmount' command, we can see which directories are shared through nfs, for example, 'showmount-e <ip address of nfs server> '. Using the mount command, we can mount nfs sharing on Linux.
13. What are the default port numbers used by SMTP, DNS, FTP, DHCP, SSH, and squid?
Service port number
SMTP 25
DNS 53
FTP 20 (data transmission), 21 (establish a connection)
DHCP 67/UDP (dhcp server), 68/UDP (dhcp Client)
SSH 22
Squids 3128
14. What is network binding?
Network binding aggregates multiple LAN cards to form a single binding interface to provide fault tolerance and high performance. Network binding is also called NIC Teaming.
15. What are different network binding modes in Linux?
The following is the mode used in network binding:
Balance-rr or 0-loop mode to improve fault tolerance and load balancing.
Active-backup or 1-set active backup mode to improve fault tolerance.
Balance-xor or 2-set the XOR (exclusive or) mode to improve fault tolerance and load balancing.
Broadcast or 3-set broadcast mode to improve fault tolerance. All information is copied and sent from all interfaces.
802.3ad or 4-configure the IEEE 802.3ad dynamic link aggregation mode. Create a focus group that shares the same speed and duplex settings.
Balance-tlb or 5-set transmission Load Balancing (TLB) mode to improve fault tolerance and load balancing
Balance-alb or 6-set the Active Load Balancing (ALB) mode to improve fault tolerance and load balancing
16. How do I check and verify the status of the bond interface?
Using the 'cat/proc/net/bonding/bond0' command, we can check which mode is activated and what LAN card is used. In this example, we only have one bond interface, but we can have multiple bond interfaces, such as bond1 and bond2.
17. How do I check the default route and route table?
Run the 'netstat-nr 'and 'route-n' commands to view the default route and route table.
18. How do I check which ports are listening to my Linux server?
Run the 'netstat-L' And 'lsof-I 'commands.
19. List the services started by Linux servers at a specific running level.
Run the 'chkconfig-list | grep 5: on' command to list the services started on runlevel 5. To view other running levels, you only need to change 5 to the corresponding level.
20. How can I start a service at a specific running level?
We can use commands similar to 'chkconfig <Service-Name> on-level 3.
21. How to upgrade the Linux kernel?
Instead of upgrading the Linux kernel, we should always use the rpm command to install the new kernel, because upgrading the kernel will make your Linux machine unable to start.
22. How do I scan the newly allocated luns in Linux without restarting them?
There are two ways to view the newly allocated luns:
Method 1: If sg 3 rpm is installed, run 'rescan-scsi-bus.sh'
Method 2: Run echo "---">/sys/class/scsi_host/hostX/scan
23. How can I find the WWN number that the HBA is stuck on a Linux server?
Run the 'export OOl-c fc_host-v | grep port_name 'command'
24. How do I add and modify kernel parameters?
To set Kernel Parameters in Linux, first edit '/etc/sysctl. conf 'file, save the file after modification, and run the command 'sysctl-P'. This command can be permanently modified without restarting the machine.
25. What is a Puppet server?
Puppet is an open-source and enterprise software that is used to configure and manage UNIX-based toll-like operating systems. Puppet is an automation software that uses code to push configurations to its client (puppet proxy ). Puppet code can complete various tasks, from installing new software to checking file permissions, or updating user accounts and many other tasks.
26. What is manifests in Puppet?
Mainfests in Puppet is the file that specifies the client configuration.
27. On the Puppet server, which command is used to sign the request certificate?
Use 'puppetca-sign hostname-of-agent' in 2.x'
Use 'puppet ca sign hostname-of-agent' in 3.x'
28. Where does the Puppet Master store certificates?
/Var/lib/puppet/ssl/ca/signed
29. How do I find all regular files in the directory?
Run the 'Find/<directory-type F' command '.
30. What is average load in Linux?
The average load is defined as the average value of the sum of the number of processes waiting in the running queue and the number of processes currently being executed within 1 minute, 5 minutes, and 15 minutes. Using the 'top' and 'uptime' commands, We can query the average load of a Linux server.
This article permanently updates the link address: