Linux Microsoft VMware
Showing posts with label Interview. Show all posts
Showing posts with label Interview. Show all posts

Wednesday, September 26, 2012

Basic's of Networking



1. Define Network?
A network is a set of devices connected by physical media links. A network is recursively is a connection of two or more nodes by a physical link or two or more networks connected by one or more nodes.

2. What is a Link?
At the lowest level, a network can consist of two or more computers directly connected by some physical medium such as coaxial cable or optical fiber. Such a physical medium is called as Link.

3. What is a node?
A network can consist of two or more computers directly connected by some physical medium such as coaxial cable or optical fiber. Such a physical medium is called as Links and the computer it connects is called as Nodes.

Tuesday, September 18, 2012

Troubleshooting Disk and Data store Related Issues  SHOOT:2


SHOOT: 2

VMFS Lock Volume is Corrupted

Details

You may observe the following events within the /var/log/vmkernel logs within your VMware ESX host:
Volume 4976b16c-bd394790-6fd8-00215aaf0626 (san-lun-100) may be damaged on disk. Corrupt lock detected at offset 0

Note: In this example 4976b16c-bd394790-6fd8-00215aaf0626 represents the UUID of the VMFS datastore and san-lun-100 represents the name of the VMFS datastore.
You may observe the following events within the /var/log/vmkernel logs within your VMware ESX host:
Resource cluster metadata corruption detected Volume 4976b16c-bd394790-6fd8-00215aaf0626 (san-lun-100) may be damaged on disk.

Troubleshooting Disk and Data store Related Issues  SHOOT:1


SHOOT: 1

Troubleshooting a VMFS resource volume that is corrupted

The event indicates the reported VMFS volume is corrupted.

Example

If 4976b16c-bd394790-6fd8-00215aaf0626 represents the UUID and san-lun-100 represents the associated volume label, you see:
For Event: vmfs.lock.corruptondisk

Wednesday, August 8, 2012

Basics of UNIX In Detail


What is UNIX?

UNIX is an operating system which was first developed in the 1960s, and has been under constant development ever since. By operating system, we mean the suite of programs which make the computer work. It is a stable, multi-user, multi-tasking system for servers, desktops and laptops.
UNIX systems also have a graphical user interface (GUI) similar to Microsoft Windows which provides an easy to use environment. However, knowledge of UNIX is required for operations which aren't covered by a graphical program, or for when there is no windows interface available, for example, in a telnet session.

Types of UNIX

There are many different versions of UNIX, although they share common similarities. The most popular varieties of UNIX are Sun Solaris, GNU/Linux, and MacOS X.
Here in the School, we use Solaris on our servers and workstations, and Fedora Core Linux on the servers and desktop PCs.

The UNIX operating system

The UNIX operating system is made up of three parts; the kernel, the shell and the programs.
The kernel
The kernel of UNIX is the hub of the operating system: it allocates time and memory to programs and handles the filestore and communications in response to system calls.
As an illustration of the way that the shell and the kernel work together, suppose a user types rm myfile (which has the effect of removing the file myfile). The shell searches the filestore for the file containing the program rm, and then requests the kernel, through system calls, to execute the program rm on myfile. When the process rm myfile has finished running, the shell then returns the UNIX prompt % to the user, indicating that it is waiting for further commands.

The shell

The shell acts as an interface between the user and the kernel. When a user logs in, the login program checks the username and password, and then starts another program called the shell. The shell is a command line interpreter (CLI). It interprets the commands the user types in and arranges for them to be carried out. The commands are themselves programs: when they terminate, the shell gives the user another prompt (% on our systems).
The adept user can customise his/her own shell, and users can use different shells on the same machine. Staff and students in the school have the tcsh shell by default.
The tcsh shell has certain features to help the user inputting commands.
Filename Completion - By typing part of the name of a command, filename or directory and pressing the [Tab] key, the tcsh shell will complete the rest of the name automatically. If the shell finds more than one name beginning with those letters you have typed, it will beep, prompting you to type a few more letters before pressing the tab key again.
History - The shell keeps a list of the commands you have typed in. If you need to repeat a command, use the cursor keys to scroll up and down the list or type history for a list of previous commands.

