Monday, February 21, 2011

Linux QA

1) linux boot process

2) What is the minimum number of partitions you need to install Linux?
A: Well You only need 2 partitions to install Linux one is the root partition / and other is the swap partition ,you can install linux without creating /boot ,it will automatically created under /

3) What command can you use to review boot messages?
A: dmesg

4) What command is used to remove the password assigned to a group?
a: gpasswd -r groupname
The gpasswd command is used to change the group password assigned to a group. Use the -r option to remove the password from the group.

5) What daemon is responsible for tracking events on your system
A: Syslogd is the daemon to track the events of the system

6) What command you execute to display the last five commands you have entered?
A: history|tail -5 but the thing is 5 will display even current command so use history 6 to show past 5 commands.

7) Which partitions might you create on mail server HDDs other than the root, swap and boot partitions?
A: /var

8) Which partitioning tool is available in all distributions?
A: fdisk, parted

9) Which two commands can you use to delete directories?
A: rm -fr, rmdir

10) Which file defines all users on your system?
A: /etc/passwd

11) What is difference between user right and user permission?
A: User right is the authentication to log into a computer system.
user permission is the authentication to access any data when you are logged in to a system.
A person who has right can only be given permission to read and write or both

12) Describe the boot process of your favorite Linux in as much detail as you can.
A: Boot process takes place in 4 scenes with 4 main characters.

Scene 1
when the computer is switched on,it automatically invokes BIOS[a ROM chip embedded in the motherboard].The BIOS will start the processor and perform a POST[power on self test] to check whether the connected device are ready to use and are working properly.
Once the POST is completes BIOS will jump to a specified location in the RAM and check for the booting device.The boot sector is always the first sector of the hard disk and BIOS will load the MBR into the memory.

Scene 2
Here the boot loader takes the control of the booting process.LILO or GRUB are the boot loaders commonly available. It will help the user to select various boot options.Depending on the boot option selected the kernel is loaded.

scene 3

After kernel is loaded the kernel will take the control of the booting process and it will initialize all the hardwares including I/O processors etc.kernel then creates a root device and mounts the partitions.

Scene 4
INIT is loaded.

13) What is difference between AT and CRON?
A: At is used to schedule a job only once, while crontab is used to schedule recurring jobs.

14) What command would you type to use the cpio to create a backup called backup.cpio of all the users' home directories?
A: find /home | cpio -o > backup.cpio
The find command is used to create a list of the files and directories contained in home. This list is then piped to the cpio utility as a list of files to include and the output is saved to a file called backup.cpio.

15) What is contained in the directory /proc?
Choose one:
a. System information
b. Administrative procedures
c. Boot procedures
d. Documentation on your system
A: The /proc directory is a virtual filesystem that contains system information.
/proc/cpuinfo
/proc/partition
/proc/irq
/proc/swap
/proc/meminfo

16) 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.
A: The 0 gives read and write and execute permissions for owner and group and the 2 gives read and execute permissions for others. Ans. is b.
A: permission is 775.
answer B is right.
because full permission is.. total permission - umask = permission of contents.
A: Ans: a
By default the Directory permission is 777 - umask
so here 777 - 002 ==> 775
And File Permission is 666 - umask so it will be 666 - 002 ==> 664
so the Files we create will have read write permission set for owner and group and read permission set for others

17) What is the real mean of DHCP?
A: Dynamic addressing simplifies network administration because the s/w keeps track of IP addresses rather than requiring an administrator to manage the task.That means new computer can be added to the network without any risk of manually assigning unique IP address.

18) What is max RAM size?
A: the swap size should be 1.5 to 2 times the size of ur RAM...although the swap uses only 2gb of space at a time of the total swap..so if u have more then 2gb RAM, u can create more than 1 swap of max size of 2gb.

19) What utility can you use to automate rotation of logs?
A: Answer: logrotate
The logrotate command can be used to automate the rotation of various logs.

20) What can you type at a command line to determine which shell you are using?
A: echo $SHELL
The name and path to the shell you are using is saved to the SHELL environment variable. You can then use the echo command to print out the value of any variable by preceding the variable's name with $. Therefore, typing echo $SHELL will display the name of your shell.
There are different types of shell are available in Linux:-
1-c shell
2-ksh
3-tcsh
4-/bin
5-nologin

21) What file contains the default environment variables when using the bash shell?
Choose one:
a. ~/.profile
b. /bash
c. /etc/profile
d. ~/bash
A: Answer: c
The /etc/profile file contains the system default environment variables for the bash shell.

22) In order to improve your system's security you decide to implement shadow passwords. What command should you use?
A: Answer: pwconv
The pwconv command creates the file /etc/shadow and changes all passwords to 'x' in the /etc/passwd file.

23) Which partitioning tool is available in all distributions?
A) Disk Druid
B) fdisk
C) Partition Magic
D) FAT32
E) System Commander
A: fdisk partition is available in all linux distrubition.

24) What is Kernel-Level Threads?
A: Kernel-level threads often are implemented in the kernel using several tables (each task gets a table of threads).
In this case, the kernel schedules each thread within the timeslice of each process.
There is a little more overhead with mode switching from user->kernel-> user and loading of larger contexts,
but initial performance measures indicate a negligible increase in time.
A: kernel thread is a process that always in kernal mode , it only accesses kernel address spaces , manageing kernel
activities that need to managed on an ongoing basis .(and not waiting for an interrupt or system call)
A: Consider process p1 has 5 threads. In Ready Queue 6 entities will be there.
6 entities = 1 for process + 5 for threads.
These threads are created and managed by Operating System.
In Kernel Level Threads Developer can't decide the sharing(means which thread has to share how much % of time).
Some standards will be there in kernel.According those standards that sharing will be decided.
So, single thread is one entity in Kernel.

If we have multi core system, then different threads can run on different processors.

No comments: