You are on page 1of 15

……………………………………………..

Sheet - Rapid Fire - 2 also for evaluation 2 prep


Disk Management:
1. How to check all the mounted file
systems? Give two commands
Df -h ….. mount. Lsblk
2. How to check the disk usage on a particular directory. Let’s say, you want to check how much disk space is being
used by /var directory?
Du -sh /var….. s for summary… h for human readable
3. What’s difference between df and du command?
Df: all mounted file system
Du: disk usage or utilization
4. How does the Linux System know what file systems to mount at boot time?
/etc/fstab
5. How to list attached block devices to your system? Command and syntax
Lsblk… or fdisk -L
6. What are the minimum required partitions?
2 minimum… swap and root
7. What is the recommended size of /boot?
500 MB …. For redhat 8 : 1GB
8. Command to scan for newly attached block devices R
Echo “- - -" >>/sys/class/scsi_host0/scan
9. Which command you use to see the existing partitions on your block devices?
Fdisk.. or gdisk
10. Explain what is swap space? Where does swap space reside? R
Virtual memory…. Sits on hard drive
10.1. Swap space is a space on a hard disk that is a substitute for physical memory.It is used as virtual memory
which contains process memory images. Whenever our computer runs short of physical memory it uses its
virtual memory and stores information in memory on disk.

11. What is the purpose of the Swap space? Why is it called Swap space?

12. Is swap space slower than RAM? And why? R

Anything on disk is slower… RAM is slower


13. How to check the total memory in your system? Give 3 commands for that.. R
Free -m
Vmstat
Top
14. What is buffer/cache memory reported in the free -m command? R

14.1. Cache stores the actual data


14.2. Buffer stores the metadata

15. How to check how much RAM and Swap is being used? Give 2 commands R

Free -h…Vmstat.. Top …. Swapon -s


16. Command you use to create swap space. R
Mkswap
17. How you turn on swap and make it available to system? R
Swapon
18. What is paging out? R

18.1. When data is moved from RAM to swap to hold


19. What is paging in?
19.1. When data is moved from swap to RAM

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?

Twice as the size

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

24. How can you create a file system on the partition?


Mkfs
25. Difference between Ext4 and XFS file systems? R
25.1. Ext4 default for RHEL 6
25.2. Xfs default for RHEL 7
26. What is Journaling? R

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.

Delete some files or add more sspace

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

“source where the new link will be at will be at”


“the link that’s created
49. How to delete a soft link?
Rm linkname /tmp/file-test-link

Unlink linkname /tmp/file-test-link


50. What is unlink command and its syntax?

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?

Link that’s pointing to a missing source directory


53. How can you find the broken link?
Ls -L ….. it will be red
54. Command to create hard link.
Ln

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

If u want to create it in tmp also


Do,
Tar -cvzf /tmp/etc.backup.gz /etc
*Filename
* To read what is in there
Tar -tvf /tmp/etc.backup.g
 To extract it,
Tar -xvf /tmp/etc.backup.gz
Where it will the extracted file be?
in the current dir.

If you want to change dump it somewhere else do

Tar -xvf /tmp/etc.backup gz -C /opt

Change it to somewhere too


Ls /opt/
Tar -xvf /tmp/etc.backup gz -C /opt/rh

Rh is another folder available In opt

ElseYou want to compress and archive the /data file system. What command would you use to archive and compress
/data in one shot?

56. What daemon is responsible for the system log?


Rsyslogd
57. Filesystem that was at 100% capacity, how would you find what was filling up that filesystem?
Find /var -size +50m -exec du -sh {} \;
58. If User’s home directory is using 50 GB. User deletes a big file (25GB) and checks but df -h still reports its size as 50
GB. Why even though 25GB file was deleted? What’s the issue?
 Do this
 Lsof |grep .fat to get the file process ID for the fat file
 Then
 you need to kill the process of that file … or nelfy it
 Or stop the process
59. Will du -h /home/john report the same size issue as df in the light of above question? R
Yes it will till u nelfy or kill it

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

Rpm -qa |wc -L


63. Command to check whether httpd is installed or not on your system using rpm?g
Rpm -qa httpd
Or
Yum list installed httpd
64. Rpm command to install a package. G
Rpm -I
65. Rpm command to upgrade package.
Rpm -U
66. remove a package using rpm command? G
Rpm -e to erase
67. What is advantage of yum over rpm? R
Yum resolve dependencies
Rpm used for individual rpm installation
What is draw back of the yum?
You need network access
system has to be online
68. install package, update and remove package command using yum? G
Yum install telnet
Yum update telnet
Yum remove telnet

69. What file contains YUM repos? R


/etc/yum.repos.d
70. Which is configuration file of yum? R
Cat /etc/yum.conf

71. List all repos using yum command. R


Yum repolist

72. How update your system with a single command? R


Yum update -y
-y to force it for all system

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 

75. What are three stages of LVM? specify their commands? R


