{"id":1982,"date":"2013-04-25T11:15:11","date_gmt":"2013-04-25T03:15:11","guid":{"rendered":"http:\/\/rmohan.com\/?p=1982"},"modified":"2013-04-25T11:15:11","modified_gmt":"2013-04-25T03:15:11","slug":"linux-interview-questions","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1982","title":{"rendered":"Linux Interview Questions"},"content":{"rendered":"<p>1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Q. Which command is used to check the number of files and disk space used and the each user\u2019s defined quota<\/p>\n<ul>\n<li>Repquota , it shows filesystem, no. of blocks used, soft and hard limit, no. of files used, soft and hard limits<\/li>\n<\/ul>\n<p>2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What is the name and path of the main system log<\/p>\n<ul>\n<li>A. \/var\/log\/messages. (Syslog)<\/li>\n<\/ul>\n<p>3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Which command is used to review boot messages<\/p>\n<ul>\n<li>Dmesg, used as dmesg | more or dmesg | grep Memory, etc<\/li>\n<\/ul>\n<p>4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Which utility is used to automate rotation of logs<\/p>\n<ul>\n<li>logrotate (\/etc\/logrotate.conf and \/etc\/logrotate.d)<\/li>\n<\/ul>\n<p>5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What are the fields in the \/etc\/passwd file<\/p>\n<ul>\n<li>Username, mask password, UID, GID, comment, home directory, default shell<\/li>\n<\/ul>\n<p>6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Which commands are used to set a processor-intensive job to use less CPU time<\/p>\n<ul>\n<li>nice, it is used for scheduling priority of PIDs. -20 means highest priority. 19 means lowest priority.<\/li>\n<li>Top command can also be used for this job. Press r and PID and Priority.<\/li>\n<\/ul>\n<p>7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 How do you create a new user account<\/p>\n<ul>\n<li>Useradd \u2013d \/home\/newuser \u2013s \/bin\/ksh \u2013c \u201cNew User\u201d\u00a0 newuser<\/li>\n<\/ul>\n<p>8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Which shell account do you assign to a POP3 mail-only account<\/p>\n<ul>\n<li>\/sbin\/nologin<\/li>\n<\/ul>\n<p>9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Which daemon is responsible for tracking events on Linux system<\/p>\n<ul>\n<li>Syslogd, it logs events to \/var\/log\/messages<\/li>\n<\/ul>\n<p>10\u00a0\u00a0\u00a0 Which daemon is used for scheduling of the commands<\/p>\n<ul>\n<li>Crond, it schedules commands with crontab \u2013e command<\/li>\n<\/ul>\n<p>11\u00a0\u00a0\u00a0 How environment variables is set so that the file permission can be automatically set to the newly created files<\/p>\n<ul>\n<li>Umask, umask 000 means full full permission, umask 777 means least permissions will be assign to newly created files.<\/li>\n<\/ul>\n<p>12\u00a0\u00a0\u00a0 Which key combination can you press to suspend a running job and place it in background<\/p>\n<ul>\n<li>Ctrl+z<\/li>\n<\/ul>\n<p>13\u00a0\u00a0\u00a0 What file would you edit in your home directory to change the default window manager<\/p>\n<ul>\n<li>~\/.xinitrc<\/li>\n<\/ul>\n<p>14\u00a0\u00a0\u00a0 Which command can split long text files into smaller ones<\/p>\n<ul>\n<li>Split, it divides file into equal sizes<\/li>\n<\/ul>\n<p>15\u00a0\u00a0\u00a0 What is pwconv<\/p>\n<ul>\n<li>Pwconv command creates \/etc\/shadow and changes all passwords to X in \/etc\/passwd<\/li>\n<\/ul>\n<p>16\u00a0\u00a0\u00a0 What is page in, page out, swap in, swap out<\/p>\n<ul>\n<li>Page-ins and page-outs are pages moved in and out between RAM and Disk<\/li>\n<li>swap-ins and swap-outs are processes moved in and out between RAM and Disk<\/li>\n<li>page-out = The system\u2019s free memory is less than a threhsold \u201clotsfree\u201d and vhand daemon use \u201cLRU, Last Recently Used\u201d algorithm to move some unused \/ least used pages to the swap area.<br \/>page-in = One process which is running requested for a page that is not in the current memory (page-fault), vhand daemon is bringing it\u2019s pages to memory.<\/li>\n<li>Page in \u2013 Page outs \u2013 They are similar in function to any other operating system. When a particular page is requested by the main memory, but it is not present in the main memory; a page fault occurs\u2026and this page is \u201cpaged in\u201d to the main memory. Similarly pages that have been inactive for a while are \u201cpaged out\u201d to page data sets on the auxiliary memory(Swap).<\/li>\n<li>swap-out = System is thrashing and swapper daemon has de-activated a process and it\u2019s memory pages are moved into the swap area.<br \/>swap-in = A deactivated process is back to work and it\u2019s pages are being brought into the memory.<\/li>\n<li>Swapping involves the moving of a process\u2019s entire collection data in memory to a range of space on the backing store, often to a swapfile or swap partition. The process goes from being in memory to swapped out entirely; there is no in-between.<\/li>\n<li>Swapping occurs when whole process is transferred to disk, while paging is when some part of process is transferred to disk while rest is still in physical memory.<\/li>\n<\/ul>\n<p>17\u00a0\u00a0\u00a0 What is tee command used for<\/p>\n<ul>\n<li>It reads standard input and transfers it to standard output while storing the contents in a separate file<br \/>sort inputfile.txt | tee outputfile.txt | cat<br \/>tee \u201cHello, I am output\u201d &gt; outputfile.txt<br \/>who | tee userlist.txt<\/li>\n<li>It can also be used to write multiple files at the same time<br \/>date | tee \u2013a file1 file2 file3<\/li>\n<\/ul>\n<p>18\u00a0\u00a0\u00a0 What are $? And $! System variables<\/p>\n<ul>\n<li>Echo $? \u00e0 Shows zero if the last executed command was successful<\/li>\n<li>Echo $! \u00e0 Shows last executed background job<\/li>\n<\/ul>\n<p>19\u00a0\u00a0\u00a0 What is difference between find and grep<\/p>\n<ul>\n<li>Find is used to search \/ locate files<\/li>\n<li>Grep is used to search a pattern inside a file<\/li>\n<\/ul>\n<p>20\u00a0\u00a0\u00a0 What are differences between Hard and Soft links<\/p>\n<ul>\n<li>Hard Link is a mirror copy of the original file.<\/li>\n<li>Hard links share the same inode.<\/li>\n<li>Any changes made to the original or Hard linked file will reflect the other.<\/li>\n<li>Even if you delete any one of the files, nothing will happen to the other.<\/li>\n<li>Hard links can\u2019t cross file systems.<\/li>\n<li>Soft Link is a symbolic link to the original file.<\/li>\n<li>Soft Links will have a different Inode value.<\/li>\n<li>A soft link points to the original file.<\/li>\n<li>If you delete the original file, the soft link fails.<\/li>\n<li>If you delete the soft link, nothing will happen.<\/li>\n<li>Soft links can cross file systems.<\/li>\n<\/ul>\n<p>21\u00a0\u00a0\u00a0 Which file defines the level of logs written to system log<\/p>\n<ul>\n<li>Kernel.h<\/li>\n<\/ul>\n<p>22\u00a0\u00a0\u00a0 Describe the boot process of Linux<\/p>\n<ul>\n<li>BIOS (Basic Input\/Output System) Loads from BIOS chip on motherboard<\/li>\n<li>POST (Power On Self Test) Checks all connected devices<\/li>\n<li>BIOS checks for Boot device availability<\/li>\n<li>BIOS loads MBR (Master Boot Record) in Memory (which is first 512 bytes of primary disk)<\/li>\n<li>MBR contains information about Boot Loader. MBR loads default boot loader i.e. GRUB<\/li>\n<li>Grub loads Kernel of Operating System, VMLinuz<\/li>\n<li>Here onwards Kernel controls booting process<\/li>\n<li>Kernel starts INITRD (Initial RAM DISK). InitRD contains preloaded drivers for hardware<\/li>\n<li>After loading drivers from INITRD, partitions are mounted (ready only)<\/li>\n<li>Init process is started, it becomes first process of system (PID = 1)<\/li>\n<li>INIT will mount root and other partitions(read\/write) and does FSCK<\/li>\n<li>INIT sets up System Clock and Hostname, etc<\/li>\n<li>Based on runlevel it will load the services and startup scripts<\/li>\n<li>Finally, it will run rc.local script<\/li>\n<li>Now the Login Prompt will appear<\/li>\n<\/ul>\n<p>23\u00a0\u00a0\u00a0 What is DORA Process<\/p>\n<ul>\n<li>DORA (Discover, Offer, Request, Accept) is the process by which a client acquires DHCP IP Address<\/li>\n<\/ul>\n<p>24\u00a0\u00a0\u00a0 What is output of Kill -3 &lt;PID&gt; and Kill -0<\/p>\n<ul>\n<li>Kill -3 &lt;PID&gt; is used to take thread dump of a running JAVA Process<\/li>\n<li>Kill -0 will kill all process in current process group except Login shell<\/li>\n<\/ul>\n<p>25\u00a0\u00a0\u00a0 What is difference between Kill and Kill -9 command<\/p>\n<ul>\n<li>kill &lt;PID&gt;\u00e0 \u00a0Generates SIGTERM signal requesting process to terminate<\/li>\n<li>kill -9 &lt;PID&gt; \u00e0 Generates SIGKILL signal for process to terminate immediately<\/li>\n<li>KILL -9 is FORCE KILL a process because the signal can\u2019t be caught by the process<\/li>\n<\/ul>\n<p>26\u00a0\u00a0\u00a0 What is VLAN<\/p>\n<ul>\n<li>Virtual LAN, is a broadcast domain created by switches. With VLAN a switch can create and broadcast domain. It separates large broadcast domains into smaller ones thus improves performance.<\/li>\n<\/ul>\n<p>27\u00a0\u00a0\u00a0 What are hard and soft mount<\/p>\n<ul>\n<li>Hard mount is used to mount local filesystem. The filesystem will be in the mounted state until you unmount it manually.<\/li>\n<li>Soft mount is an option that is very useful for mounting network filesystems(NFS). Soft mount will allow automatic unmount if the filesystem is idle for a specified time period.<\/li>\n<li>NFS supports two types of mounts \u2014 hard mounts and soft mounts. If a mount is a hard mount, an NFS request affecting any part of the mounted resource is issued repeatedly until the request is satisfied (for example, the server crashes and comes back up at a later time). When a mount is a soft mount, an NFS request returns an error if it cannot be satisfied (for example, the server is down), then quits.<\/li>\n<li>Hard mount ensures data integrity and soft mount causes data loss if NFS server is unreachable.<\/li>\n<li>Soft mount improves performance and Hard mount improves reliability<\/li>\n<\/ul>\n<p>28\u00a0\u00a0\u00a0 What is PS1 in Linux<\/p>\n<ul>\n<li>Bash supports 4 prompts:<br \/>PS1 \u2013 the default prompt<br \/>PS2 \u2013 for multi-line input<br \/>PS3 \u2013 printed for the select command<br \/>PS4 \u2013 printed before output if set -x is set<\/li>\n<\/ul>\n<p>29\u00a0\u00a0\u00a0 What is difference between a deamon and a server process<\/p>\n<ul>\n<li>A daemon (Disk and Execution Monitor) is a software process that runs in the background (continuously) and provides the service to client upon request. For example named is a daemon. When requested it will provide DNS service.<br \/>Other examples are:<br \/>* xinetd (it is a super-daemon, it is responsible for invoking other Internet servers when they are needed)<br \/>* inetd (same as xinetd, but with limited configuration options)<br \/>* sendmail\/postfix (to send\/route email)<br \/>* Apache\/httpd (web server)<\/li>\n<li>Browser Running one daemon for each of the services could significantly increase the load. However if you are running big site (with many user) it is advisable to use dedicated daemon. For example web server or MySQL database server.<\/li>\n<li>A server process runs one time, when called by a daemon. Once done it will stop. For example telnetd (in.telnetd) or ftpd called from xinetd\/inetd daemon. By calling server process from daemon you can save the load and memory. Use a server process for small services such as ftpd, telnetd<\/li>\n<\/ul>\n<p>30\u00a0\u00a0\u00a0 Where is kernel located in Linux<\/p>\n<ul>\n<li>Kernel file is stored in \/boot with the name VMLinux<\/li>\n<li>When Linux OS is running, kernel is loaded into memory<\/li>\n<\/ul>\n<p>31\u00a0\u00a0\u00a0 Explain configure, make and make install<\/p>\n<ul>\n<li>.\/configure<\/li>\n<li>The above command makes the shell run the script named \u2018 configure \u2018 which exists in the current directory. The configure script basically consists of many lines which are used to check some details about the machine on which the software is going to be installed. This script checks for lots of dependencies on your system. For the particular software to work properly, it may be requiring a lot of things to exist on your machine already. When you run the configure script you would see a lot of output on the screen , each being some sort of question and a respective yes\/no as the reply. If any of the major requirements are missing on your system, the configure script would exit and you cannot proceed with the installation, until you get those required things.<\/li>\n<li>The main job of the configure script is to create a \u2018 Makefile \u2018 . This is a very important file for the installation process. Depending on the results of the tests (checks) that the configure script performed it would write down the various steps that need to be taken (while compiling the software) in the file named Makefile.<\/li>\n<li>If you get no errors and the configure script runs successfully (if there is any error the last few lines of the output would glaringly be stating the error) then you can proceed with the next command which is<\/li>\n<li>make<\/li>\n<li>\u2018make\u2019 is actually a utility which exists on almost all Unix systems. For make utility to work it requires a file named Makefile in the same directory in which you run make. As we have seen the configure script\u2019s main job was to create a file named Makefile to be used with make utility. (Sometimes the Makefile is named as makefile also)<\/li>\n<li>make would use the directions present in the Makefile and proceed with the installation. The Makefile indicates the sequence that Linux must follow to build various components \/ sub-programs of your software. The sequence depends on the way the software is designed as well as many other factors.<\/li>\n<li>The Makefile actually has a lot of labels (sort of names for different sections). Hence depending on what needs to be done the control would be passed to the different sections within the Makefile or it is possible that at the end of one of the section there is a command to go to some next section.<\/li>\n<li>Basically the make utility compiles all your program code and creates the executable. For particular section of the program to complete might require some other part of the code already ready, this is what the Makefile does. It sets the sequence for the events so that your program does not complain about missing dependencies.<\/li>\n<li>One of the labels present in the Makefile happens to be named \u2018install\u2019.<\/li>\n<li>If make ran successfully then you are almost done with the installation. Only the last step remains which is<\/li>\n<li>make install<\/li>\n<li>As indicated before make uses the file named Makefile in the same directory. When you run make without any parameters, the instruction in the Makefile begin executing from the start and as per the rules defined within the Makefile (particular sections of the code may execute after one another.. that\u2019s why labels are used.. to jump from one section to another). But when you run make with install as the parameter, the make utility searches for a label named install within the Makefile, and executes only that section of the Makefile.<\/li>\n<li>The install section happens to be only a part where the executable and other required files created during the last step (i.e. make) are copied into the required final directories on your machine. E.g. the executable that the user runs may be copied to the \/usr\/local\/apache2 so that all users are able to run the software. Similarly all the other files are also copied to the standard directories in Linux. Remember that when you ran make, all the executable were created in the temporary directory where you had unzipped your original tarball. So when you run make install, these executable are copied to the final directories.<\/li>\n<\/ul>\n<p>32\u00a0\u00a0\u00a0 What is LD_LIBRARY_PATH<\/p>\n<ul>\n<li>LD_LIBRARY_PATH is an environment variable. It is used for debugging a new library or a non-standard library. It is also used for which directories to search. Path to search for directories need to given<\/li>\n<li>LD_LIBRARY_PATH is an environment variable you set to give the run-time shared library loader (ld.so) an extra set of directories to look for when searching for shared libraries. Multiple directories can be listed, separated with a colon (:). This list is prepended to the existing list of compiled-in loader paths for a given executable, and any system default loader paths.<\/li>\n<\/ul>\n<p>33\u00a0\u00a0\u00a0 Explain RSync<\/p>\n<ul>\n<li>rsync utility is used to synchronize the files and directories from one location to another in an effective way. Backup location could be on local server or on remote server.<\/li>\n<li># rsync\u00a0 options\u00a0 &lt;source&gt;\u00a0 &lt;destination&gt;<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -z is to enable compression<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -a archive (recursive, preserve symbolic links, permissions, timestamps, owner and group)<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 -l copy symbolic links as well<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 -h output numbers in human readable format<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 -v verbose<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 -r indicates recursive<\/p>\n<p>vii)\u00a0\u00a0 -u Update (do not overwrite)<\/p>\n<p>viii)\u00a0 -d sync only directory structure(not the files)<\/p>\n<p>ix)\u00a0\u00a0\u00a0\u00a0 -i only displays difference in source and destination<\/p>\n<p>x)\u00a0\u00a0\u00a0\u00a0\u00a0 \u2013progress to view progress during transfer<\/p>\n<p>xi)\u00a0\u00a0\u00a0\u00a0 \u2013delete to delete the files not present at source but present at destination<\/p>\n<p>xii)\u00a0\u00a0 \u2013exclude to exclude file or directory or pattern or RELATIVE path<\/p>\n<p>xiii)\u00a0 \u2013exclude-from &lt;FileName&gt; to exclude files\/directories listed in FileName<\/p>\n<p>xiv) \u2013max-size not to transfer files larger than this limit<\/p>\n<p>34\u00a0\u00a0\u00a0 How to enable password-less authentication among two linux servers<\/p>\n<ul>\n<li>Generate key on server1<\/li>\n<\/ul>\n<p><b>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/b># ssh-keygen<\/p>\n<ul>\n<li>copy public key to server2<\/li>\n<\/ul>\n<p><b>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/b># ssh-copy-id -i ~\/.ssh\/id_rsa.pub &lt;remote-server&gt;<\/p>\n<p>35\u00a0\u00a0\u00a0 How to create users in Linux<\/p>\n<ul>\n<li>Using useradd command<\/li>\n<li>To see all the defaults of useradd command<\/li>\n<li># useradd -D<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GROUP=100<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HOME=\/home<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 INACTIVE=-1<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 EXPIRE=<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 SHELL=\/bin\/bash<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 SKEL=\/etc\/skel<\/p>\n<p>vii)\u00a0\u00a0 CREATE_MAIL_SPOOL=yes<\/p>\n<ul>\n<li>Modify defaults of useradd<\/li>\n<li># useradd -D \u2013shell=\/bin\/ksh<\/li>\n<li># useradd -D<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GROUP=100<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HOME=\/home<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 INACTIVE=-1<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 EXPIRE=<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 SHELL=\/bin\/ksh<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 SKEL=\/etc\/skel<\/p>\n<p>vii)\u00a0\u00a0 CREATE_MAIL_SPOOL=yes<\/p>\n<ul>\n<li>Create customized users using useradd<\/li>\n<li># useradd -s &lt;shell&gt; -m -d &lt;home&gt; -g &lt;secondary group&gt; username<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -s = shell<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -m = create home directory, if not exists<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 -d = where to create home directory<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 -g = gid or name of group user will become member of<\/p>\n<ul>\n<li>Adduser command<\/li>\n<li># adduser &lt;username&gt;<\/li>\n<li>Creating n number of users<\/li>\n<li># newusers &lt;file containing list of users&gt;<\/li>\n<\/ul>\n<p>36\u00a0\u00a0\u00a0 How to define Password expiry<\/p>\n<ul>\n<li>To see current settings for password age policy<\/li>\n<li># chage \u2013list &lt;user&gt;<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Last password change\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : Apr 01, 2009<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Password expires\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : never<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 Password inactive\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : never<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 Account expires\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : never<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 Minimum number of days between password change\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 0<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 Maximum number of days between password change\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 99999<\/p>\n<p>vii)\u00a0\u00a0 Number of days of warning before password expires\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 7<\/p>\n<ul>\n<li>Set password expiry date for a user using -m option<\/li>\n<li># chage -M 10 &lt;user&gt;<\/li>\n<li>This will change \u2018password expires\u2019 and \u2018Max number of days between password change\u2019<\/li>\n<li>Set password expiry date for a user using -E option (YYYY-MM-DD)<\/li>\n<li># chage -E \u201c2012-12-31? &lt;user&gt;<\/li>\n<li>Set the user accound to be locked after X number of inactivity days<\/li>\n<li># chage -I 10 &lt;user&gt;<\/li>\n<li>This will change \u2018password inactive\u2019<\/li>\n<li>Force user to change password upon next logon<\/li>\n<li># chage -d 0 &lt;user&gt;<\/li>\n<\/ul>\n<p>37\u00a0\u00a0\u00a0 \u00a0What is the use of login.defs<\/p>\n<ul>\n<li>\/etc\/login.defs file contains defaults for a new user. Various options in login.defs file are<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MAIL_DIR \/var\/spool\/mail<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PASS_MAX_DAYS\u00a0\u00a0 99999<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 PASS_MIN_DAYS\u00a0\u00a0 0<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 PASS_MIN_LEN\u00a0\u00a0\u00a0 5<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 PASS_WARN_AGE\u00a0\u00a0 7<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 UID_MIN\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 500<\/p>\n<p>vii)\u00a0\u00a0 UID_MAX\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a060000<\/p>\n<p>viii)\u00a0 GID_MIN\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 500<\/p>\n<p>ix)\u00a0\u00a0\u00a0\u00a0 GID_MAX\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 60000<\/p>\n<p>x)\u00a0\u00a0\u00a0\u00a0\u00a0 CREATE_HOME\u00a0\u00a0\u00a0\u00a0 yes<\/p>\n<p>xi)\u00a0\u00a0\u00a0\u00a0 UMASK\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 077<\/p>\n<p>xii)\u00a0\u00a0 USERGROUPS_ENAB yes<\/p>\n<p>xiii)\u00a0 MD5_CRYPT_ENAB yes<\/p>\n<p>38\u00a0\u00a0\u00a0 What is the use of limits.conf<\/p>\n<ul>\n<li>\/etc\/security\/limits.conf file is used to describe limits for a user\/group<\/li>\n<li>Add session required \/lib\/security\/pam_limits.so in \/etc\/pam.d\/login<\/li>\n<li>Limits defined in limits.conf<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 core \u2013 limits the core file size KB<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 data \u2013 max data size KB<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 fsize \u2013 max file size KB<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 nofile \u2013 max number of open files<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 cpu \u2013 max CPU time (Mins)<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 nproc \u2013 max number of process<\/p>\n<p>vii)\u00a0\u00a0 maxlogins \u2013 max number of logins for this user<\/p>\n<p>viii)\u00a0 maxsyslogins \u2013 max number of logins on the system<\/p>\n<p>ix)\u00a0\u00a0\u00a0\u00a0 priority \u2013 the priority to run user process with<\/p>\n<p>x)\u00a0\u00a0\u00a0\u00a0\u00a0 locks \u2013 max number of file locks user and hold<\/p>\n<p>xi)\u00a0\u00a0\u00a0\u00a0 nice \u2013 max nice priority allowed to raise to<\/p>\n<ul>\n<li>ex.<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 @students soft nproc 10<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 @students hard nproc 20<\/p>\n<p>39\u00a0\u00a0\u00a0 \u00a0What is RAID and explain different RAID levels used<\/p>\n<ul>\n<li>RAID is Redundant Array of Inexpensive Disks. It improves performance, redundancy and flexibility<\/li>\n<li>RAID 0 = Striping (pronounced as stryping)<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Two or more disks<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Data is broken into equal size chunks and distributed over all disks<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 Performance is improved because of simultaneous read and write disk operations<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 No fault tolerance (no redundancy)<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 Suitable for intensive i\/o tasks<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 Total size = sum of disks used<\/p>\n<p>vii)\u00a0\u00a0 Two 80G disk = 160\u00d71 = 160G available disk in RAID 0 (Space efficiency =1)<\/p>\n<p>viii)\u00a0 Mathematical \u00a0AND function<\/p>\n<ul>\n<li>RAID 1 = Mirroring<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Two or more disks<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Data is duplicated to disks simultaneously<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 Performance remains same<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 Provides fault tolerance if one disk fails, Redundancy increases<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 Suitable for non-intensive i\/o tasks<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 Total size = Size of smallest disk used<\/p>\n<p>vii)\u00a0\u00a0 Two 80G disk = 160\u00d71\/2 = 80G available disk in RAID 0 (Space efficiency = 1\/n = 1\/2)<\/p>\n<p>viii)\u00a0 Mathematical OR function<\/p>\n<ul>\n<li>RAID 4 = Striping with dedicated Parity Disk<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Three or more disks<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Data is broken into stripes and distributed over two disks<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 Parity bit is stored only in third disk i.e. Parity Disk<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 Performance also depends on performance of Parity Disk<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 Provides fault tolerance if one disk fails<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 Suitable for intensive i\/o tasks<\/p>\n<p>vii)\u00a0\u00a0 3x80G disk = 240\u00d72\/3 = 160G available disk in RAID 4 (Space efficiency = 1-1\/n = 1-1\/3 = 2\/3)<\/p>\n<ul>\n<li>RAID 5 = Striping with distributed Parity<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Three or more disks<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Data is broken into stripes and distributed over three disks<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 Parity bit is also distributed over three disks<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 Performance is improved with simultaneous i\/o on three disks<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 Provides fault tolerance if one disks fails<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 Suitable for intensive i\/o tasks<\/p>\n<p>vii)\u00a0\u00a0 3x80G disk = 240\u00d72\/3 = 160G available disk in RAID 5 (Space efficiency = 1-1\/n = 1-1\/3 = 2\/3)<\/p>\n<p>40\u00a0\u00a0\u00a0 \u00a0How to boot client with Kick Start file<\/p>\n<ul>\n<li>Boot: linux ks=http:\/\/server.com\/path\/kickstart.cfg<\/li>\n<li>Boot: linux ks=nfs:\/\/server.com\/path\/kickstart.cfg<\/li>\n<\/ul>\n<p>41\u00a0\u00a0\u00a0 How to setup Kick Start server<\/p>\n<ul>\n<li>Install DHCP and configure it<\/li>\n<li>Install system-config-kickstart<\/li>\n<li>Run system-config-kickstart<\/li>\n<li>Provide answers to question in installation wizard<\/li>\n<li>Save the file in NFS\/HTTP path<\/li>\n<li>Add the name of groups and packages at the bottom of files which needs to be pre-installed on remote server<\/li>\n<\/ul>\n<p>42\u00a0\u00a0\u00a0 How to check system boot \/ reboot time<\/p>\n<ul>\n<li># last reboot<\/li>\n<li># last shutdown<\/li>\n<li># who \u2013b<\/li>\n<li># uptime<\/li>\n<\/ul>\n<p>43\u00a0\u00a0\u00a0 What is difference between ext2 and ext3 file systems<\/p>\n<ul>\n<li>Ext3 supports journaling whereas ext2 doesn\u2019t.<\/li>\n<li>Journal is a type of log file which tracks all the file system changes<\/li>\n<li>So that you can recover data in case of filesystem crash<\/li>\n<li>Journal contains \u2018metadata\u2019 i.e. ownership, date stamp information etc<\/li>\n<\/ul>\n<p>44\u00a0\u00a0\u00a0 How to extend LVM with 2GB space (add 2GB)<\/p>\n<ul>\n<li># lvextend \u2013L +2G &lt;LVNAME&gt;<\/li>\n<li># resize2fs &lt;LVNAME&gt;<\/li>\n<\/ul>\n<p>45\u00a0\u00a0\u00a0 How to extend LVM to a final of 2GB space<\/p>\n<ul>\n<li># lvextend \u2013L 2G &lt;LVNAME&gt;<\/li>\n<li># resize2fs &lt;LVNAME&gt;<\/li>\n<\/ul>\n<p>46\u00a0\u00a0\u00a0 How do you check hardware errors in Linux<\/p>\n<ul>\n<li>dmesg<\/li>\n<li>\/var\/log\/messages<\/li>\n<li>dmidecode \u2013t system<\/li>\n<li>IML (Integrated Management Logs) \u2013 An iLO console feature<\/li>\n<li>hpacucli \u2013 To check RAID array status<\/li>\n<li>use grep or less commands on<\/li>\n<li>\/var\/log\/messages and \/var\/log\/warn<\/li>\n<li>\/var\/log\/mcelog<\/li>\n<\/ul>\n<p>47\u00a0\u00a0\u00a0 How do you find BIOS version from Linux Command<\/p>\n<ul>\n<li># dmidecode \u2013type 0<\/li>\n<\/ul>\n<p>48\u00a0\u00a0\u00a0 What is dmidecode command<\/p>\n<ul>\n<li>dmidecode\u00a0 is\u00a0 a\u00a0 tool for dumping a computer\u2019s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system\u2019s hardware components, as well as other useful pieces of information such as serial numbers and\u00a0 BIOS\u00a0 revision.\u00a0 Thanks to this table, you can retrieve this information without having to probe for the actual hardware.<\/li>\n<\/ul>\n<p>49\u00a0\u00a0\u00a0 How do you find out server architecture<\/p>\n<ul>\n<li># uname \u2013a<\/li>\n<li># arch<\/li>\n<\/ul>\n<p>50\u00a0\u00a0\u00a0 How to perform automatic reboot after kernel panic (10seconds)<\/p>\n<ul>\n<li># cat \/proc\/sys\/kernel\/panic<\/li>\n<li># sysctl \u2013a | grep kernel.panic<\/li>\n<\/ul>\n<p><b>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/b>Kernel.panic = 0<\/p>\n<ul>\n<li># echo \u201c10\u201d &gt; \/panic\/sys\/kernel\/panic<\/li>\n<li># cat \/etc\/sysctl.conf | grep kernel.panic<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Kernel.panic = 10<\/p>\n<p>51\u00a0\u00a0\u00a0 What are the general causes of kernel panic<\/p>\n<ul>\n<li>Defective or incompatible RAM<\/li>\n<li>Incompatible, obsolete, or corrupted kernel extensions.<\/li>\n<li>Incompatible, obsolete, or corrupted drivers.<\/li>\n<li>Incorrect permissions on System-related files or folders.<\/li>\n<li>Hard disk corruption, including bad sectors, directory corruption, and other hard-disk ills.<\/li>\n<li>Insufficient RAM and available hard disk space.<\/li>\n<li>Improperly installed hardware or software.<\/li>\n<li>Incompatible hardware<\/li>\n<\/ul>\n<p>52\u00a0\u00a0\u00a0 What are the uses of dd command<\/p>\n<ul>\n<li>Disk Dump (copy all content from one disk to another)<\/li>\n<li># dd if=\/dev\/sda of=\/dev\/sdb<\/li>\n<li>Partition Dump (copy all content from one partition to another)<\/li>\n<li># dd if=\/dev\/sda1 of=\/dev\/sda2<\/li>\n<li>Creating empty file of specific size (File used as swap)<\/li>\n<li># dd if=\/dev\/zero of=\/swapfile bs=1024 count=524288<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1024\u00d7512=524288 block size = 512MB<\/p>\n<p>53\u00a0\u00a0\u00a0 What is DMM<\/p>\n<ul>\n<li>DMM or DM-Multipath or Device Mapper Multipathing allows you to configure multiple I\/O paths between server nodes and storage arrays into a single device.<\/li>\n<li>I\/O paths are physical SAN connections , multipath combines these I\/O paths and creates a new device<\/li>\n<li>Redundancy<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Active\/Passive configuration<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Only half of the paths are used at a time for I\/O<\/p>\n<ul>\n<li>Improved Performance<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Active\/Active mode<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Round robin fashion<\/p>\n<p>54\u00a0\u00a0\u00a0 What is WWID in DM-Multipath<\/p>\n<ul>\n<li>World Wide Identifier is a unique and unchanging name of every multipath device<\/li>\n<\/ul>\n<p>55\u00a0\u00a0\u00a0 What is use of multipath command<\/p>\n<ul>\n<li>It lists and configures multipath devices<\/li>\n<\/ul>\n<p>56\u00a0\u00a0\u00a0 What is the procedure to configure your system with DM-Multipath<\/p>\n<ul>\n<li>Install device-mapper-multipath rpm<\/li>\n<li>Edit the \/etc\/multipath.conf configuration file:<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 comment out the default blacklist\u00a0 (it blacklists all devices)<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 change any of the existing defaults as needed<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 save the configuration file<\/p>\n<ul>\n<li>Start the multipath daemons<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # modprobe dm-multipath<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # service multipathd start<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 # multipath \u2013v2<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 # chkconfig multipathd on<\/p>\n<ul>\n<li>Create the multipath device with the multipath command<\/li>\n<\/ul>\n<p>57\u00a0\u00a0\u00a0 How to exclude local disk from multipath list<\/p>\n<ul>\n<li>Modify \/etc\/multipath.conf and write local disk\u2019s WWID in blacklist section<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blacklist {<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0wwid 26353900f02796769<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<ul>\n<li>You can also black list device by its Device Name and Device Type<\/li>\n<li># multipath \u2013F \u00e0 Removes all multipath devices<\/li>\n<li># multipath \u2013f &lt; device &gt; \u00e0 Removes the given device<\/li>\n<li># multipath \u2013v2 \u00e0 verbosity = 2<\/li>\n<li># multipath \u2013l \u00e0 Displays info from sysfs and device mapper<\/li>\n<li># multipath \u2013ll \u00e0 Also displays variable components of the system<\/li>\n<\/ul>\n<p>58\u00a0\u00a0\u00a0 How to find WWID<\/p>\n<ul>\n<li># cat \/var\/lib\/multipath\/binding<\/li>\n<\/ul>\n<p>59\u00a0\u00a0\u00a0 How to add devices to multipath database<\/p>\n<ul>\n<li>Multipath by default includes support for most common storage arrays<\/li>\n<li>This list can be found in multipath.conf.defaults file<\/li>\n<li>If you want to add a unsupported device then edit \/etc\/multipath.conf<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devices {<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0device {<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0vendor \u201cHP\u201d<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0product \u201cOPEN-V.\u201d<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0getuid_callout \u201c\/sbin\/scsi_id -g -u -p0x80 -s \/block\/%n\u201d<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p>vii)\u00a0\u00a0 }<\/p>\n<ul>\n<li>To know Vendor and Product information<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # cat \/sys\/block\/sda\/device\/vendor<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # cat \/sys\/block\/sda\/device\/model<\/p>\n<p>60\u00a0\u00a0\u00a0 What is the use of DMSetup command<\/p>\n<ul>\n<li>DMSetup command is used to find out Device Mapper entries match the Multipathed device<\/li>\n<li># dmsetup ls<\/li>\n<\/ul>\n<p>61\u00a0\u00a0\u00a0 How do you troubleshoot multipath<\/p>\n<ul>\n<li># multipathd \u2013k<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 show config<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 reconfigure<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 show paths<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 CTRL+D<\/p>\n<p>62\u00a0\u00a0\u00a0 How to format, mount and use SAN Volumes<\/p>\n<ul>\n<li># fdisk \/dev\/sda<\/li>\n<li># kpartx \u2013a \/dev\/mapper\/mpath0<\/li>\n<li># ll \/dev\/mapper<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mpath0\u00a0\u00a0\u00a0 mpath0p1<\/p>\n<ul>\n<li># mkfs.ext3 \/dev\/mapper\/mpath0p1<\/li>\n<li># mount \/dev\/mapper\/mpath0p1 \/mnt\/san<\/li>\n<li>Kpartx creates device maps from partition tables<\/li>\n<li>We must use fdisk command on underlying device \/dev\/sda<\/li>\n<\/ul>\n<p>63\u00a0\u00a0\u00a0 How to resize online multipath disk<\/p>\n<ul>\n<li>Use the following command to find paths to LUNs<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # multipath \u2013l<\/p>\n<ul>\n<li>Now, resize your paths, for SCSI device<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # echo 1 &gt; \/sys\/block\/&lt;device&gt;\/device\/rescan<\/p>\n<ul>\n<li>Resize multipath device<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # multipathd \u2013k \u2018resize map mpath0\u2019<\/p>\n<ul>\n<li>Resize the file system (if there is no LVM configured upon mpath0)<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # resize2fs \/dev\/mapper\/mpath0<\/p>\n<ul>\n<li>If LVM resides over mpath0 then we should not resize it. We should resize LVM<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # pvscan<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # vgscan<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 # lvextend \u2013L +SizeG &lt;LVNAME&gt;<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 # resize2fs &lt;LVNAME&gt;<\/p>\n<p>64\u00a0\u00a0\u00a0 How to differentiate local storage from SAN<\/p>\n<ul>\n<li># ls \u2013l \/sys\/block\/*\/device<\/li>\n<\/ul>\n<p>65\u00a0\u00a0\u00a0 How to upgrade Linux Kernel<\/p>\n<ul>\n<li>Kernel can be upgraded either by compiling from source or by installing kernel rpm<\/li>\n<li>Kernel should be compiled only in case if you need custom kernel with specific patch<\/li>\n<li>Using RPM \u2013ivh command is safer than RPM \u2013Uvh (ivh will preserve old kernel to fall back)<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # rpm \u2013Uvh kernel-headers kernel-source kernel-devel<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # rpm \u2013ivh kernel kernel-smp \u00e0 SMP is multi core or multi CPU<\/p>\n<ul>\n<li>RPM command modifies grub.conf accordingly<\/li>\n<li>Linux OS can have as many kernels but can load only 1 at a time<\/li>\n<\/ul>\n<p>66\u00a0\u00a0\u00a0 How to delete or remove unnecessary kernel<\/p>\n<ul>\n<li>\/boot\/vmlinux \u00e0 Kernel File<\/li>\n<li>\/boot\/grub.conf \u00e0 Edit<\/li>\n<li>\/lib\/modules\/kernel-VERSION \u00e0 Modules<\/li>\n<li>If Kernel was installed using rpm, it can be removed via rpm \u2013e<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # rpm \u2013qa | grep kernel<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # rpm \u2013vv \u2013e kernel-smp<\/p>\n<p>67\u00a0\u00a0\u00a0 Where are the Kernel Modules (Device Drivers in Windows terminology) stored<\/p>\n<ul>\n<li>\/lib\/modules\/kernel-version<\/li>\n<li>\/lib\/modules\/$(uname \u2013r)<\/li>\n<\/ul>\n<p>68\u00a0\u00a0\u00a0 How to list all the loaded kernel modules<\/p>\n<ul>\n<li># lsmod<\/li>\n<li># less \/proc\/modules<\/li>\n<li># modinfo ipv6<\/li>\n<\/ul>\n<p>69\u00a0\u00a0\u00a0 How to add or remove modules from running kernel<\/p>\n<ul>\n<li>MODPROBE is the command used to add or remove modules in kernel on fly<\/li>\n<li># modprobe\u00a0 ip_tables<\/li>\n<li># lsmod \u00e0 uses file \/proc\/modules<\/li>\n<li># modprobe \u2013r ip_tables<\/li>\n<li># lsmod<\/li>\n<li>Alternatively, we can use insmod and rmmod<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 INSMOD \u00e0 Load a module<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RMMOD \u00e0 Unload a module<\/p>\n<p>70\u00a0\u00a0\u00a0 How to load a module in kernel automatically at system boot<\/p>\n<ul>\n<li>If you want to load cdrom module in kernel upon next boot, modify modules.conf [old method]<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # vi \/etc\/modules.conf<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ide-cd<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 ide-core<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 cdrom<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 save and close file, reboot system<\/p>\n<ul>\n<li>Or we can use rc.modules file. We should use rc.modules file and not rc.local for loading kernel modules because rc.modules file is read much eary in boot sequence<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # echo modeprobe ide-cd &gt;&gt; \/etc\/rc.modules<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # chmod u+x \/etc\/rc.modules<\/p>\n<p>71\u00a0\u00a0\u00a0 How to delete log files older than 10 days<\/p>\n<ul>\n<li># find \/var\/log\/http\/ -name *.log\u00a0 -mtime +10 \u2013exec rm \u2013f {} \\;<\/li>\n<\/ul>\n<p>72\u00a0\u00a0\u00a0 How to find Disk being used by a user<\/p>\n<ul>\n<li># find \/directory \u2013user &lt;username&gt; -type \u2013f \u2013exec du \u2013sh {} \\;<\/li>\n<\/ul>\n<p>73\u00a0\u00a0\u00a0 How to find information about your Hard Disk from Linux Command<\/p>\n<ul>\n<li># hdpram \/dev\/sda \u00e0 INFO<\/li>\n<li># hdpram \u2013I \/dev\/sda \u00e0 More INFO<\/li>\n<li># hdpram \u2013tT \/dev\/sda \u00e0 Read Write Speed<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Timing cached reads:\u00a0\u00a0 9460 MB in\u00a0 2.00 seconds = 4737.22 MB\/sec<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Timing buffered disk reads: 708 MB in\u00a0 7.57 seconds =\u00a0 93.49 MB\/sec<\/p>\n<p>74\u00a0\u00a0\u00a0 How to mount ISO files in Linux<\/p>\n<ul>\n<li># mount \u2013o loop linux-dvd.iso \/mnt<\/li>\n<\/ul>\n<p>75\u00a0\u00a0\u00a0 Explain the output of PS command<\/p>\n<ul>\n<li>S: State of the process<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 S: Sleeping,<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 O: Runing on processor,<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 R: Runnable (it is in run queue),<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 Z: Zombie,<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 T: Stopped process (either by a job control signal or because it is being traced)<\/p>\n<ul>\n<li>PID: Process ID<\/li>\n<li>PPID: Parent process ID<\/li>\n<li>USER: User name who initiated process<\/li>\n<li>GROUP: Group name from whom user belong\/currently launched the job<\/li>\n<li>RSS: The resident set size of the process, in kilobytes.<\/li>\n<li>VSZ:The total size of the process in virtual memory, in kilobytes.<\/li>\n<li>%CPU: Total % of CPU taken by this process<\/li>\n<li>%MEM: Total % of Memory taken by this process<\/li>\n<li>TIME: the cumulative CPU time of the process in the form<\/li>\n<li>ELAPSED: Total time elapsed since this process is live<\/li>\n<li>TT: Terminal ID<\/li>\n<li>COMMAND: Command\/daemon\/process with args<\/li>\n<li># ps -eo s,pid,ppid,user,group,rss,vsz,pcpu,pmem,time,etime,tty,args<\/li>\n<li># ps L \u00e0 to see list of format codes like above<\/li>\n<\/ul>\n<p>76\u00a0\u00a0\u00a0 Explain what is \/proc file system<\/p>\n<ul>\n<li>\/proc file system contains information about<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Kernel<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Hardware<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 Running Process<\/p>\n<ul>\n<li>Important files under proc are: cpuinfo, mdstat, meminfo, modules, mounts, partitions, net, version, \/proc\/sys\/kernel\/hostname, \/proc\/sys\/net\/ipv4\/ip_forward<\/li>\n<\/ul>\n<p>77\u00a0\u00a0\u00a0 What is a Zombie Process<\/p>\n<ul>\n<li>When the parent keeps some of the information of child although the child process is dead, such a process is called as Zombie Process<\/li>\n<li>Zombie process is dead but not have been removed from process table<\/li>\n<li>Zombie process doesn\u2019t cause any load or issues to machine (because it is already dead)<\/li>\n<\/ul>\n<p>78\u00a0\u00a0\u00a0 How to tune Linux kernel<\/p>\n<ul>\n<li># vi \/etc\/sysctl.conf \u00e0 Modify \/ Add \/ Remove kernel parameters<\/li>\n<li># \/sbin\/sysctl \u2013p \u00e0 Save configuration<\/li>\n<li># sysctl \u2013a \u00e0 Check configuration<\/li>\n<\/ul>\n<p>79\u00a0\u00a0\u00a0 How to configure ntp client<\/p>\n<ul>\n<li>Open system-config-date, Network Management Tab and add NTP Server\u2019s name\/IP<\/li>\n<li>Click OK<\/li>\n<li>Run command ntpq \u2013p to check available NTP servers<\/li>\n<\/ul>\n<p><b>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/b># ntpq \u2013p<\/p>\n<p><b>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/b>* is displayed against active NTP server<\/p>\n<p><b>iii)\u00a0\u00a0\u00a0\u00a0<\/b>Stratum number 16 means you are not synchronized<\/p>\n<p><b>iv)\u00a0\u00a0\u00a0\u00a0<\/b>Lower the stratum number, nearer the NTP server is<\/p>\n<ul>\n<li>Run ntpstat to see if Time is updated (synchronous) and what is Time lag (seconds behind)<\/li>\n<\/ul>\n<p><b>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/b># ntpstat<\/p>\n<ul>\n<li>To synchronize client with server manually<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # ntpupdate \u2013u &lt;NTP Sever&gt;<\/p>\n<p>80\u00a0\u00a0\u00a0 How to unmounts file system when resource is busy<\/p>\n<ul>\n<li># umount \/dev\/sda1<\/li>\n<li># fuser \u2013m \/dev\/sda1 \u00e0 identify which pid is using resource<\/li>\n<li># lsof | grep \/dev\/sda1 \u00e0 identify which pid is using resource<\/li>\n<li># kill -9 &lt;PID&gt; \u00e0 Kill the pid<\/li>\n<li># umount \/dev\/sda1<\/li>\n<\/ul>\n<p>81\u00a0\u00a0\u00a0 What is Network Bonding? What are the steps for Network Bonding?<\/p>\n<ul>\n<li>Bonding is creation of a single bonded interface by combining 2 or more ethernet interfaces. This helps in high availability and performance improvement.<\/li>\n<li>Step 1:<\/li>\n<li>Create the file ifcfg-bond0 with the IP address, netmask and gateway.<\/li>\n<\/ul>\n<p><b>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/b>\u00a0$ cat \/etc\/sysconfig\/network-scripts\/ifcfg-bond0<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DEVICE=bond0<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 IPADDR=192.168. 1.100<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 NETMASK=255. 255.255.0<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 GATEWAY=192. 168.1.1<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 USERCTL=no \u00e0 Only root can control services (say no to other users)<\/p>\n<p>vii)\u00a0\u00a0 BOOTPROTO=none \u00e0 Can be Static\/DHCP or none<\/p>\n<p>viii)\u00a0 ONBOOT=yes \u00e0 device will start when system starts<\/p>\n<ul>\n<li>Step 2:<\/li>\n<li>Modify eth0, eth1 and eth2 configuration as shown below. Comment out, or remove the ip address, netmask, gateway and hardware address from each one of these files, since settings should only come from the ifcfg-bond0 file above.<\/li>\n<\/ul>\n<p><b>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/b>$ cat \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DEVICE=eth0<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 BOOTPROTO=none<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 ONBOOT=yes<\/p>\n<p><b>v)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/b>MASTER=bond0<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 SLAVE=yes<\/p>\n<p><b>vii)\u00a0\u00a0<\/b>$ cat \/etc\/sysconfig\/network-scripts\/ifcfg-eth1<\/p>\n<p>viii)\u00a0 DEVICE=eth1<\/p>\n<p>ix)\u00a0\u00a0\u00a0\u00a0 BOOTPROTO=none<\/p>\n<p>x)\u00a0\u00a0\u00a0\u00a0\u00a0 ONBOOT=yes<\/p>\n<p>xi)\u00a0\u00a0\u00a0\u00a0 USERCTL=no<\/p>\n<p><b>xii)\u00a0\u00a0<\/b>MASTER=bond0<\/p>\n<p>xiii)\u00a0 SLAVE=yes<\/p>\n<p><b>xiv)\u00a0<\/b>$ cat \/etc\/sysconfig\/network-scripts\/ifcfg-eth2<\/p>\n<p>xv)\u00a0\u00a0 DEVICE=eth2<\/p>\n<p>xvi) BOOTPROTO=none<\/p>\n<p>xvii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ONBOOT=yes<\/p>\n<p>xviii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MASTER=bond0<\/p>\n<p>xix) SLAVE=yes<\/p>\n<ul>\n<li>Step 3:<\/li>\n<li>Set the parameters for bond0 bonding kernel module. Add the following lines to\/etc\/modprobe. conf<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # bonding commands<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 alias bond0 bonding<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 options bond0 mode=balance-alb miimon=100<\/p>\n<ul>\n<li>Here, balance-alb = Adaptive Load Balancing<\/li>\n<li>Other options are, balance-rr = Balanced Round Robin<\/li>\n<li>Note: Here we configured the bonding mode as \u201cbalance-alb\u201d. All the available modes are given at the end and you should choose appropriate mode specific to your requirement.<\/li>\n<li>Step 4:<\/li>\n<li>Load the bond driver module from the command prompt.<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $ modprobe bonding<\/p>\n<ul>\n<li>Step 5:<\/li>\n<li>Restart the network, or restart the computer.<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $ service network restart\u00a0 Or restart computer<\/p>\n<ul>\n<li>When the machine boots up check the proc settings.<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $ cat \/proc\/net\/bonding\/bond0<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Ethernet Channel Bonding Driver: v3.0.2 (March 23, 2006)<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 Bonding Mode: adaptive load balancing<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 Primary Slave: None<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 Currently Active Slave: eth2<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 MII Status: up<\/p>\n<p>vii)\u00a0\u00a0 MII Polling Interval (ms): 100<\/p>\n<p>viii)\u00a0 Up Delay (ms): 0<\/p>\n<p>ix)\u00a0\u00a0\u00a0\u00a0 Down Delay (ms): 0<\/p>\n<p>x)\u00a0\u00a0\u00a0\u00a0\u00a0 Slave Interface: eth2<\/p>\n<p>xi)\u00a0\u00a0\u00a0\u00a0 MII Status: up<\/p>\n<p>xii)\u00a0\u00a0 Link Failure Count: 0<\/p>\n<p>xiii)\u00a0 Permanent HW addr: 00:14:72:80: 62:f0<\/p>\n<ul>\n<li>Look at ifconfig -a and check that your bond0 interface is active. You are done!<\/li>\n<li>RHEL bonding supports 7 possible \u201cmodes\u201d for bonded interfaces. These modes determine the way in which traffic sent out of the bonded interface is actually dispersed over the real interfaces. Modes 0, 1, and 2 are by far the most commonly used among them.<\/li>\n<li>\u00b7* Mode 0 (balance-rr)<\/li>\n<li>This mode transmits packets in a sequential order from the first available slave through the last. If two real interfaces are slaves in the bond and two packets arrive destined out of the bonded interface the first will be transmitted on the first slave and the second frame will be transmitted on the second slave. The third packet will be sent on the first and so on. This provides load balancing and fault tolerance.<\/li>\n<li>* Mode 1 (active-backup)<\/li>\n<li>This mode places one of the interfaces into a backup state and will only make it active if the link is lost by the active interface. Only one slave in the bond is active at an instance of time. A different slave becomes active only when the active slave fails. This mode provides fault tolerance.<\/li>\n<li>* Mode 2 (balance-xor)<\/li>\n<li>Transmits based on XOR formula. (Source MAC address is XOR\u2019d with destination MAC address) modula slave count. This selects the same slave for each destination MAC address and provides load balancing and fault tolerance.<\/li>\n<li>* Mode 3 (broadcast)<\/li>\n<li>This mode transmits everything on all slave interfaces. This mode is least used (only for specific purpose) and provides only fault tolerance.<\/li>\n<li>* Mode 4 (802.3ad)<\/li>\n<li>This mode is known as Dynamic Link Aggregation mode. It creates aggregation groups that share the same speed and duplex settings. This mode requires a switch that supports IEEE 802.3ad Dynamic link.<\/li>\n<li>* Mode 5 (balance-tlb)<\/li>\n<li>This is called as Adaptive transmit load balancing. The outgoing traffic is distributed according to the current load and queue on each slave interface. Incoming traffic is received by the current slave.<\/li>\n<li>* Mode 6 (balance-alb)<\/li>\n<li>This is Adaptive load balancing mode. This includes balance-tlb + receive load balancing (rlb) for IPV4 traffic. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the server on their way out and overwrites the src hw address with the unique hw address of one of the slaves in the bond such that different clients use different hw addresses for the server.<\/li>\n<\/ul>\n<p>82\u00a0\u00a0\u00a0 What are LVM Snapshots<\/p>\n<ul>\n<li>\u201clvcreate \u2013size 100m \u2013snapshot \u2013name snap \/dev\/vg00\/lvol1?<\/li>\n<li>\u00a0Ceates a snapshot logical volume named \/dev\/vg00\/snap which has access to the contents of the original logical volume named \/dev\/vg00\/lvol1 at snapshot logical volume creation time.\u00a0 If\u00a0 the\u00a0 original logical\u00a0 volume\u00a0 contains\u00a0 a\u00a0 file\u00a0 system, you can mount the snapshot logical volume on an arbitrary directory in order to access the contents of the filesystem\u00a0 to\u00a0 run\u00a0 a\u00a0 backup\u00a0 while\u00a0 the\u00a0 original filesystem continues to get updated.<\/li>\n<\/ul>\n<p>83\u00a0\u00a0\u00a0 How to backup MySQL using LVM Snapshot<\/p>\n<ul>\n<li>First login to mysql and lock all tables. This will ensure that no update operations are performed on LVM mount point<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Mysql&gt; flush tables with read lock;<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Mysql&gt; flush logs;<\/p>\n<ul>\n<li>Now create LVM Snapshot of \/dev\/vg01\/mysql (mounted as \/var\/lib\/mysql)<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # lvcreate \u2013snapshot \u2013size=1000M \u2013name=db-snapshot \/dev\/vg01\/mysql<\/p>\n<ul>\n<li>Now login to MySQL and release the lock<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Mysql&gt; unlock tables;<\/p>\n<ul>\n<li>Now move the backup to Tape or another server<\/li>\n<\/ul>\n<p>i)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # find \/dev\/vg01\/db-snapshot | cpio -o -H tar -F \/dev\/nst0<\/p>\n<p>ii)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 OR<\/p>\n<p>iii)\u00a0\u00a0\u00a0\u00a0 # mount \u2013o ro \/dev\/vg01\/db-snapshot \/mnt<\/p>\n<p>iv)\u00a0\u00a0\u00a0\u00a0 # cd \/mnt<\/p>\n<p>v)\u00a0\u00a0\u00a0\u00a0\u00a0 # tar cvfz mysql.tar * (# tar cvfz \/dev\/st0 \/mnt)<\/p>\n<p>vi)\u00a0\u00a0\u00a0\u00a0 # cd<\/p>\n<p>vii)\u00a0\u00a0 # umount \/mnt<\/p>\n<p>viii)\u00a0 # lvremove \u2013f \/dev\/vg01\/db-snapshot<\/p>\n<p>84\u00a0\u00a0\u00a0 Explain in detail what is LVM Snapshot<\/p>\n<ul>\n<li>It is a feature of Linux which creates virtual image of a device. This image will then keep track of the changes being made to the origin.<\/li>\n<li>Example, If you have 1000mb data logical volume out of which 800mb is already used. Now you take a lvm-snapshot of this volume with size 1000mb. Then this snapshot will be able to keep a track of changes made to origin data volume till next 200mb. After 200mb usage on data volume, our snapshot will become INVALID.<\/li>\n<li>The size of snapshot need to be chosen by admin looking at the amount of expected level of changes in data (origin)<\/li>\n<\/ul>\n<p>85\u00a0\u00a0\u00a0 What does lvdiskscan shows<\/p>\n<ul>\n<li>Shows block devices which can be used as physical volumes<\/li>\n<\/ul>\n<p>86\u00a0\u00a0\u00a0 How to scan for volumes<\/p>\n<ul>\n<li>pvscan, vgscan, lvscan<\/li>\n<\/ul>\n<h2>Cluster Administration<\/h2>\n<p>1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What is a Cluster<\/p>\n<ul>\n<li>A cluster is two or more computers (called as nodes or members) that works together to perform a taks.<\/li>\n<\/ul>\n<p>2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What are the types of cluster<\/p>\n<ul>\n<li>Storage<\/li>\n<li>High Availability<\/li>\n<li>Load Balancing<\/li>\n<li>High Performance<\/li>\n<\/ul>\n<p>3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What is CMAN<\/p>\n<ul>\n<li>CMAN is Cluster Manager. It manages cluster quorum and cluster membership.<\/li>\n<li>CMAN runs on each node of a cluster<\/li>\n<\/ul>\n<p>4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What is Cluster Quorum<\/p>\n<ul>\n<li>Quorum is a voting algorithm used by CMAN.<\/li>\n<li>CMAN keeps a track of cluster quorum by monitoring the count of number of nodes in cluster.<\/li>\n<li>If more than half of members of a cluster are in active state, the cluster is said to be in Quorum<\/li>\n<li>If half or less than half of the members are not active, the cluster is said to be down and all cluster activities will be stopped<\/li>\n<li>Quorum is defined as the minimum set of hosts required in order to provide service and is used to prevent split-brain situations.<\/li>\n<li>The quorum algorithm used by the RHCS cluster is called \u201csimple majority quorum\u201d, which means that more than half of the hosts must be online and communicating in order to provide service.<\/li>\n<\/ul>\n<p>5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What is split-brain<\/p>\n<ul>\n<li>It is a condition where two instances of the same cluster are running and trying to access same resource at the same time, resulting in corrupted cluster integrity<\/li>\n<li>Cluster must maintain quorum to prevent split-brain issues<\/li>\n<\/ul>\n<p>6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What is Quorum disk<\/p>\n<ul>\n<li>In case of a 2 node cluster, quorum disk acts as a tie-breaker and prevents split-brain issue<\/li>\n<li>If a node has access to network and quorum disk, it is active<\/li>\n<li>If a node has lost access to network or quorum disk, it is inactive and can be fenced<\/li>\n<li>A Quorum disk, known as a qdisk is small partition on SAN storage used to enhance quorum. It generally carries enough votes to allow even a single node to take quorum during a cluster partition. It does this by using configured heuristics, that is custom tests, to decided which which node or partition is best suited for providing clustered services during a cluster reconfiguration.<\/li>\n<\/ul>\n<p>7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What is RGManager<\/p>\n<ul>\n<li>RGManager manages and provides failover capabilities for collections of cluster resources called services, resource groups, or resource trees.<\/li>\n<li>In the event of a node failure, RGManager will relocate the clustered service to another node with minimal service disruption. You can also restrict services to certain nodes, such as restricting\u00a0 httpd to one group of nodes while\u00a0 mysql can be restricted to a separate set of nodes.<\/li>\n<li>When the cluster membership changes, openais tells the cluster that it needs to recheck it\u2019s resources. This causes rgmanager, the resource group manager, to run. It will examine what changed and then will start, stop, migrate or recover cluster resources as needed.<\/li>\n<li>Within rgmanager, one or more resources are brought together as a service. This service is then optionally assigned to a failover domain, an subset of nodes that can have preferential ordering.<\/li>\n<\/ul>\n<p>8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 What is Fencing<\/p>\n<ul>\n<li>Fencing is the disconnection of a node from the cluster\u2019s shared storage. Fencing cuts off I\/O from shared storage, thus ensuring data integrity. The cluster infrastructure performs fencing through the fence daemon,\u00a0 fenced.<\/li>\n<li>Power fencing \u2014 A fencing method that uses a power controller to power off an inoperable node.<\/li>\n<li>storage fencing \u2014 A fencing method that disables the Fibre Channel port that connects storage to an inoperable node.<\/li>\n<li>Other fencing \u2014 Several other fencing methods that disable I\/O or power of an inoperable node, including IBM Bladecenters, PAP, DRAC\/MC, HP ILO, IPMI, IBM RSA II, and others.<\/li>\n<\/ul>\n<p>9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 How to manually fence an inactive node<\/p>\n<ul>\n<li><b># fence_ack_manual \u2013n &lt;node2&gt;<\/b><\/li>\n<\/ul>\n<p>10\u00a0\u00a0\u00a0\u00a0\u00a0 How to see shared IP address (Cluster Resource) if ipconfig doesn\u2019t show it<\/p>\n<ul>\n<li><b># ip addr list<\/b><\/li>\n<\/ul>\n<p>11\u00a0\u00a0\u00a0\u00a0\u00a0 What is DLM<\/p>\n<ul>\n<li>A lock manager is a traffic cop who controls access to resources in the cluster<\/li>\n<li>As implied in its name, DLM is a distributed lock manager and runs in each cluster node; lock management is distributed across all nodes in the cluster. GFS2 and CLVM use locks from the lock manager.<\/li>\n<\/ul>\n<p>12\u00a0\u00a0\u00a0\u00a0\u00a0 What is Conga<\/p>\n<ul>\n<li>This is a comprehensive user interface for installing, configuring, and managing Red Hat High Availability Add-On.<\/li>\n<li>Luci \u2014 This is the application server that provides the user interface for Conga. It allows users to manage cluster services. It can be run from outside cluster environment.<\/li>\n<li>Ricci \u2014 This is a service daemon that manages distribution of the cluster configuration. Users pass configuration details using the Luci interface, and the configuration is loaded in to corosync for distribution to cluster nodes. Luci is accessible only among cluster members.<\/li>\n<\/ul>\n<p>13\u00a0\u00a0\u00a0\u00a0\u00a0 What is OpenAis or Corosync<\/p>\n<ul>\n<li>OpenAIS is the heart of the cluster. All other computers operate though this component, and no cluster component can work without it. Further, it is shared between both Pacemaker and RHCS clusters.<\/li>\n<li>In Red Hat clusters, openais is configured via the central cluster.conf file. In Pacemaker clusters, it is configured directly in openais.conf.<\/li>\n<\/ul>\n<p>14\u00a0\u00a0\u00a0\u00a0\u00a0 What is ToTem<\/p>\n<ul>\n<li>The totem protocol defines message passing within the cluster and it is used by openais. A token is passed around all the nodes in the cluster, and the timeout in fencing is actually a token timeout. The counter, then, is the number of lost tokens that are allowed before a node is considered dead.<\/li>\n<li>The totem protocol supports something called \u2018rrp\u2019, Redundant Ring Protocol. Through rrp, you can add a second backup ring on a separate network to take over in the event of a failure in the first ring. In RHCS, these rings are known as \u201cring 0? and \u201cring 1?.<\/li>\n<\/ul>\n<p>15\u00a0\u00a0\u00a0\u00a0\u00a0 What is CLVM<\/p>\n<ul>\n<li>CLVM is ideal in that by using DLM, the distributed lock manager, it won\u2019t allow access to cluster members outside of openais\u2019s closed process group, which, in turn, requires quorum.<\/li>\n<li>It is ideal because it can take one or more raw devices, known as \u201cphysical volumes\u201d, or simple as PVs, and combine their raw space into one or more \u201cvolume groups\u201d, known as VGs. These volume groups then act just like a typical hard drive and can be \u201cpartitioned\u201d into one or more \u201clogical volumes\u201d, known as LVs. These LVs are where Xen\u2019s domU virtual machines will exist and where we will create our GFS2 clustered file system.<\/li>\n<\/ul>\n<p>16\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0What is GFS2<\/p>\n<ul>\n<li>It works much like standard filesystem, with user-land tools like mkfs.gfs2, fsck.gfs2 and so on. The major difference is that it and clvmd use the cluster\u2019s distributed locking mechanism provided by the dlm_controld daemon. Once formatted, the GFS2-formatted partition can be mounted and used by any node in the cluster\u2019s closed process group. All nodes can then safely read from and write to the data on the partition simultaneously.<\/li>\n<\/ul>\n<p>17\u00a0\u00a0\u00a0\u00a0\u00a0 What is the importance of DLM<\/p>\n<ul>\n<li>One of the major roles of a cluster is to provide distributed locking on clustered storage. In fact, storage software can not be clustered without using DLM, as provided by the dlm_controld daemon and using openais\u2019s virtual synchrony via CPG.<\/li>\n<li>Through DLM, all nodes accessing clustered storage are guaranteed to get POSIX locks, called plocks, in the same order across all nodes. Both CLVM and GFS2 rely on DLM, though other clustered storage, like OCFS2, use it as well.<\/li>\n<\/ul>\n<p>18\u00a0\u00a0\u00a0\u00a0\u00a0 What is CCS_TOOL<\/p>\n<ul>\n<li>we can use ccs_tool, the \u201ccluster configuration system (tool)\u201d, to push the new cluster.conf to the other node and upgrade the cluster\u2019s version in one shot.<\/li>\n<li>ccs_tool update \/etc\/cluster\/cluster.conf<\/li>\n<\/ul>\n<p>19\u00a0\u00a0\u00a0\u00a0\u00a0 What is CMAN_TOOL<\/p>\n<ul>\n<li>It is a Cluster Manger tool, it can be used to\u00a0<i>view nodes and status<\/i>\u00a0of cluster<\/li>\n<li>Cman_tool nodes<\/li>\n<li>Cman_tool status<\/li>\n<\/ul>\n<p>20\u00a0\u00a0\u00a0\u00a0\u00a0 What is clusstat<\/p>\n<ul>\n<li>Clusstat is used to see what state the cluster\u2019s\u00a0<i>resources<\/i>\u00a0are in<\/li>\n<\/ul>\n<p>21\u00a0\u00a0\u00a0\u00a0\u00a0 What is clusvadm<\/p>\n<ul>\n<li>Clusvadm is a tool to manage resource in a cluster<\/li>\n<li>clusvcadm -e &lt;service&gt; -m &lt;node&gt;: Enable the &lt;service&gt; on the specified &lt;node&gt;. When a &lt;node&gt; is not specified, the local node where the command was run is assumed.<\/li>\n<li>clusvcadm -d &lt;service&gt; -m &lt;node&gt;: Disable the &lt;service&gt;.<\/li>\n<li>clusvcadm -l &lt;service&gt;: Locks the &lt;service&gt; prior to a cluster shutdown. The only action allowed when a &lt;service&gt; is frozen is disabling it. This allows you to stop the &lt;service&gt; so that rgmanager doesn\u2019t try to recover it (restart, in our two services). Once quorum is dissolved and the cluster is shut down, the service is unlocked and returns to normal operation next time the node regains quorum.<\/li>\n<li>clusvcadm -u &lt;service&gt;: Unlocks a &lt;service&gt;, should you change your mind and decide not to stop the cluster.<\/li>\n<\/ul>\n<p>22\u00a0\u00a0\u00a0\u00a0\u00a0 What is Luci_admin init<\/p>\n<ul>\n<li>This command is run to create Luci Admin user and set password for it<\/li>\n<li>Service luci start, chckconfig luci on<\/li>\n<li>Default port for Luci web server is 8084<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><b>Common Ports and Protocols<\/b><\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td><b>Port (IP Protocols)<\/b><\/td>\n<td><b>Service\/Protocol<\/b><\/td>\n<\/tr>\n<tr>\n<td>21 (TCP)<\/td>\n<td>FTP<\/td>\n<\/tr>\n<tr>\n<td>22 (TCP\/UDP)<\/td>\n<td>SSH\/\u00a0SFTP<\/td>\n<\/tr>\n<tr>\n<td>25 and 587 (TCP)<\/td>\n<td>SMTP<\/td>\n<\/tr>\n<tr>\n<td>53 (TCP\/UDP)<\/td>\n<td>DNS<\/td>\n<\/tr>\n<tr>\n<td>80 (TCP\/UDP)<\/td>\n<td>HTTP<\/td>\n<\/tr>\n<tr>\n<td>110 (TCP)<\/td>\n<td>POP3<\/td>\n<\/tr>\n<tr>\n<td>143 (TCP\/UDP)<\/td>\n<td>IMAP<\/td>\n<\/tr>\n<tr>\n<td>389 (TCP\/UDP)<\/td>\n<td>LDAP<\/td>\n<\/tr>\n<tr>\n<td>443 (TCP\/UDP)<\/td>\n<td>HTTPS<\/td>\n<\/tr>\n<tr>\n<td>465 (TCP)<\/td>\n<td>SMTPS<\/td>\n<\/tr>\n<tr>\n<td>636 (TCP\/UDP)<\/td>\n<td>LDAPS<\/td>\n<\/tr>\n<tr>\n<td>694 (UDP)<\/td>\n<td>Heartbeat<\/td>\n<\/tr>\n<tr>\n<td>873 (TCP)<\/td>\n<td>rsync<\/td>\n<\/tr>\n<tr>\n<td>3306 (TCP\/UDP)<\/td>\n<td>MySQL<\/td>\n<\/tr>\n<tr>\n<td>5900 (TCP\/UDP)<\/td>\n<td>VNC<\/td>\n<\/tr>\n<tr>\n<td>6660-6669 (TCP)<\/td>\n<td>IRC<\/td>\n<\/tr>\n<tr>\n<td>8080 (TCP)<\/td>\n<td>Apache Tomcat<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>The inetd Super Server<\/b><\/p>\n<p>Programs that provide application services via the network are called network daemons . A daemon is a program that opens a port, most commonly a well-known service port, and waits for incoming connections on it. If one occurs, the daemon creates a child process that accepts the connection, while the parent continues to listen for further requests. This mechanism works well, but has a few disadvantages; at least one instance of every possible service you wish to provide must be active in memory at all times. In addition, the software routines that do the listening and port handling must be replicated in every network daemon.<\/p>\n<p>To overcome these inefficiencies, most Unix installations run a special network daemon, what you might consider a\u00a0<b>\u201csuper server.\u201d<\/b>\u00a0This daemon creates sockets on behalf of a number of services and listens on all of them simultaneously. When an incoming connection is received on any of these sockets, the super server accepts the connection and spawns the server specified for this port, passing the socket across to the child to manage. The server then returns to listening.<\/p>\n<p>The most common super server is called\u00a0<b>inetd<\/b>\u00a0, the Internet Daemon. It is started at system boot time and takes the list of services it is to manage from a startup file named\u00a0<b>\/etc\/inetd.conf<\/b>\u00a0. In addition to those servers, there are a number of trivial services performed by\u00a0<b>inetd<\/b>\u00a0itself called internal services . They include\u00a0<b>chargen<\/b>\u00a0, which simply generates a string of characters, and\u00a0<b>daytime<\/b>\u00a0, which returns the system\u2019s idea of the time of day.<\/p>\n<p>Services managed by inetd daemon are ftp, tftp, chargen, daytime, finger, etc<\/p>\n<p><b>Running TOP Command in batch<\/b><\/p>\n<p>top -b -d 10 -n 3 &gt;&gt; top-file<\/p>\n<p>This command will run TOP in \u2013b(batch) mode, with a delay (-d) of 10 seconds and 3(-n) times.<\/p>\n<p><b>To write multiple files at the same time using TEE<\/b><\/p>\n<p>ps | tee file1 file2 file3<\/p>\n<p>This will send output of ps command to multiple files at the same time use TEE Command<\/p>\n<p><b>Use IOStat to get Disk and CPU usage<\/b><\/p>\n<p>iostat -x 10 10<\/p>\n<p>This will show stats for 10 times, every 10 seconds<\/p>\n<p><b>Memory usage monitoring using VMSTAT<\/b><\/p>\n<p>vmstat -x 10 10<\/p>\n<p>This command shows memory stats every 10 seconds for 10 times<\/p>\n<p>procs \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0memory \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0swap \u00a0 \u00a0 \u00a0 \u00a0io \u00a0 \u00a0 \u00a0 system \u00a0 \u00a0cpu<br \/>r \u00a0b \u00a0 swpd \u00a0 free \u00a0 buff \u00a0cache \u00a0 \u00a0 \u00a0 \u00a0 si \u00a0 so \u00a0 \u00a0bi \u00a0 \u00a0bo \u00a0 \u00a0 in \u00a0 \u00a0cs \u00a0 \u00a0 \u00a0 us sy id wa<br \/>2 \u00a05 375912 \u00a019548 \u00a017556 477472 \u00a0 \u00a00 \u00a0 \u00a01 \u00a0 \u00a0 0 \u00a0 \u00a0 0 \u00a0 \u00a0 \u00a01 \u00a0 \u00a0 1 \u00a0 \u00a0 \u00a0 \u00a01 \u00a00 \u00a00 \u00a01<\/p>\n<p><b>proc:<\/b><\/p>\n<p>r: Process that are waiting for CPU time<\/p>\n<p>b: Process that are waiting for I\/O<\/p>\n<p><b>Memory:<\/b><\/p>\n<p>Swapd: Shows how many blocks (1KB) are swapped out(paged) to disk<\/p>\n<p>Free: Idle memory<\/p>\n<p>Buff: Memory used as buffer, before\/after I\/O operation<\/p>\n<p>Cache: Memory used as cache by OS<\/p>\n<p><b>SWAP:<\/b><\/p>\n<p>Si: Blocks per sec swapped in (From swap area(disk) to memory(RAM))<\/p>\n<p>So: Blocks per sec swapped out (From memory(RAM) to swap area(disk))<\/p>\n<p><b>IO:<\/b><\/p>\n<p>Bi: Blocks per sec received from block device \u2013 Read Hard Disk<\/p>\n<p>Bo: Blocks per sec sent to block device \u2013 Write Hard Disk<\/p>\n<p><b>System:<\/b><\/p>\n<p>In: No. of interrupts per sec<\/p>\n<p>Cs: No. of context switches per sec (storing and restoring state of CPU. This enables multiple processes to share a single CPU)<\/p>\n<p><b>CPU:<\/b><\/p>\n<p>Us: % of CPU used for running non-kernel code (user process)<\/p>\n<p>Sys: % of CPU used for running kernel code (system time, network, I\/O, clock etc)<\/p>\n<p>Id: CPU idle time in %<\/p>\n<p>Wa: % of time spent by CPU in waiting for I\/O<\/p>\n<p><b>Listing Dynamic Dependencies (LDD)<\/b><\/p>\n<p>ldd \/bin\/ls<\/p>\n<p>This command will list all the dependent missing libraries for ls command<\/p>\n<p><b>List Open Files (LSOF)<\/b><\/p>\n<p>To list all open files in system<\/p>\n<p>lsof<\/p>\n<p>To list all open files by a particular process<\/p>\n<p>lsof \u2013p &lt;pid&gt;<\/p>\n<p>To list all open files by a user<\/p>\n<p>lsof \u2013u &lt;name&gt;<\/p>\n<p>To list all open files in a partition<\/p>\n<p>lsof | grep \/dev\/sda1<\/p>\n<p>To list files\/command\/pid LISTENING to any port<\/p>\n<p>lsof | grep LISTEN<\/p>\n<p>To list files\/command\/pid listening to 6366<\/p>\n<p>lsof | grep 6366<\/p>\n<p>To list open IPV4 ports<\/p>\n<p>lsof \u2013i4<\/p>\n<p>To list open IP v6 ports open<\/p>\n<p>lsof \u2013i6<\/p>\n<p>To list files\/operations running on nas directory<\/p>\n<p>lsof +d \/mnt\/nas<\/p>\n<p>This is extremely useful in unmounting a directory when it shows message \u2018device is busy\u2019<\/p>\n<p><b>Commands for checking System Load<\/b><\/p>\n<ul>\n<li>Uptime<\/li>\n<li>Top<\/li>\n<li>Vmstat<\/li>\n<li>Free<\/li>\n<li>IOTop<\/li>\n<li>HTop<\/li>\n<li>aTOP<\/li>\n<\/ul>\n<p><b>Using TOP<\/b><\/p>\n<p>After running top command<\/p>\n<p>Shift+m (or M) for sort by %MEM<\/p>\n<p>n \u00e0 20 \u00e0 for showing only 20 lines in output<\/p>\n<p>Shift+o (or O) \u00e0 k \u00e0 Enter \u00e0 to sort output by %CPU<\/p>\n<p>Shift + w (or W) \u00e0 To save the configuration<\/p>\n<p>P \u2013 Sort by CPU usage<\/p>\n<p>T \u2013 Sort by cumulative time<\/p>\n<p>z \u2013 Color display<\/p>\n<p>k \u2013 Kill a process<\/p>\n<p>q \u2013 quit<\/p>\n<p><b>Understanding OUTPUT of TOP Command<\/b><\/p>\n<p>The first line in top:<\/p>\n<p><b>top \u2013 22:09:08 up 14 min,\u00a0 1 user,\u00a0 load average: 0.21, 0.23, 0.30<\/b><\/p>\n<p>\u201c22:09:08? is the current time; \u201cup 14 min\u201d shows how long the system has been up for; \u201c1 user\u201d how many users are logged in; \u201cload average: 0.21, 0.23, 0.30? the load average of the system (1minute, 5 minutes, 15 minutes).<\/p>\n<p>Load average is an extensive topic and to understand its inner workings can be daunting. The simplest of definitions states that load average is the cpu utilization over a period of time. A load average of 1 means your cpu is being fully utilized and processes are not having to wait to use a CPU. A load average above 1 indicates that processes need to wait and your system will be less responsive. If your load average is consistently above 3 and your system is running slow you may want to upgrade to more CPU\u2019s or a faster CPU.<\/p>\n<p>The second line in top:<\/p>\n<p><b>Tasks:\u00a0 82 total,\u00a0\u00a0 1 running,\u00a0 81 sleeping,\u00a0\u00a0 0 stopped,\u00a0\u00a0 0 zombie<\/b><\/p>\n<p>Shows the number of processes and their current state.<\/p>\n<p>The third line in top:<\/p>\n<p><b>Cpu(s):\u00a0 9.5%us, 31.2%sy,\u00a0 0.0%ni, 27.0%id,\u00a0 7.6%wa,\u00a0 1.0%hi, 23.7%si,\u00a0 0.0%st<\/b><\/p>\n<p>Shows CPU utilization details. \u201c9.5%us\u201d user processes are using 9.5%; \u201c31.2%sy\u201d system processes are using 31.2%; \u201c27.0%id\u201d percentage of available cpu; \u201c7.6%wa\u201d time CPU is waiting for IO.<\/p>\n<p>When first analyzing the Cpu(s) line in top look at the %id to see how much cpu is available. If %id is low then focus on %us, %sy, and %wa to determine what is using the CPU.<\/p>\n<p>The fourth and fifth lines in top:<\/p>\n<p><b>Mem:\u00a0\u00a0\u00a0 255592k total,\u00a0\u00a0 167568k used,\u00a0\u00a0\u00a0 88024k free,\u00a0\u00a0\u00a0 25068k buffers<\/b><\/p>\n<p><b>Swap:\u00a0\u00a0 524280k total,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0k used,\u00a0\u00a0 524280k free,\u00a0\u00a0\u00a0 85724k cached<\/b><\/p>\n<p>Describes the memory usage. These numbers can be misleading. \u201c255592k total\u201d is total memory in the system; \u201c167568K used\u201d is the part of the RAM that currently contains information; \u201c88024k free\u201d is the part of RAM that contains no information; \u201c25068K buffers and 85724k cached\u201d is the buffered and cached data for IO.<\/p>\n<p>So what is the actual amount of free RAM available for programs to use ?<\/p>\n<p>The answer is: free + (buffers + cached)<\/p>\n<p>88024k + (25068k + 85724k) = 198816k<\/p>\n<p>How much RAM is being used by progams ?<\/p>\n<p>The answer is: used \u2013 (buffers + cached)<\/p>\n<p>167568k \u2013 (25068k + 85724k) = 56776k<\/p>\n<p>The processes information:<\/p>\n<p>Top will display the process using the most CPU usage in descending order. Lets describe each column that represents a process.<\/p>\n<p><b>\u00a0PID USER\u00a0\u00a0\u00a0\u00a0\u00a0 PR\u00a0 NI\u00a0 VIRT\u00a0 RES\u00a0 SHR S %CPU %MEM\u00a0\u00a0\u00a0 TIME+\u00a0 COMMAND<\/b><\/p>\n<p><b>3166 apache\u00a0\u00a0\u00a0 15\u00a0\u00a0 0 29444 6112 1524 S\u00a0 6.6\u00a0 2.4\u00a0\u00a0 0:00.79 httpd<\/b><\/p>\n<p>PID \u2013 process ID of the process<\/p>\n<p>USER \u2013 User who is running the process<\/p>\n<p>PR \u2013 The priority of the process<\/p>\n<p>NI \u2013 Nice value of the process (higher value indicates lower priority, -20 is highest, 19 is lowest)<\/p>\n<p>VIRT \u2013 The total amount of virtual memory used<\/p>\n<p>RES \u2013 Resident memory used<\/p>\n<p>SHR \u2013 Amount of shared memory used<\/p>\n<p>S \u2013 State of the task. Values are S (sleeping), D (uninterruptible sleep), R (running), Z(zombies), or T (stopped or traced)<\/p>\n<p>%CPU \u2013 Percentage of CPU used<\/p>\n<p>%MEM \u2013 Percentage of Memory used<\/p>\n<p>TIME+ \u2013 Total CPU time used by process<\/p>\n<p>COMMAND \u2013 Command issued<\/p>\n<p><b>Using Free<\/b><\/p>\n<p>Free \u2013m<\/p>\n<p>Actual Usage is shown<\/p>\n<p>-\/+ bufferes\/cache: 51 202<\/p>\n<p>It means out of 254MB, 51MB is used by running programs. So I have 202MB to play with and for my other application to grow into.<\/p>\n<p><b>Using Fuser<\/b><\/p>\n<p>It gives information about file user or the process that is currently using the file\/directory<\/p>\n<p>fuser \u2013v \/etc\/init.d\/httpd<\/p>\n<p>USER\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PID ACCESS COMMAND<\/p>\n<p>\/etc\/init.d\/httpd:<\/p>\n<p>root\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2652 \u2026e. httpd<\/p>\n<p>apache\u00a0\u00a0\u00a0 28592 \u2026e. httpd<\/p>\n<p>apache\u00a0\u00a0\u00a0 28595 \u2026e. httpd<\/p>\n<ul>\n<li>c\u00a0\u00a0\u00a0\u00a0\u00a0 current directory<\/li>\n<li>e\u00a0\u00a0\u00a0\u00a0\u00a0 executable being run<\/li>\n<li>f\u00a0\u00a0\u00a0\u00a0\u00a0 open file. f is omitted in default display mode<\/li>\n<li>F\u00a0\u00a0\u00a0\u00a0\u00a0 open file for writing. F is omitted in default display mode<\/li>\n<li>r\u00a0\u00a0\u00a0\u00a0\u00a0 root directory<\/li>\n<li>m\u00a0\u00a0\u00a0\u00a0\u00a0 map\u2019ed file or shared library<\/li>\n<\/ul>\n<p>To find and kill a PID using Fuser:<\/p>\n<p>fuser \u2013v \u2013k -i \/etc\/init.d\/httpd<\/p>\n<p><strong>TAR<\/strong><\/p>\n<p>Extract individual file from archive<\/p>\n<p>tar xvjf dest.tar.bz2 textfile.txt<\/p>\n<p>Add a file to existing archive<\/p>\n<p>tar rvf dest.tar myfile.txt<\/p>\n<p>Add a directory to existing archive<\/p>\n<p>tar rvf dest.tar myfolder\/<\/p>\n<p>Delete a file from existing archive<\/p>\n<p>tar \u2013delete -vf dest.tar myfile.txt<\/p>\n<p>Delete a folder from existing archive<\/p>\n<p>tar \u2013delete -vf dest.tar myfolder\/<\/p>\n<p>Exclude a file from being archived<\/p>\n<p>tar cvf dest.tar \u2013exclude=\u2019myfile.txt\u2019 myfolder\/<\/p>\n<p>Use a exclude list<\/p>\n<p>tar cvf dest.tar -X exclude.txt myfolder\/<\/p>\n<p><b>How to use CPIO<\/b><\/p>\n<p>GNU cpio is a tool for creating and extracting archives, or copying files from one place to another. It handles a number of cpio formats as well as reading and writing tar files. cpio command works just like tar, only better. It can read input from the \u201cfind\u201d command.<\/p>\n<p># find \/ -name \u201c*.c\u201d | cpio -o \u2013format=tar &gt; c-file.backup.tar<\/p>\n<p># find \/ -iname \u201c*.pl\u201d | cpio -o -H tar &gt; perl-files.tar<\/p>\n<p># find \/ -iname \u201c*.pl\u201d | cpio -o -H tar -F perl-files.tar<\/p>\n<p># cpio -i -F perl-files.tar<\/p>\n<p># cpio -it -F perl-files.tar<\/p>\n<ul>\n<li>-o: Create archive<\/li>\n<li>-F: Archive filename to use instead of standard input or output. To use a tape drive on another machine as the archive.<\/li>\n<li>-H format: Specify file format to use.<\/li>\n<li>-i: Restore archive<\/li>\n<li>-t: List files in archive<\/li>\n<\/ul>\n<p>Archive contents to tape \/dev\/nst0<\/p>\n<p># find \/home | cpio -o -H tar -F \/dev\/nst0<\/p>\n<p>Restore contents from tape<\/p>\n<p># cpio -i -F \/dev\/nst0<\/p>\n<p>Backup \/home to remote system tape drive<\/p>\n<p># find \/home | cpio -o -H tar -F user@backup.domain.com:\/dev\/nst0 \u2013rsh-command=\/usr\/bin\/ssh<\/p>\n<h3>Package installation using APT\/Dpkg (Debian, Ubuntu)<\/h3>\n<ul>\n<li>Install package:<\/li>\n<\/ul>\n<pre>aptitude install PACKAGENAME<\/pre>\n<ul>\n<li>Reinstall package:<\/li>\n<\/ul>\n<pre>aptitude reinstall PACKAGENAME<\/pre>\n<ul>\n<li>Remove package (keep config files):<\/li>\n<\/ul>\n<pre>aptitude remove PACKAGENAME<\/pre>\n<ul>\n<li>Remove package and purge config files:<\/li>\n<\/ul>\n<pre>aptitude remove --purge PACKAGENAME<\/pre>\n<ul>\n<li>Update package list:<\/li>\n<\/ul>\n<pre>aptitude update<\/pre>\n<ul>\n<li>Upgrade system (security\/bug fixes):<\/li>\n<\/ul>\n<pre>aptitude upgrade<\/pre>\n<ul>\n<li>Upgrade system to newest release (dangerous!):<\/li>\n<\/ul>\n<pre>aptitude dist-upgrade<\/pre>\n<ul>\n<li>Show info on an installed package:<\/li>\n<\/ul>\n<pre>aptitude show PACKAGENAME<\/pre>\n<ul>\n<li>Search package repositories:<\/li>\n<\/ul>\n<pre>aptitude search SEARCHSTRING<\/pre>\n<h3>Package installation using Yum\/RPM (CentOS, Fedora, Red Hat)<\/h3>\n<ul>\n<li>Install package:<\/li>\n<\/ul>\n<pre>yum install PACKAGENAME<\/pre>\n<ul>\n<li>Remove package:<\/li>\n<\/ul>\n<pre>yum remove PACKAGENAME<\/pre>\n<ul>\n<li>Update package:<\/li>\n<\/ul>\n<pre>yum update PACKAGENAME<\/pre>\n<ul>\n<li>List available updates:<\/li>\n<\/ul>\n<pre>yum list updates<\/pre>\n<ul>\n<li>Update system:<\/li>\n<\/ul>\n<pre>yum update<\/pre>\n<ul>\n<li>Upgrade system to newest release (dangerous!):<\/li>\n<\/ul>\n<pre>yum upgrade<\/pre>\n<ul>\n<li>Show package:<\/li>\n<\/ul>\n<pre>yum list PACKAGENAME<\/pre>\n<ul>\n<li>Search package repositories:<\/li>\n<\/ul>\n<pre>yum search SEARCHSTRING<\/pre>\n<ul>\n<li>List package groups:<\/li>\n<\/ul>\n<pre>yum grouplist<\/pre>\n<ul>\n<li>Install package group:<\/li>\n<\/ul>\n<pre>yum groupinstall 'GROUP NAME'<\/pre>\n<ul>\n<li>Update package group:<\/li>\n<\/ul>\n<pre>yum groupupdate 'GROUP NAME'<\/pre>\n<ul>\n<li>Remove package group:<\/li>\n<\/ul>\n<pre>yum groupremove 'GROUP NAME'<\/pre>\n<ul>\n<li>Download RPM file without installing it:<\/li>\n<\/ul>\n<pre>yum install yum-utils.noarch\r\nyumdownloader httpd<\/pre>\n<ul>\n<li>How to extract files from RPM without installing it:<\/li>\n<\/ul>\n<pre>rpm2cpio httpd* | cpio \u2013idmv<\/pre>\n<ul>\n<ul>\n<li>i = restore mode<\/li>\n<li>d = create directories wherever necessary<\/li>\n<li>m = retain time stamps<\/li>\n<li>v = verbose mode<\/li>\n<\/ul>\n<li>How to build RPM from tar\n<ul>\n<li>rpmbuild \u2013ta abc.tar<\/li>\n<li>rpm \u2013ivh \/usr\/src\/redhat\/RPMS\/[arch]\/abc.xxx.[arch].rpm<\/li>\n<\/ul>\n<\/li>\n<li>How to build RPM from spec\n<ul>\n<li>rpmbuild \u2013ba package.spec<\/li>\n<li>Install rpmbuild if \u2018command not found\u2019 by \u2018yum install rpm-build\u2019 command<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>SUID, SGID, Sticky Bit<\/b><\/p>\n<p>What\u2019s that about SUID, SGID, and the sticky bit (oh my!)? Once again, a table seems appropriate\u2026<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td><b>Access<\/b><\/td>\n<td><b>File<\/b><\/td>\n<td><b>Directory<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>SUID (setuid) (4)<\/b><\/td>\n<td>File executes with rights of its owner (not the user who executed it)<\/td>\n<td>Ignored<\/td>\n<\/tr>\n<tr>\n<td><b>SGID (setgid) (2)<\/b><\/td>\n<td>File executes with rights of its group (not the user who executed it)<\/td>\n<td>Files created within directory inherit the directory\u2019s group memberships (rather than the creator\u2019s group memberships)<\/td>\n<\/tr>\n<tr>\n<td><b>Sticky Bit (1)<\/b><\/td>\n<td>Ignored<\/td>\n<td>Files created within directory may only be moved or deleted by their owner (or directory\u2019s owner)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This probably isn\u2019t intuitive, so we\u2019ll go over it in a bit more detail. First, the sticky bit. One place the sticky bit is commonly used on Unix-like systems is the \/tmp directory. This directory needs to be world-writable, but you don\u2019t want anyone going around and deleting everyone else\u2019s files. The sticky bit offers exactly this protection.<\/p>\n<p>The Sticky Bit is a permission bit that can be set on either a file or a directory.<\/p>\n<p>If it is set on a file, then that file will remain in memory after execution, thus sticking in memory. This is useful when running a multi-user program (such as a bulletin board system that I ran once) to make the program execute faster for the next user. This was a common programming tactic earlier in the history of computer programming when speed and disk space were at a premium.\u00a0<b>This feature is UNIX specific. This feature is not used in LINUX. Sticky Bit used on a file is USELESS in LINUX.<\/b>\u00a0It was useful when fast disk access and memory access technologies were not around. So in today\u2019s age concept of Sticky Bit is obsolete.<\/p>\n<p>If the sticky bit is set on a directory, only the owner of files in that directory will be able to modify or delete files in that directory \u2013 even if the permissions set on those files would otherwise allow it.<\/p>\n<p><b>RSync for backup<\/b><\/p>\n<p>rsync -e \u2018ssh -p 30000? -avl \u2013delete \u2013stats \u2013progress \u2013-exclude \u2018source\u2019 \u2013exclude \u2018source\/file.txt\u2019 \u2013exclude-from \u2018\/root\/exclude.txt\u2019 demo@123.45.67.890:\/home\/demo \/backup<\/p>\n<p>-e \u2018ssh \u2013p 30000\u2019 \u00e0 This ensures rsync uses the SSH protocol and sets the port to 30000<\/p>\n<p>-a \u00e0 Archive mode, retains the permissions of file<\/p>\n<p>-v \u00e0 Verbose mode<\/p>\n<p>-vv \u00e0 Double verbosity<\/p>\n<p>-l \u00e0 Preserves links<\/p>\n<p>\u2013delete \u00e0 Delete files from destination folder that have been deleted from source folder<\/p>\n<p>\u2013stats \u00e0 Gives Transfer Statistics<\/p>\n<p>\u2013progress \u00e0 Progress of each file transfer, useful for rysncing large files<\/p>\n<p>\u2013exclude \u00e0 exclude directory or file from being backed up<\/p>\n<p>\u2013exclude-from \u00e0 exclude the list of file\/folders written in exclude.txt<\/p>\n<p><b>Logs on Linux<\/b><\/p>\n<p>Some of the common log files and directories you might see in \/var\/log:<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td><b>Filename(s)<\/b><\/td>\n<td><b>Purpose<\/b><\/td>\n<\/tr>\n<tr>\n<td>auth.log<\/td>\n<td>Authentication logs<\/td>\n<\/tr>\n<tr>\n<td>boot.log<\/td>\n<td>Boot logs<\/td>\n<\/tr>\n<tr>\n<td>btmp<\/td>\n<td>Invalid login attempts<\/td>\n<\/tr>\n<tr>\n<td>cron<\/td>\n<td>Cron logs<\/td>\n<\/tr>\n<tr>\n<td>daemon.log<\/td>\n<td>Logs for specific services (daemons)<\/td>\n<\/tr>\n<tr>\n<td>dmesg<\/td>\n<td>Kernel boot messages<\/td>\n<\/tr>\n<tr>\n<td>httpd\/<\/td>\n<td>Apache logs<\/td>\n<\/tr>\n<tr>\n<td>kern.log<\/td>\n<td>Kernel logs<\/td>\n<\/tr>\n<tr>\n<td>mail*<\/td>\n<td>Mail server logs<\/td>\n<\/tr>\n<tr>\n<td>messages<\/td>\n<td>General\/all logs<\/td>\n<\/tr>\n<tr>\n<td>mysql*<\/td>\n<td>MySQL logs<\/td>\n<\/tr>\n<tr>\n<td>secure<\/td>\n<td>Security\/authentication logs<\/td>\n<\/tr>\n<tr>\n<td>syslog<\/td>\n<td>All system logs<\/td>\n<\/tr>\n<tr>\n<td>wtmp<\/td>\n<td>User logins and logouts<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>VPN Tunneling on CentOS using OpenVPN<\/b><\/p>\n<p>3 Types of tunneling available:<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Simple VPN (no security or encryption)<\/p>\n<p>Server 1<\/p>\n<p>\/usr\/sbin\/openvpn \u2013remote 10.100.1.50 \u2013dev tun1 \u2013ifconfig 172.16.1.1 172.16.1.2<\/p>\n<p>Server 2<\/p>\n<p>\/usr\/sbin\/openvpn \u2013remote 10.100.1.20 \u2013dev tun1 \u2013ifconfig 172.16.1.2 172.16.1.1<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Static Key VPN (simply 128-bit security)<\/p>\n<p>Server 1<\/p>\n<p>openvpn \u2013genkey \u2013secret key<\/p>\n<p>scp key root@10.100.1.20:\/usr\/share\/doc\/openvpn-2.0.9\/<\/p>\n<p>\/usr\/sbin\/openvpn \u2013remote 10.100.1.50 \u2013dev tun1 \u2013ifconfig 172.16.1.1 172.16.1.2 \u2013secret key<\/p>\n<p>Server 2<\/p>\n<p>\/usr\/sbin\/openvpn \u2013remote 10.100.1.20 \u2013dev tun1 \u2013ifconfig 172.16.1.2 172.16.1.1 \u2013secret key<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Full TLS VPN (revolving-key encryption)<\/p>\n<p><b>Simple Load Balancing with APACHE MOD_PROXY<\/b><\/p>\n<p>&lt;VirtualHost *:80&gt;<\/p>\n<p>ProxyRequests off<\/p>\n<p>ServerName domain.com<\/p>\n<p>&lt;Proxy balancer:\/\/mycluster&gt;<\/p>\n<p># WebHead1<\/p>\n<p>BalancerMember\u00a0<a href=\"http:\/\/10.176.42.144\/\" rel=\"nofollow\">http:\/\/10.176.42.144:80<\/a><\/p>\n<p># WebHead2<\/p>\n<p>BalancerMember\u00a0<a href=\"http:\/\/10.176.42.148\/\" rel=\"nofollow\">http:\/\/10.176.42.148:80<\/a><\/p>\n<p># Security \u201ctechnically we aren\u2019t blocking<\/p>\n<p># anyone but this the place to make those<\/p>\n<p># chages<\/p>\n<p>Order Deny,Allow<\/p>\n<p>Deny from none<\/p>\n<p>Allow from all<\/p>\n<p># Load Balancer Settings<\/p>\n<p># We will be configuring a simple Round<\/p>\n<p># Robin style load balancer.\u00a0 This means<\/p>\n<p># that all webheads take an equal share of<\/p>\n<p># of the load.<\/p>\n<p>ProxySet lbmethod=byrequests<\/p>\n<p>&lt;\/Proxy&gt;<\/p>\n<p># balancer-manager<\/p>\n<p># This tool is built into the mod_proxy_balancer<\/p>\n<p># module and will allow you to do some simple<\/p>\n<p># modifications to the balanced group via a gui<\/p>\n<p># web interface.<\/p>\n<p>&lt;Location \/balancer-manager&gt;<\/p>\n<p>SetHandler balancer-manager<\/p>\n<p># I recommend locking this one down to your<\/p>\n<p># your office<\/p>\n<p>Order deny,allow<\/p>\n<p>Allow from all<\/p>\n<p>&lt;\/Location&gt;<\/p>\n<p># Point of Balance<\/p>\n<p># This setting will allow to explicitly name the<\/p>\n<p># the location in the site that we want to be<\/p>\n<p># balanced, in this example we will balance \u201c\/\u201d<\/p>\n<p># or everything in the site.<\/p>\n<p>ProxyPass \/balancer-manager\u00a0!<\/p>\n<p>ProxyPass \/ balancer:\/\/mycluster\/<\/p>\n<p>&lt;\/VirtualHost&gt;<\/p>\n<h3>mysqld and mysqld_safe<\/h3>\n<p>Behind the scenes there are actually two versions of the MySQL server, \u201cmysqld\u201d and \u201cmysqld_safe\u201d. Both read the same config sections. The main difference is that mysqld_safe launches with a few more safety features enabled to make it easier to recover from a crash or other problem.<\/p>\n<p>Both mysqld and mysqld_safe will read config entries in the \u201cmysqld\u201d section. If you include a \u201cmysqld_safe\u201d section, then only mysqld_safe will read those values in.<\/p>\n<p><b>To LOCK and UNLOCK all tables in MySQL (Useful for backup\/LVM Snapshot)<\/b><\/p>\n<p>mysql -u root -p\u201dpassword\u201d -e \u201cFLUSH TABLES WITH READ LOCK;\u201d<\/p>\n<p>mysql -u root -p\u201dpassword\u201d -e \u201cUNLOCK TABLES;\u201d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1 Q. Which command is used to check the number of files and disk space used and the each user\u2019s defined quota<\/p>\n<p> Repquota , it shows filesystem, no. of blocks used, soft and hard limit, no. of files used, soft and hard limits <\/p>\n<p>2 What is the name and path of the main system log<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1982"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1982"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1982\/revisions"}],"predecessor-version":[{"id":1984,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1982\/revisions\/1984"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}