1. How to change the default run level in linux?

To change the run level we have to edit the file "/etc/inittab" and change initdefault entry ( id:5:initdefault:). Using 'init' command we change the run level temporary like 'init 3′ , this command will move the system in runlevl 3.

2. How to set umask permanently for a user?

To set this value permanently for a user, it has to be put in the appropriate profile file which depends on the default shell of the user.

3. What is umask?

umask stands for 'User file creation mask', which determines the settings of a mask that controls which file permissions are set for files and directories when they are created.

4. Where kernel modules are located?

The '/lib/modules/kernel-version/' directory stores all kernel modules or compiled drivers in Linux operating system. Also with 'lsmod' command we can see all the installed kernel modules.

5. How to create partition from the raw disk?

Using fdisk utility we can create partitions from the raw disk.Below are the steps to create partition from the raw dsik :
☛ fdisk /dev/hd* (IDE) or /dev/sd* (SCSI)
☛ Type n to create a new partition
☛ After creating partition , type w command to write the changes to the partition table.

6. How to reduce or shrink the size of LVM partition?

The logical Steps to reduce size of LVM partition :
☛ Umount the filesystem using umount command,
☛ use resize2fs command , e.g resiz2fs /dev/mapper/myvg-mylv 10G
☛ Now use the lvreduce command , e.g lvreduce -L 10G /dev/mapper/myvg-mylv
Above Command will shrink the size & will make the filesystem size 10GB.

7. How to increase the size of LVM partition?

☛ Use the lvextend command (lvextend -L +100M /dev/<Name of the LVM Partition> , in this example we are extending the size by 100MB.
☛ resize2fs /dev/<Name of the LVM Partition>
☛ check the size of partition using 'df -h' command

8. Tell me what does Sar provides and at which location Sar logs are stored?

Sar Collect, report, or save system activity information. The default version of the sar command (CPU utilization report) might be one of the first facilities the user runs to begin system activity investigation, because it monitors major system resources. If CPU utilization is near 100 percent (user + nice + system), the workload sampled is CPU-bound.

9. How To check memory stats and CPU stats in Linux?

Using 'free' & 'vmstat' command we can display the physical and virtual memory statistics respectively.With the help of 'sar' command we see the CPU utilization & other stats.

10. Why LVM is required in Linux?

LVM stands for Logical Volume Manager, to re-size filesystem's size online we required LVM partition in Linux. Size of LVM partition can be extended and reduced using the lvextend & lvreduce commands respectively.

Download Interview PDF