Files and Processes

Everything in UNIX is either a file or a process.
A process is an executing program identified by a unique PID (process identifier).
A file is a collection of data. They are created by users using text editors, running compilers etc.
Examples of files:
a document (report, essay etc.)
the text of a program written in some high-level programming language
instructions comprehensible directly to the machine and incomprehensible to a casual user, for example, a collection of binary digits (an executable or binary file);
a directory, containing information about its contents, which may be a mixture of other directories (subdirectories) and ordinary files.

The Directory Structure

All the files are grouped together in the directory structure. The file-system is arranged in a hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally called root (written as a slash / )



In the diagram above, we see that the home directory of the undergraduate student "ee51vn" contains two sub-directories (docs and pics) and a file called report.doc.
The full path to the file report.doc is "/home/its/ug1/ee51vn/report.doc"

Starting an UNIX terminal

To open an UNIX terminal window, click on the "Terminal" icon from the drop-down menus.



An UNIX Terminal window will then appear with a % prompt, waiting for you to start entering commands.



Commands

  • % ls (list), ls –l, ls –aà lists files and directories.
  • % mkdir unixstuffà make directory.
  • % rmdir unixstuffà remove directory.
·         % cd unixstuffà change directory. cd ..
·         % pwdà present working directory.
·         % ls ~à home directory.
·         % cp file1 file2à copies file.
·         % mv file1 file2à moves (or) renames file.
·         % rm file1à removes a file.
·         % clearà clears the screen.
·         % cat(concatenate) unix.txtà display contents of a file on the screen.
·         % less unix.txtà writes contents of a file onto the screen.
·         % head unix.txtà writes first ten lines of a file to the screen.
·         % tail unix.txtà writes last ten lines of a file to the screen.
·         % grep unix unix.txtà searches for specified words or pattern.
·         % wc unix.txtà word count.
·         % >à redirect o/p to a file.
·         % >>à append a existing file.
·         % sort < biglist > slistà redirect i/p of a command.
·         % who | sortà who is on the system.
·         % wildcardà % & *.
·         % man (or) whatis wcà online help and manuals.
·         % -rwxrwxrwxà user, group & other for read, write & execute.
·         % chmodà change a file mode.
·         % psà process is an executing program identified by a unique PID(process identifier).
·         % sleep 10à waits a given number of seconds.
·         % ^z & bgà suspends current process and background.
·         % jobsà job number. Example is suspended sleep 1000
  • % fg %jobnumber (or) %1à restart a suspended processes.
  • % kill %jobnumberà kill (or) suspend background process.
  • % psà process status.
  • % quota –và check your current quota. user allocated a certain amount of disk space, usually 100mb.
  • % dfà space left on the file system
  • % du –s *à o/p’s number of kb used by each subdirectory.
  • % gzip unix.txtà compress the file. & gunzip unix.txt.gzà expand the file.
  • % tar –cvf sample.tar sampleà compress sample directory & tar –xvf sample.tar
  • % zcatà used to read gzip w/o uncompress.
  • % file *à classifies the named files according to the type of data.
  • % diff file1 file2à compares contents of two files.
  • % find . –name “*.txt” –printà searches thru’ the directories for files and directories with a given name.
  • % historyà shows the history of commands.
  • % strip unitsà strip unnecessary code.
  • % echo $OSTYPEà environment variable, OSTYPE, USER, HOME, HOST, PATH, ARCH,PRINTER.
  • % echo $historyà shell variable, history, cwd, home, path, prompt.
  • % set | lessà shell variables are both set and displayed using the set command.
  • % .cshrcà used to set conditions and perform actions to the shell.
  • % nedit ~/.cshrcà opens cshrc in a text editor.
  • % set path=($path ~/units/bin)
% makeà The make command allows programmers to manage large programs or groups of programs. It aids in developing large programs by keeping track of which portions of the entire program have been changed, compiling only those parts of the program which have changed since the last compile.
The make program gets its set of compile rules from a text file called Makefile which resides in the same directory as the source files. It contains information on how to compile the software, e.g. the optimisation level, whether to include debugging info in the executable. It also contains information on where to install the finished compiled binaries (executables), manual pages, data files, dependent library files, configuration files, etc.

ftpàThe FTP (File Transfer Protocol) utility program is commonly used for copying files to and from other computers. These computers may be at the same site or at different sites thousands of miles apart. FTP is a general protocol that works on UNIX systems as well as a variety of other (non-UNIX) systems.

?
to request help or information about the FTP commands
ascii
to set the mode of file transfer to ASCII
(this is the default and transmits seven bits per character)
binary
to set the mode of file transfer to binary
(the binary mode transmits all eight bits per byte and thus provides less chance of a transmission error and must be used to transmit files other than ASCII files)
bye
to exit the FTP environment (same as quit)
cd
to change directory on the remote machine
close
to terminate a connection with another computer
 
close brubeck
closes the current FTP connection with brubeck,
  but still leaves you within the FTP environment.
delete
to delete (remove) a file in the current remote directory (same as rm in UNIX)
get
to copy one file from the remote machine to the local machine
 
get ABC DEF
copies file ABC in the current remote directory to (or on top of) a file named DEF in your current local directory.
 
get ABC
copies file ABC in the current remote directory to (or on top of) a file with the same name, ABC, in your current local directory.
help
to request a list of all available FTP commands
lcd
to change directory on your local machine (same as UNIX cd)
ls
to list the names of the files in the current remote directory
mkdir
to make a new directory within the current remote directory
mget
to copy multiple files from the remote machine to the local machine;
  you are prompted for a y/n answer before transferring each file
 
mget *
copies all the files in the current remote directory to your current local directory, using the same filenames. Notice the use of the wild card character, *.
mput
to copy multiple files from the local machine to the remote machine;
  you are prompted for a y/n answer before transferring each file
open
to open a connection with another computer
 
open brubeck
opens a new FTP connection with brubeck;
  you must enter a username and password for a brubeck account
      (unless it is to be an anonymous connection).
put
to copy one file from the local machine to the remote machine
pwd
to find out the pathname of the current directory on the remote machine
quit
to exit the FTP environment (same as bye)
rmdir
to to remove (delete) a directory in the current remote directory.

telnetà telnet protocol to connect to another remote computer.

-8
Specifies an 8-bit data path. Negotiating the TELNET BINARY option is attempted for both input and output.
-E
Stops any character from being recognized as an escape character.
-L
Specifies an 8-bit data path on output. This causes the BINARY option to be negotiated on output.
-c
Disables the reading of the user's telnetrc file.
-d
Sets the initial value of the debug toggle to
TRUE.
-r
Specifies a user interface similar to rlogin . In this mode, the escape character is set to the
tilde (~) character, unless modified by the -e option. The rlogin escape character is only recognized when it is preceded by a carriage return. In this mode, the telnet escape
character, normally '^]', must still precede a telnet command. The rlogin escape character
can also be followed by '.\r' or '^Z', and, like rlogin, closes or suspends the connection, respectively. This option is an uncommitted inter- face and may change in the future.
-e escape_char
Sets the initial escape character to escape_char. escape_char may also be a two character sequence consisting of '^' followed by one character. If the second character is '?', the DEL character is selected. Otherwise, the second character is converted to a control character and used as the escape character. If the escape character is the null string (that is, -e ''), it is disabled.
-l user
When connecting to a remote system that understands the ENVIRON option, then user will be sent to the remote system as the value for the ENVIRON variable USER.
-n file
Opens tracefile for recording trace information


/etc/services

ftpà 21/tcp  # File Transfer Protocol
telnetà 23/tcp # Telnet
smtpà 25/tcp # Simple Mail Transfer Protocol
tftpà 69/udp   # Trivial File Transfer Protocol
wwwà 80/tcp # World Wide Web
ntpà 123/tcp  # N/W Time Protocol
ntpà 123/udp  # N/W Time Protocol

                                                         

Tuesday, August 7, 2012

What are the files Extension available in VMware Virtualization?


What are the files Extension available in VMware Virtualization?

.log                             <vmname>.log or vmware.log
This is the file that keeps a log of key VMware Workstation activity. This file can be useful in troubleshooting if you encounter problems. This file is stored in the directory that holds the configuration (.vmx) file of the virtual machine.

.nvram                       <vmname>.nvram or nvram
This is the file that stores the state of the virtual machine's BIOS.

.vmdk                         <vmname>.vmdk
This is a virtual disk file, which stores the contents of the virtual machine's hard disk drive. A virtual disk is made up of one or more .vmdk files. If you have specified that the virtual disk should be split into 2GB chunks, the number of .vmdk files depends on the size of the virtual disk. As data is added to a virtual disk, the .vmdk files grow in size, to a maximum of 2GB each. (If you specify that all space should be allocated when you create the disk, these files start at the maximum size and do not grow.) Almost all of a .vmdk file's content is the virtual machine's data, with a small portion allotted to virtual machine overhead. If the virtual machine is connected directly to a physical disk, rather than to a virtual disk, the .vmdk file stores information about the partitions the virtual machine is allowed to access. Earlier VMware products used the extension .dsk for virtual disk files.

<diskname>-<###>.vmdk
This is a redo-log file, created automatically when a virtual machine has one or more snapshots. This file stores changes made to a virtual disk while the virtual machine is running. There may be more than one such file. The ### indicates a unique suffix added automatically by VMware Workstation to avoid duplicate file names.

.vmsd                         <vmname>.vmsd
This is a centralized file for storing information and metadata about snapshots.

.vmsn                         <vmname>-Snapshot.vmsn
This is the snapshot state file, which stores the running state of a virtual machine at the time you take that snapshot.

<vmname>-Snapshot<###>.vmsn
This is the file which stores the state of a snapshot

.vmss                                     <vmname>.vmss
This is the suspended state file, which stores the state of a suspended virtual machine. Some earlier VMware products used the extension .std for suspended state files


.vmtm                        <vmname>.vmtm
This is the configuration file containing team data.

.vmx                           <vmname>.vmx
This is the primary configuration file, which stores settings chosen in the New Virtual Machine Wizard or virtual machine settings editor. If you created the virtual machine under an earlier version of VMware Workstation on a Linux host, this file may have a .cfg extension.

.vmxf                          <vmname>.vmxf
This is a supplemental configuration file for virtual machines that are in a team. Note that the .vmxf file remains if a virtual machine is removed from the team.

.VMDK -- These files are the actual hard disk of the virtual machine itself, and tend to be the largest file within the folder. You can consider the size of this file to be roughly equivalent to the size of either the disk itself (if you've chosen to use preallocated disks) or the size of the data currently stored on that disk (if you use growable disks).

.NVRAM -- Consider this file the BIOS of the virtual machine.

.VMX -- With typically one VMX file per folder, this file holds the configuration information for the virtual machine in a text format. Unlike almost all the other files you'll see, these files can be edited using any text editing program, a process that is actually required for some functionality that is not exposed in the GUI.

.VMXF -- This file, in XML format, includes additional information about the virtual machine if it has been added to a team. If a machine has been added to a team and then later removed, this file remains resident. This file can also be opened and read in a text editor.

.VMTM -- For virtual machines actively participating in a team, this file stores information about that team membership.

.VMEM -- These files, which contain a backup of the VMs paging file, are typically very small or non-existent when the virtual machine is powered off, but grow immediately to the size of configured RAM when the machine is powered on.

.VMSN and .VMSD -- When snapshots are created for a virtual machine, these files are created to host the state of the virtual machine. The VMSN file stores the running state of the machine, what you could consider the "delta" between the VMDK at the point of the snapshot and what has been processed up until the present time. The VMSD stores information and metadata about the snapshot itself.

.VMSS -- If you've suspected the state of your machine, this file contains the suspended state of that machine. These files typically only appear when virtual machines have been suspended.

Wednesday, November 9, 2011

Linux Interview Questions

Linux Interview Questions and Answers

What command can you use to review boot messages?
Ans: dmseg

What are seven fields in the /etc/passwd file.
Ans: Username:uid:groupname:gid:passwd:comment:home directory

You have two files in two different directories with the same inode. What type of link is involved?
Ans: Hard links

Which daemon controls the network service -> POP3 mail service? A) inetd B) pop3d C) maild D) nntpd E) pmaild
Ans: A - The inetd superdaemon

How to exclude ip address in dhcp? my ranges are 192.168.1.2 192.168.1.20 then how do i exclude different ip's like 192.168.1.4 and 7 and 10 from the range please help me out
Ans: subnet 192.168.1.0 netmask 255.255.255.0
{
range 192.168.1.2 192.168.1.3;
range 192.168.1.5 192.168.1.6;
range 192.168.1.8 192.168.1.9;
}

You attempt to use shadow passwords but are unsuccessful. What characteristic of the /etc/passwd file may cause this? Choose one: a. The login command is missing. b. The username is too long. c. The password field is blank. d. The password field is prefaced by an asterick.
Ans: c

The password field must not be blank before converting to shadow passwords.
What daemon is responsible for tracking events on your system?
Ans: syslogd or rsyslogd

You need to see the last fifteen lines of the files dog, cat and horse. What command should you use?
Answer: tail -15 dog cat horse

Which file do you edit to set up a printer? A) /etc/printtab.conf B) /etc/print.conf C) /etc/lp.conf D) /etc/printtab E) /etc/printers
Answer: D - The file /etc/printab

Your default umask is 002. What does this mean? Choose one: a. Any file you create will have the permissions set as owner and group having read and write permissions; others as read only. b. Any file you create will have the permissions set as owner and group having read, write and execute permissions; others as read and execute. c. Any directoy you create will have the permissions set as owner and group having read, write and execute permissions; others as read and write permissions. d. Any directory you create will have the permissions set as owner and group having read and write permissions; others as read only.
Answer: A

If you type the command cat dog &> cat what would you see on your display? Choose one: a. Any error messages only. b. The contents of the file dog. c. The contents of the file dog and any error messages. d. Nothing as all output is saved to the file cat.
Answer: d

When typing at the command line, the default editor is the _____________ library.
Answer: readline
In order to improve your system's security you decide to implement shadow passwords. What command should you use?
Answer: pwconv

You attempt to use shadow passwords but are unsuccessful. What characteristic of the /etc/passwd file may cause this?
Ans: The password field must not be blank before converting to shadow passwords.

What account is created when you install Linux?
Answer: root

What is difference between AT and CRON?
Ans: Cron command is used to schedule the task daily at the same time repeatedly ,"at" command is used to schedule the task only once i.e to run only one time.

What command is used to remove the password assigned to a group?
Answer: gpasswd -r groupname

You are covering for another system administrator and one of the users asks you to restore a file for him. You locate the correct tarfile by checking the backup log but do not know how the directory structure was stored. What command can you use to determine this? Choose one: a. tar fx tarfile dirname b. tar tvf tarfile filename c. tar ctf tarfile d. tar tvf tarfile
Answer: d

Which of the following interprets your actions when typing at the command line for the operating system? Choose One a. Utility b. Application c. Shell d. Command
Answer: c

What key combination can you press to suspend a running job and place it in the background?
Answer: ctrl-z

What is contained in the directory /proc?
Choose one:

a. System information
b. Administrative procedures
c. Boot procedures
d. Documentation on your system
Answer: a

You would like to temporarily change your command line editor to be vi. What command should you type to change it?
Answer: set -o vi

Which partitioning tool is available in all distributions?
Answers: The fdisk

Powered by Blogger.