Professional Documents
Culture Documents
11. What is the purpose of the Swap space? Why is it called Swap space?
15. How to check how much RAM and Swap is being used? Give 2 commands R
19. What is Swap space allocation rule of thumb? How much swap space would you allocate on a system with 64 GB
RAM and 1 TB hard drive?
20. Which utilities can you use to partition the block device?
Fdisk… gdisk
21. Storage team has allocated 100 GB Logical Unit Number (LUN). You are being asked to make it available as 100 GB
standard partition with XFS fs for /app directory. Walk me through the process …
21.1. Mkfs.xfs /dev/sdx
21.2. Mount a directory to it
21.3. Add to /etc/fstab to make it persistent
22. How can we change the partition type using fdisk? What option to use for that? R
22.1. Fdisk
22.2. P
22.3. N
22.4. T
8e for linux LVM (for example
23. What is basic difference between gdisk and fdisk partition utility?
Number of partitions
A journaling filesystem keeps a journal or log of the changes that are being made to the filesystem during disk
writing that can be used to rapidly reconstruct corruptions that may occur due to events such a system crash or
power outage
27. What is a mount point and why we mount a file system? What is /mnt? Y
27.1. Mount point is a pointer or shortcut to a partition location on a physical media (hd)
27.2. /mnt is the default mount point
28. How can you make the mount point boot persistent? G
/etc/Fstab
29. What are the consequences of having errors in /etc/fstab file? G
Sys. Won’t boot. Mount point is missing
30. What is UUID? Which command you can use to get UUID? R
30.1. Universally unique identifier
31. How would you check which file is taking most of the space under a directory? G
Du -sh “path to directory"
32. Command to check the disk space for all the mounted file systems. G
Df -h
33. If there is 60% space free still you are not able to save any of the file in the file system. R
File system ran out of inood number.
Delete some file… or add more space
34. Du -h & Df -hT is giving 2 different results. What could be the problem? R
34.1. Du -h will tell you individual file or disk usage.
34.2. Df -ht will show you overall system usage
35. Du -h & Df -h are giving the same readout but you are unable to write to the filesystem.
File system has been mounted as read only
36. How can we find the storage disk of a particular directory?
Df -h “dir"
37. What is purpose of command fdisk -l?
List attached disk to the system
38. What are links in Linux?
Pointers
39. What is an inode?
Metadata of file
40. What is stored in the inode numbers?
Permissions. Ownership. Size. Date. All the output of stat command
41. Command to get the inode number of a file?
Ls -Li
42. Command to get the total inode available and used for / file system?
Df -Iاي
43. What if you have run out of maximum number of inodes? What are the consequences and how can you solve the
issue?
43.1. You cannot create any more files or folders within system.
43.2. Have to extend partition.
44. What is file system sanity check in Linux? How do you repair bad file systems?
It check if every file System and hard drives runs fine.
45.1. Sanity check checks for issues with the file system, e.g. permissions, defragmentation, etc
Fsck is to repair
Xfs_repair
45. Link Management:
46. What is link count in Linux?
A Link count shows how many directory entries link to the file
47. What is difference between hard link and soft link?
symbolic or soft link is an actual link to the original file, whereas a hard link is a mirror
copy of the original file. If you delete the original file, the soft link has no value, because
it points to a non-existent file.
48. Command to create symbolic or symlink or soft link?
Ln -s /root/file-test /tmp/file-test-link
51. If you delete or relocate the source file what will be the effect on symlink?
It will be ineffective
52. What is broken link?
TAR
55. Tar command syntax and explain flags.
- C create
- V verbosity
- Z zip
- F file
- X extraction
- T read list what’s in the tarball
- P preserve timestamp
Tar -cvzf etc.backup.gz /etc
*Filename
ElseYou want to compress and archive the /data file system. What command would you use to archive and compress
/data in one shot?
Package Management:
60. What is RPM y
Redhat package manager
61. List all packages installed on your system using rpm on cli? G
Rpm -qa
62. How can you count all the packages available in the system? G
LVM:
73. What is the PE and logical extent? R
Pe is physical extent
74. What is a Logical Unit Number? Y
is a unique identifier for designating an individual or collection of physical or virtual storage devices that execute
input/output
80. How to list all Logical Volumes and associated Block devices (HDs)?
Lvdisplay -m
81. Extend VG1 volume group by adding sde
Vgextend vg1 /dev/sde
82. Will extending the logical volume extend the file system as well?
No it won’t
83. Provide the command to extend the LV as well as resize the fs. R
It can if u use the – r
Lvextend -L +1G /dev/vg1/root-lv -r
… if no show do
87. You created volume group vg-hr which is not showing up. What command would you use to scan for it? R
Vgscan
88. Your storage is full, and you added a new disk. What steps you would take before extending the LV? R
RAID stands for Redundant Array of Independent Disks, and combines multiple hard
drives together in order to improve efficiency. Depending on how your RAID is
configured, it can increase your computer's speed while giving you a single drive with a
huge capacity
91. Difference between RAID and LVM?
The only difference between RAID and LVM is that LVM does not provide any options
for redundancy or parity that RAID provides.
92. Why there exist different levels of RAID?
93. Difference between RAID 0 and 1?
The main difference between the RAID 0 and RAID 1 is that, In RAID 0 technology, Disk
stripping is used. On the other hand, in RAID 1 technology, Disk mirroring is used
94. What is difference between RAID 5 & RAID 6 level?
RAID 6 offers greater data protection and fault tolerance than RAID 5, but at the same
time, it's write performance is slower than RAID 5 because of double parity, though the
read operations are equally fast. RAID 5, on the other hand, is cheaper to implement
and provides more optimized storage than RAID 6.
96. How many disks RAID 6 can lose without losing data?
Because of parity, RAID 6 can withstand two disk failures at one time
98. If you are allowed to pick any single RAID level. Which level will you pick if cost level is basic consideration?
RAID 0. Cos there is no redundancy. And cost is the consideration here
99. If you need only better reading feature, then which level will you pick?
RAID 1
100. If reading is our consideration, then still you will go with RAID 5 or change your answer?
I will go with RAID 0 ZERO
101. Is RAID 6 level slower than RAID 5? Why it slow? Explain
it's write performance is slower than RAID 5 because of double parity, though the read
operations are equally fast
110. Find all messages related to “kernel” from system logs and dump them into /tmp/kernel-logs
111. What is $0, $? And $# in shell scripting?
112. Command to add user john? Important files related to user accounts?
113. Command to change ownership and permissions such as rwx?
114. What is zombie process and how to kill it?
115. Enable and start the httpd service
116. How to list all running services? How to list services that are enabled at boot time?
117. Difference between kill -9 and -1
…………………………………………………………………………………………………………………………
NIC Bonding:
1. How would you configure NIC bonding?
Combining 2 physical network Logically so they create virtual interface called bond
In rehad 7 it is noy Bonding, it is teaming.
Nmcli connection add con-name m1 ifname m1 type team config ‘{“runner “: {“name”:
“activebackup”}}’
Now assign ip
Nmcli connection modify m1 ipv4.addresses 10.0.0.212/24 ipv4.dns.10.0.0.1 ipv4.gatway 10.0.0.1
ipv4.method manual connection.autoconnect yes
Or use tap tap
2. What is runner?
The mood of the interface, Bond, or team
3. Can you say three (3) different modes of NIC Bonding?
Activebackup… load balance..
4. What do you mean by Activebackup NIC Bonding?
2 network cards. If one fail, the other one kicks in
5. How NIC Bonding would be balancing?
Divide or balance the load . Data
6. If you have two NIC in server, you set it up with individual ip addresses on different network. What
determines that which interface will be used to outgoing traffic from the server?
Depend on the route, gateway and the device ” network card “ u configured
7. Let say you have two different network cards and both having different ips and you try to connect to a
remote server how would you determine which interface will send traffic?
Same
8. What command to show the connection?
Nmcli connection show
9. Using command line, how can you get the type of teaming is set?
Teamdctl m1 state
Or grep runner ifcfg-m1
NFS:
1. What is NFS? Give scenarios where your organization uses NFS.
Network file sharing. Shares file over system.
Scenarios:
Our company use nfs to share user home directories. Application data. Multiple software that cannot
be downloaded from yum repositories so they have nfs share
2. What Daemons are used on server and client side?
Nfs-server on server side
Rpcbind on client
But which software u need to mount on both server and client is : nfs-utils.
3. Which port needs to be opened up on server side?
Do grep “servicename” /etc/services
Ex: grep nfs /etc/services
4. Which is the file to export NFS file system and syntax used in this file? Give me an example on how you
can export /data file system to system101.linoop.com
Vi /etc/exports
Do
“Directory to share” “hostnames/ips” ( permissions, no_root_squash,sync)10.0.0*(rw,no_root-squash)
Exportfs -avr
5. Command to run after making an entry in the export file.
Exportfs -avr
On client… nfsstat
……..
Firwall-cmd –add-service=nfs..
To make it persistent
/etc/fstab
7. If user can’t access NFS mounted file system, give all possible reasons for that.
No Client Permissions to the share … read… write
Nfs server not running
Not in etc fstab
Nfs server someone enabled firewall
Ip change
8. How do you access share date?
You mount the nfs share so to access data
9. How NFS is made resilient?
Backup of data
If service so enable it to became persistent
10. What is the difference between NFS3 / NFS4? R
Nfs3 old version
11. How do you list NFS exported file systems on server side? R
Showmount -e
15. If there are NFS mounts and it frequently get disconnect and NFS dies how do you disconnect it. You
know if NFS dies then system may be hinged or weird. How will you make the system disconnect on its
own.
That means If you rebooted the system, and u have nfs share mounted on it and nfs share not
responding or disconnected the system will hange and won’t boot.
How to fix
Vi etc fstab
Go to the mounted point where it says “default “ and add _netdev ,to front of default…. It becomes
_netdev,default
This means it is a network device. When u added _netdev that means Don’t mount this share until u
have network on this machine.
16. NFS master is showing some md file from some check value the contents on the master and client are
not matching. In this case what would you do? Means on client side there is less data as compare to
master side due to data loss.
2. Where you will look into if user can’t SSH and can’t log into the system? R
Look into /var/log/messages
Look into tcp wrapper /etc/hosts/deny
Also/etc/ssh/sshf_config file
Netstat -tunap |grep ssh cos maybe ssh is running on different port
Check the firewall
Check the user account if allowed or noy. Maybe the user locked.
Maybe user not connected to n.work
Or log into the host and do
Try to ssh myself and get consol if I can’t ssh to the machine
Tail -f /var/log/messages
Tail -f /var/log/secure
Two host A and B, User asks me to configure ssh and make it password less. Where are keys saved? R
Generate keys
Ssh-keygen -t rsa … u don’t have to do rsa cos it will be by default
Keys are stored in
Cat authorized_keys
3. Trying to ssh as root and put in correct root password and it’s not working; how would you
troubleshoot that? R
What is the error message.
4. Why do you need an ssh-key based entry Authentication? R
5. A client is asking server is not responding. He can't ssh, what you will do to fix it? R
Also check the port listening or not
6. Which software allows to setup an SSH sever, and which allows you to ssh into an SSH server(names).
G
7. How to ensure SSH is persistent, and running/active, how do you check if SHHD is listening or not? R
Netstat
9. How do you change the port for sshd, and how would you allow that port in firewalld? R
10. A service (sshd) fails to start. What are some of the troubleshooting steps you'd take R
11. How do you list all the security logs that pertain to ssh? R
12. How you list all the system logs that pertain to ssh? R
13. How do you list kernel logs/boot up logs? R
14. How can we disable direct root login on to the system by using SSH? R
Miscellaneous:
1. How can you go into Single User mode and its purpose. R
2. Can you explain the Linux Boot Process? R very important
3. U forgot the root pass in rhel 7 how will u change it ? R
4. Which are some of the run levels/targets? R
5. Which command will you use to change the run level? R
6. System is booting up and throws some errors related to some file systems not being able to mount at
boot time. What file you would modify to fix this problem? And how would you get into the system to
make those changes? R
7. How can you perform a File system Consistency check on a partition/hard drive? R