Saturday, May 23, 2015

Linux interview questions - UCF3.2 special

  1. SSH connection refused –start the sshd service in client side
  2. Fsck usage
Q. Can I run fsck or e2fsck command when Linux file system is mounted? Do you advice to run fsck on a live file system? I am using Cent OS.
A. No. Do not run fsck on a live or mounted file system. fsck is used to check and optionally repair one or more Linux file systems. Running fsck on a mounted filesystem can usually result in disk / data corruption. So please do not do it. You have two choices
(a) Take down system to single user mode and unmout system
  1. Xfs port number 7100
  2. iptables –F flushing iptable rules
  3. Sendmail configuration file /etc/mail/sendmail.cf,
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
  1. No of hosts in class b
Address Class
Total # Of Bits For Network ID / Host ID
First Octet of IP Address
# Of Network ID Bits Used To Identify Class
Usable # Of Network ID Bits
Number of Possible Network IDs
# Of Host IDs Per Network ID
Class A
8 / 24
0xxx xxxx
1
8-1 = 7
27-2 = 126
224-2 = 16,277,214
Class B
16 / 16
10xx xxxx
2
16-2 = 14
214 = 16,384
216-2 = 65,534
Class C
24 / 8
110x xxxx
3
24-3 = 21
221 = 2,097,152
28-2 = 254


  1. What is the default permission for printer spooler service?
620 – read write – write- no perminssion
  1. File string delete – sed command
  2. What is the advantage of N+1 and one to one cluster?
The advantages of the N + 1 model are that the server load can be distributed to multiple nodes and that only one backup node is necessary to sustain all the possible node failures. Thus, the machine idle ratio is 1/N as opposed to 1/1, as is the case in a single asymmetric model.


Table 3-1  High Availability Model Advantages and Disadvantages
Model
Advantages
Disadvantages
Recommended User
Asymmetric
  • Simple Configuration
  • Backup node is 100 percent reserved
  • Machine resources are not fully utilized
A small service provider with plans to expand in the future.
Symmetric
  • Better use of system resources
  • Higher availability
  • Resource contention on backup node
  • Mirrored disks reduce disk write performance
A medium-sized service provider with no expansion plans on their backup systems in the near future.
N + 1
  • Load distribution
  • Easy expansion
  • Configuration complexity
A large service provider who requires distribution with no resource constraints.


  1. Block level for NAS (Network Attached SCSI) NAS is file level, SAN & DAS are block level
  2. Which cluster has the critical application? Application cluster
  3. What is the security protocol in SAN? LUN masking, zoning - In a storage area network (SAN), zoning is the allocation of resources for device load balancing and for selectively allowing access to data only to certain users.
  4. ls *.txt
  5. iostat which field the processing of time waiting ? 4 th field %iowait
  6. rpm to deb what is the package? alien rpm
  7. How to find send/receive of eth0 statistics? ethtool -S eth0, netstat -e
  8. What is not a routable protocol? Bootp, tcp, arp, rarp
  9. CD drive protocol – ATAPI (ATA Packet Interface)
  10. What is the single point of failure in cluster network?
A single point of failure (SPOF) is a part of a system that, if it fails, will stop the entire system from working.[1] They are undesirable in any system with a goal of high availability or reliability, be it a business practice, software application, or other industrial system.
Systems can be made robust by adding redundancy in all potential SPOFs. For instance, the owner of a small tree care company may only own one wood chipper. If the chipper breaks, he may be unable to complete his current job and may have to cancel future jobs until he can obtain a replacement.
Redundancy can be achieved at various levels. For instance, the owner of the tree care company may have spare parts ready for the repair of the wood chipper, in case it fails. At a higher level, he may have a second wood chipper that he can bring to the job site. Finally, at the highest level, he may have enough equipment available to completely replace everything at the work site in the case of multiple failures.
The assessment of a potential SPOF involves identifying the critical components of a complex system that would provoke a total systems failure in case of malfunction. Highly reliable systems should not rely on any such individual component.


  1. File which is accessible by any process? lsof,top,ps,all the above
  2. echo ENV_VAR what is the output? Same output
  3. iostat –x What is the output? Disk utilization in linux
  4. need to forward mails
.forward
  1. send mail alias file? /etc/aliasis
  2. What is the maxpv size in LVM? 2TB PE size 4MB
  3. Where we install platform in the cloud?Infrastructure or platform
  4. NTP expansion – Network Time Protocol (123-port no)
  5. Advantages of LVM2 (read & write and snapshot)
  6. Partition type of lvm – partition id 08e
  7. Authorize server usage in DNS – Master/ slave a &b
  8. Not included in DNS = restricted zero/ standard primary
  9. Not benefits in clouding = regulatory
  10. 3rd party / partners in for incident report
  11. Password reset is incident management true
  12. Commands to display vgs – vgs, vgdisplay
  13. How to run bourne again scripts ./scriptname.sh
  14. 2 types of zoning in storage – hard zone and soft zone
  15. Command to list route – route –n, netstat –r
  16. Merits of resizefs over ext2 – revision control
  17. One public network down what to do? Remedy