LVM structure builds with three layers Physical Volumes (pv), Volume Group (vg) and
Logical Volume (lV
76. Do you know the purpose of volume group? 2 Commands to list all Volume groups.
Different devices ; joining their storage together
Vgs…. Vgdiaply
77. Command to list the underlying devices for lv
Lvdisply -m
78. Sdc and sdd are attached to system, they are available to be used: extra R
78.1.1.1. Create Physical volume
Pvcreate /dev/sdc /dev/sdd
78.1.1.2. Create Volume group called vg1
Vgcreate vg1 /dev/sdc /dev/sdd

78.1.1.3. Logical Volume of 1 GB called root-lv


Lvcreate -n root-lv -L 1G /dev/vg1
79. Given you have free storage pool in VG1, extend the root-lv by 1 GB
Lvextend -L +1G /dev/vg1/root-lv -r

-r is for resizing the file system

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

84. Which is the latest file system in Linux?


Xfs
85. How do I shrink/reduce XFS filesystem? R
U cant
86. There is an existing 10GB LV called hr-lv and you are asked to extend it to 20GB? Being a system Admin
what you are steps you will take?

First see if u have enough space if not

Attach a new disk of 10gb


Discover it on the os using lsblk… fdisk -L

… if no show do

Echo ‘ - - - ‘ > /sys/class/scsi_host/host0/scan

Extend the volumegroup of lv


Pvcreate “new disk name"
Vgextend “vgname" “newdiskname"
Extend the logical volume
Lvextend -L +10G /path/to/lvm -r
Df -h to confirm

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

Echo ‘ - - - ‘ > /sys/class/scsi_host/host0/scan

Extend the volumegroup of lv


Pvcreate “new disk name"
Vgextend “vgname" “newdiskname"
Extend the logical volume
Lvextend -L +10G /path/to/lvm -r
Df -h to confirm

89. What is the difference between -L and -l in LV extend? R

-L specify size in human readable format


-l “small L “ … Logical extent size

RAID: all Red


90. What is RAID? What are some benefits of using RAID?

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.

95. What is benefit of parity?


Parity is small data that is used to connect to larger data blocks and recover data when
disk failure occurs.

96. How many disks RAID 6 can lose without losing data?
Because of parity, RAID 6 can withstand two disk failures at one time

97. What is RAID 10?


RAID 10, also known as comapination of RAID 1+0, is a RAID configuration that combines disk
mirroring and disk striping to protect data. It requires a minimum of four disks and stripes data across
mirrored pairs. As long as one disk in each mirrored pair is functional, data can be retrieved. If two disks in
the same mirrored pair fail, all data will be lost because there is no parity in the striped sets.

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

EVALUATION 1 STUFF that you still need to know


Linux
102. Command to read system live logs?
Tail -f
103. Systems error log file path? Security log file path? Boot messages log file path?

104. Commands to check OS release? Kernel version? Uptime?


105. Command to check when the last was rebooted?
Last |grep reboot
106. /proc file importance? Size?
It is the data source
107. Major differences between RHEL 6 and RHEL 7?

108. Grep and find command difference?

Grep to find data.. or extract


Find get u the files and dir.
109. Find command: find all files older than 90 days whose size is bigger than 50 M belongs to user john and move
to /tmp/john

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 show to show all the connection

Nmcli connection delete “connection name”


All files contained be deleted too

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

Now configure the slaves


Nmcli connection add con-name s1 type type-slave ifname eth1 master m1

Configure Second slave


Nmcli connection add con-name s2 type type-slave ifname eth2 master m1

Run nmcli connection show to see them added

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

6. Command to check nfs service running or not?


Systemctl status nfs-server

On client… nfsstat
……..
Firwall-cmd –add-service=nfs..

This will open the nfs port 2049


On client side how to mount the NFS exported file system? R
Mount -t nfs “nfsserverip”:/path/toshared/directory /mountpoint

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

Nfs4: new version


Support acL and selinux

11. How do you list NFS exported file systems on server side? R
Showmount -e

On server.. look at etc exports side


User asks for a share how would you decide if you use samba or nfs? Y
If u to use share accros windows and Linux .. use samba

Across Linux use nfs only for linux

12. What would be the criteria to use samba over nfs? Y


Same
13. Explain me the “root_squash” option? R
Just how root will not have root privileges on the shared files …. Client side
14. What happens if we go with “no_root_quash” option what will happen? R
That means Don’t take root privileges from root on the client side

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.

o Check Nic if it's flapping


o check the switch where the nic is connected if the switchboard is flapping
 check if the service is a running or not
 check the health on the nic to see if to there are packets being dropped … command ethtool enp0s3
 use netstat command to see if there are packets being dropped
 use tcpdump to collect the traffic and pass it to the network team to find RCA root cause analysis.

If there’s data loss check network card. Any network issue on server side. Check the firewall. Network
card server side can go on and off.. n.work card can flap . Also I will collect the traffic using tcpdump.
Letting my network team knows to run analysis. Also run nfsstat to see the statistics. Also Maybe the
cables dropping.
17. Did you have performance tuning to NFS?
Not yet
18. Why do you get the error that say’s stale file Handlers error? R
Maybe somebody has altered the configuration in the
vi /etc/exports on the NFS server side
Maybe in there they changed or removed the path of the share
How do you force unmount a hung nfs share?
Lazy unmount it
Umount -L /mountpoint
SSH:
1. What is the configuration file for SSH Daemon, and which file is for Client configurations R
Ls -ld /etc/ssh/sshd_config .. server side

Ls -ld /etc/ssh/ssh_config .. client side

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

8. How will you list all the ESTABLISHED connections? 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

EVALUATION 1 STUFF that you still need to know


Linux
118. Command to read system live logs?
119. Systems error log file path? Security log file path? Boot messages log file path?
120. Commands to check OS release? Kernel version? Uptime?
121. Command to check when the last was rebooted?
122. /proc file importance? Size?
123. Major differences between RHEL 6 and RHEL 7?
124. Grep and find command difference?
125. Find command: find all files older than 90 days whose size is bigger than 50 M belongs to user john and move
to /tmp/john
126. Find all messages related to “kernel” from system logs and dump them into /tmp/kernel-logs
127. What is $0, $? And $# in shell scripting?
128. Command to add user john? Important files related to user accounts?
129. Command to change ownership and permissions such as rwx?
130. What is zombie process and how to kill it?
131. Enable and start the httpd service
132. How to list all running services? How to list services that are enabled at boot time?
133. Difference between kill -9 and -15

You might also like