Additional questions:1) How to reduce the lvm, or How to reduce vg? lvreduce -L -200G /dev/vg0/lv0
2) What is the layer nfs supported? Application layer
3) What is the configuration file for squid? /etc/squid/squid.conf
4)Which class multicast is supported class D
5)What is the port no for NIS and NFS ? NFS 2049 NIS
6) How to exit the crontab with saving the command?esc:wq
7) crontab entries – min hours date month day command
8) DNS config file /var/named/chroot/etc
9) What is the use of DAS? Direct-attached storage (DAS) is computer storage that is directly attached to one computer or server and is not, without special support, directly accessible to other ones.
10) How to check the socket details? lscpu | grep 'socket' dmidecode


Other questions:

    1. How to disallow the query from DNS? RFC 1035 transaction signature
    2. How to delete package using dpkg? dpkg –r package name
    3. What is the reconfiguration file in RHEL? sys-unconfig
    4. Block size 8192 mount thru NFS? mount moonshot:/home /home -o rsize=8192,wsize=8192
    5. What is lsof option for subdirectories? lsof +D /directory
    6. xinetd or inetd file for RHEL
    7. default protocol for traceroute ICMP
    8. iostat –d? Only device statistics will be displayed.
    9. How to check sockets thru netstat? netstat -an or lsof -i.
    10. How to check non-listening sockets thru netstat? netstat -al
    11. Highly availability cluster in patching and upgrading?
    12. What is a valid FC topology? Switched fabric
    13. Protocol for TCP/IP? internet
    14. Service desk – for problem analysis and solution providing – False



  1. HBA expansion – Host Bus Adapter
  2. How to check the hops? Traceroute
  3. Incident management and problem management example.
  4. Lvmmaxpvsize=0 what does it mean?
  5. Hybrid cloud concept? A hybrid cloud is a cloud computing environment in which an organization provides and manages some resources in-house and has others provided externally.
  6. OSI & TCP how many layers? 7 & 4 layers respectively
  7. To insert above and below one line in the vi editor esc O/o (capital – above, small – below)
  8. To replace the character? r
  9. Priority – nice value -20 to 19 (lower number has higher priority, 0 is default priority)
  10. What are the ways to change the hostname in RHEL? hostname =hostname, /etc/sysconfig/hostname
  11. How to connect external DAS? The main protocols used for DAS connections are ATA, SATA, eSATA,[1] SCSI, SAS, and Fibre Channel.
  12. What are the things to be mentioned in iSCSI
  13. How to avoid bounced mail in sendmail?
  14. How to avoid mail queue in sendmail?
  15. How to extend lv in linux 2.6 kernel in lvm2 from 12 to 13 gb? lvextend –L +1G /dev/vg0/lv0
  16. 4Gb – 4096Mb
  17. HA cluster, I/O fencing two nodes failed? Fail-over - the operation of moving the service from one cluster node to another.
  18. How to avoid split brain? A good way of avoiding split brain conditions in most cases without having to resort to fencing is to configure redundant and independent cluster communications paths - so that loss of a single interface or path does not break communication between the nodes - that is the communications should not have a single point of failure (SPOF).
  19. VLAN advantage in SCSI?


  1. Split
split -b 22 newfile.txt new
Split the file newfile.txt into three separate files called newaa, newab and newac..., with each file containing 22 bytes of data.
split -l 300 file.txt new
Split the file newfile.txt into files beginning with the name new, each containing 300 lines of text.


  1. How to find the hard link of a particular file
— Test: -samefile NAME
File is a hard link to the same inode as NAME. If the ‘-L’ option is in effect, symbolic links to the same file as NAME points to are also matched.


— Test: -inum n
File has inode number n. The ‘+’ and ‘-’ qualifiers also work, though these are rarely useful. Much of the time it is easier to use ‘-samefile’ rather than this option.


  1. Apache directive
Apache directives are a set of rules which define how your server should run, number of clients that can access your server, etc. you can change them by editing the httpd.conf and related files to meet your requirements
  1. How to delete a character in vi editor – press x to delete
  2. Grep pattern – filtering a text from the file in general
  3. How to disconnect the users
skill -STOP -u vivek stop the user
skill -CONT -u vivek resume the halted user
  1. How to set numbers in vim esc: se nu
  2. Broadcast ip address – last address of the class
  3. How to add nfs wherever needed – nfs soft mount to be used
  4. Packages/modules for ldap – open ldap
  5. Mac address how many bit – 48 bits
  6. What is UTC – Universal co-ordinate time
  7. Vmstat syntax - vmstat [options] [delay [count]]
  8. iostat once 5 times - iostat 5
  9. Routing table – route –n, netstat –rn, ip route list
  10. Features of NAS
NAS operates at file system level -- usually either NFS or CIFS -- and serves whole files to users over the shared medium of the local-area network (LAN), while storage-area networks (SANs) deliver data at the block level (via Fibre Channel or iSCSI protocols) and are well suited to transactional storage such as database access.
  1. Iscsi protocol? – internet protocol, SAN protocol

0 Comments: