How would you list modules in the Kernel in Linux?

Module Commands
  1. depmod – handle dependency descriptions for loadable kernel modules.
  2. insmod – install loadable kernel module.
  3. lsmod – list loaded modules.
  4. modinfo – display information about a kernel module.
  5. modprobe – high level handling of loadable modules.
  6. rmmod – unload loadable modules.

2. What file allows you to update kernel parameters?

3. What is the main path of the main system log?

There are Three incorporated loggin evil spirits

1)syslogd

2)klogd

3)auditd

klogd:- gather log record made by the Kernel

syslogd:- Collect log record made by the framework

auditd:- Collect log record made by the SELinux

Subsequent to gathering the log framework store sign on various area

/var/log/dmesg:- Created at boot time, by piece

/var/log/messages:- standard framework blunder message,

/var/log/secure:- verification related log

/var/log/maillog:- Mial related log

/var/log/review/audit.log:- Selinux related log

We can divert the log by arranging

/and so forth/sysconfig/syslog

/and so forth/syslog.conf

4. If a volume group named vg0 already exists and we need to extend the volume group by 4GB. What command would you use?

5. How would you create a new local user account named user24 whose home directory is /home/24user?

6. What is the minimum hard disks for raid 5?

The minimum number of disks in a RAID 5 set is three (two for data and one for parity). The maximum number of drives in a RAID 5 set is in theory unlimited, although your storage array is likely to have built-in limits. However, RAID 5 only protects against a single drive failure.

7. Where is the location of grub.conf on a Red Hat system?

By default, a custom file named 40_custom is available for use in the /etc/grub.d folder. The primary configuration file for changing menu display settings is calledgrub and by default is located in the /etc/default folder

8. What network protocol does ping use?

ICMP(which is what ping uses) is implemented directly on top of IP packets and doesn’t use a transport layer (OSI layer 4) like TCP or UDP.

9. What is the subnet mask of a /24 network?

Prefix size Subnet mask Available subnets
24 255.255.255.0 1
25 255.255.255.128 2
26 255.255.255.192 4
27 255.255.255.224 8

 

Addresses Hosts Netmask Amount of a Class C
/30 4 2 255.255.255.252 1/64
/29 8 6 255.255.255.248 1/32
/28 16 14 255.255.255.240 1/16
/27 32 30 255.255.255.224 1/8
/26 64 62 255.255.255.192 1/4
/25 128 126 255.255.255.128 1/2
/24 256 254 255.255.255.0 1
/23 512 510 255.255.254.0 2
/22 1024 1022 255.255.252.0 4
/21 2048 2046 255.255.248.0 8
/20 4096 4094 255.255.240.0 16
/19 8192 8190 255.255.224.0 32
/18 16384 16382 255.255.192.0 64
/17 32768 32766 255.255.128.0 128
/16 65536 65534 255.255.0.0 256

Guide to sub-class C blocks

/25 — 2 Subnets — 126 Hosts/Subnet

Network # IP Range Broadcast
.0 .1-.126 .127
.128 .129-.254 .255

/30 — 64 Subnets — 2 Hosts/Subnet

Network # IP Range Broadcast
.0 .1-.2 .3
.4 .5-.6 .7
.8 .9-.10 .11
.12 .13-.14 .15
.16 .17-.18 .19
.20 .21-.22 .23
.24 .25-.26 .27
.28 .29-.30 .31
.32 .33-.34 .35
.36 .37-.38 .39
.40 .41-.42 .43
.44 .45-.46 .47
.48 .49-.50 .51
.52 .53-.54 .55
.56 .57-.58 .59
.60 .61-.62 .63
.64 .65-.66 .67
.68 .69-.70 .71
.72 .73-.74 .75
.76 .77-.78 .79
.80 .81-.82 .83
.84 .85-.86 .87
.88 .89-.90 .91
.92 .93-.94 .95
.96 .97-.98 .99
.100 .101-.102 .103
.104 .105-.106 .107
.108 .109-.110 .111
.112 .113-.114 .115
.116 .117-.118 .119
.120 .121-.122 .123
.124 .125-.126 .127
.128 .129-.130 .131
.132 .133-.134 .135
.136 .137-.138 .139
.140 .141-.142 .143
.144 .145-.146 .147
.148 .149-.150 .151
.152 .153-.154 .155
.156 .157-.158 .159
.160 .161-.162 .163
.164 .165-.166 .167
.168 .169-.170 .171
.172 .173-.174 .175
.176 .177-.178 .179
.180 .181-.182 .183
.184 .185-.186 .187
.188 .189-.190 .191
.192 .193-.194 .195
.196 .197-.198 .199
.200 .201-.202 .203
.204 .205-.206 .207
.208 .209-.210 .211
.212 .213-.214 .215
.216 .217-.218 .219
.220 .221-.222 .223
.224 .225-.226 .227
.228 .229-.230 .231
.232 .233-.234 .235
.236 .237-.238 .239
.240 .241-.242 .243
.244 .245-.246 .247
.248 .249-.250 .251
.252 .253-.254 .255

/26 — 4 Subnets — 62 Hosts/Subnet

Network # IP Range Broadcast
.0 .1-.62 .63
.64 .65-.126 .127
.128 .129-.190 .191
.192 .193-.254 .255

/27 — 8 Subnets — 30 Hosts/Subnet

Network # IP Range Broadcast
.0 .1-.30 .31
.32 .33-.62 .63
.64 .65-.94 .95
.96 .97-.126 .127
.128 .129-.158 .159
.160 .161-.190 .191
.192 .193-.222 .223
.224 .225-.254 .255

/28 — 16 Subnets — 14 Hosts/Subnet

Network # IP Range Broadcast
.0 .1-.14 .15
.16 .17-.30 .31
.32 .33-.46 .47
.48 .49-.62 .63
.64 .65-.78 .79
.80 .81-.94 .95
.96 .97-.110 .111
.112 .113-.126 .127
.128 .129-.142 .143
.144 .145-.158 .159
.160 .161-.174 .175
.176 .177-.190 .191
.192 .193-.206 .207
.208 .209-.222 .223
.224 .225-.238 .239
.240 .241-.254 .255

/29 — 32 Subnets — 6 Hosts/Subnet

Network # IP Range Broadcast
.0 .1-.6 .7
.8 .9-.14 .15
.16 .17-.22 .23
.24 .25-.30 .31
.32 .33-.38 .39
.40 .41-.46 .47
.48 .49-.54 .55
.56 .57-.62 .63
.64 .65-.70 .71
.72 .73-.78 .79
.80 .81-.86 .87
.88 .89-.94 .95
.96 .97-.102 .103
.104 .105-.110 .111
.112 .113-.118 .119
.120 .121-.126 .127
.128 .129-.134 .135
.136 .137-.142 .143
.144 .145-.150 .151
.152 .153-.158 .159
.160 .161-.166 .167
.168 .169-.174 .175
.176 .177-.182 .183
.184 .185-.190 .191
.192 .193-.198 .199
.200 .201-.206 .207
.208 .209-.214 .215
.216 .217-.222 .223
.224 .225-.230 .231
.232 .233-.238 .239
.240 .241-.246 .247
.248 .249-.254 .255

10. What file stores the user password information on a Red Hat system?

Linux passwords are stored in the /etc/shadow file. They are salted and the algorithm being used depends on the particular distribution and is configurable. From what I recall, the algorithms supported are MD5 , Blowfish , SHA256 and SHA512

11. Can you explain sysctl and where do you use it?

The Linux kernel is flexible, and you can even modify the way it works on the fly by dynamically changing some of its parameters, thanks to the sysctl command. Sysctl provides an interface that allows you to examine and change several hundred kernel parameters in Linux or BSD. Changes take effect immediately, and there’s even a way to make them persist after a reboot. By using sysctl judiciously, you can optimize your box without having to recompile your kernel, and get the results immediately.

To start getting a taste of what sysctl can modify, run sysctl -a and you will see all the possible parameters. The list can be quite long: in my current box there are 712 possible settings.


$ sysctl -a
kernel.panic = 0
kernel.core_uses_pid = 0
kernel.core_pattern = core
kernel.tainted = 129

…many lines snipped…

If you want to get the value of just a single variable, use something like sysctl vm.swappiness, or just sysctl vm to list all variables that start with “vm.” Add the -n option to output just the variable values, without the names; -N has the opposite effect, and produces the names but not the values.

You can change any variable by using the -w option with the syntax sysctl -w variable=value. For example, sysctl -w net.ipv6.conf.all.forwarding=1 sets the corresponding variable to true (0 equals “no” or “false”; 1 means “yes” or “true”) thus allowing IP6 forwarding. You may not even need the -w option — it seems to be deprecated. Do some experimenting on your own to confirm that.

For more information, run man sysctl to display the standard documentation.

sysctl values are loaded at boot time from the /etc/sysctl.conf file. This file can have blank lines, comments (lines starting either with a “#” character or a semicolon), and lines in the “variable=value” format. For example, my own sysctl.conf file is listed below. If you want to apply it at any time, you can do so with the command sysctl -p.


# Disable response to broadcasts.
net.ipv4.icmp_echo_ignore_broadcasts = 1

# enable route verification on all interfaces
net.ipv4.conf.all.rp_filter = 1

# enable ipV6 forwarding
net.ipv6.conf.all.forwarding = 1

# increase the number of possible inotify(7) watches
fs.inotify.max_user_watches = 65536

Getting somewhere?

With so many tunable parameters, how do you decide what to do? Alas, this is a sore point with sysctl: most of the relevant documentation is hidden in the many source files of the Linux kernel, and isn’t easily available, and it doesn’t help that the explanations given are sometime arcane and difficult to understand. You may find something in the /usr/src/linux/Documentation/sysctl directory, but most (if not all) files there refer to kernel 2.2, and seemingly haven’t been updated in the last several years.

Looking around for books on the subject probably won’t help much. I found hack #71 in O’Reilly’s Linux Server Hacks, Volume 2, from 2005, but that was about it. Several other books include references to sysctl, but as to specific parameters or hints, you are on your own.

As an experiment, I tried looking for information on the swappiness parameter, which can optimize virtual memory management. The /usr/src/Linux/Documentation/sysctl/vm.txt file didn’t even refer to it, probably because this parameter appeared around version 2.6 of the kernel. Doing a general search in the complete /usr/src/linux directory turned up five files that mention “swappiness”: three “include” (.h) files in include/linux, plus kernel/sysctl.c and mm/vmscan.c. The latter file included the information:

/*
* From 0 .. 100. Higher means more swappy.
*/
int vm_swappiness = 60;

That was it! You can see the default value (60) and a minimal reference to the field meaning. How helpful is that?

My suggestion would be to use sysctl -a to learn the available parameters, then Google around for extra help. You may find, say, an example of changing the shared memory allocation to solve a video program problem, or an explanation on vm.swappiness, or even more suggestions for optimizing IP4 network traffic.

sysctl shows yet another aspect of the great flexibility of Linux systems. While documentation for it is not widely available, learning its features and capabilities on your own can help you get even more performance out of your box. That’s system administration at its highest (or lowest?) level.

Q: What is an ‘inode’?

Ans: All UNIX files have its description stored in a structure called ‘inode’. The inode contains info about the file-size, its location, time of last access, time of last modification, permission and so on. Directories are also represented as files and have an associated inode.

Q: What are the process states in UNIX?

Ans: As a process executes it changes state according to its circumstances. Unix processes have the following states:
Running: The process is either running or it is ready to run . Waiting: The process is waiting for an event or for a resource. Stopped: The process has been stopped, usually by receiving a signal. Zombie: The processes are dead but have not been removed from the process table.

Q: What command should you use to check the number of files and disk space used and each user’s defined quotas?

Ans: repquota .

Q: What command is used to remove the password assigned to a group?

Ans: gpasswd –r .

Q: What can you type at a command line to determine which shell you are using ?

Ans: echo $SHELL .

Q:  Write a command to find all of the files which have been accessed within the last 30 days ?

Ans: find / -type f -atime -30 > filename.txt .

Q:8 What is a zombie ?

Ans: Zombie is a process state when the child dies before the parent process. In this case the structural information of the process is still in the process table.

Q: What daemon is responsible for tracking events on your system ?

Ans: syslogd.

Q: Tell me the name of directory structure hierarchy for Linux?

Ans: /root /boot /bin /sbin /proc /mnt /usr /var /lib /etc /dev /opt /srv /tmp /media .

Q: What does /boot directory contains?

Ans: The /boot/ directory contains static files required to boot the system, such as the Linux kernel, boot loader configuration files. These files are essential for the system to boot properly.

Q:13 If someone deletes /boot directory from your server, than what will happen?

Ans: The /boot/ directory contains static files required to boot the system, such as the Linux kernel, boot loader configuration files. These files are essential for the system to boot properly.

Q: What does /dev directory contain?

Ans: The /dev directory contains all device files that are attached to system or virtual device files that are provided by the kernel.

Q: What is the role of udev daemon?

Ans: The udev demon used to create and remove all these device nodes or files in /dev/ directory.

Q:16 What kind of files or nodes /dev/ directory contains and how do I access or see device files?

Ans: Block Device Files:-
Block device files talks to devices block by block [1 block at a time (1 block = 512 bytes to 32KB)]. Examples: – USB disk, CDROM, Hard Disk # ls /dev/sd*
brw-rw—- 1 root root 8,0 Mar 15 2009 sda
brw-rw—- 1 root root 8,1 Mar 15 2009 sda1
brw-rw—- 1 root root 8,2 Mar 15 2009 sda2
brw-rw—- 1 root root 8, 3 Mar 15 2009 sda3
brw-rw—- 1 root root 8, 4 Mar 15 2009 sda4
brw-rw—- 1 root root 8, 16 Mar 15 2009 sdb
Character Device Files:-
Character device files talk to devices character by character. Examples: – Virtual terminals, terminals, serial modems, random numbers #ls /dev/tty*
crw-rw—- 1 root root 4, 64 Mar 15 2009 ttyS0
crw-rw—- 1 root root 4,65 Mar 15 2009 ttyS1
crw-rw—- 1 root root 4,66 Mar 15 2009 ttyS2
crw-rw—- 1 root root 4,67 Mar 15 2009 ttyS3

Q:What does /etc/X11/ directory contains ?

Ans: The /etc/X11/ directory is for X Window System configuration files, such as xorg.conf.

Q: What does /etc/skell directory contains ?

Ans: The /etc/skel directory contains files and directories that are automatically copied over to a new user’s home directory when such user is created by the useradd or adduser command.

Q:21 Name Linux File systems ?

Ans: Ext2 Ext3 Ext4

Q: What is the difference between ext2 and ext3 file systems ?

Ans: The ext3 file system is an enhanced version of the ext2 file system.
The most important difference between Ext2 and Ext3 is that Ext3 supports journaling. After an unexpected power failure or system crash (also called an unclean system shutdown), each mounted ext2 file system on the machine must be checked for consistency by the e2fsck program. This is a time-consuming process and during this time, any data on the volumes is unreachable. The journaling provided by the ext3 file system means that this sort of file system check is no longer necessary after an unclean system shutdown. The only time a consistency check occurs using ext3 is in certain rare hardware failure cases, such as hard drive failures. The time to recover an ext3 file system after an unclean system shutdown does not depend on the size of the file system or the number of files; rather, it depends on the size of the journal used to maintain consistency. The default journal size takes about a second to recover, depending on the speed of the hardware.

Q: Explain ext4 file system in Linux ?

Ans: The ext4 or fourth extended filesystem is a journaling file system developed as the successor to ext3. Ext4 filesystem released as a functionally complete and stable filesystem in Linux with kernel version 2.6.28.
Features of ext4 file system:-
1. Currently, Ext3 supports 16 TB of maximum file system size and 2 TB of maximum file size. Ext4 have 1 EB of maximum file system size and 16 TB of maximum file size.
[An EB or exabyte is 1018 bytes or 1,048,576 TB] 2. Fast fsck check than ext3 3 In Ext4 the journaling feature can be disabled, which provides a small performance improvement. 4. Online defragmentation. 5. Delayed allocation Ext4 uses a filesystem performance technique called allocate-on-flush, also known as delayed allocation. It consists of delaying block allocation until the data is going to be written to the disk, unlike some other file systems, which may allocate the necessary blocks before that step.

Q: How can I  create ext3 file system on /dev/sda7 disk ?

Ans: mkfs –j /dev/sda7

Q: How Can I convert ext2 filesystem to ext3 file system ?

Ans: Yes, we can convert ext2 to ext3 file system by tune2fs command.
tune2fs –j /dev/

Q: How can I create ext4 file system ?

Ans: mmke2fs -t ext4 /dev/dev

Q: Explain /proc filesystem ?

Ans: /proc is a virtual filesystem that provides detailed information about Linux kernel, hardware’s and running processes. Files under /proc directory named as Virtual files. Because /proc contains virtual files that’s why it is called virtual file system. These virtual files have unique qualities. Most of them are listed as zero bytes in size. Virtual files such as /proc/interrupts, /proc/meminfo, /proc/mounts, and /proc/partitions provide an up-to-the-moment glimpse of the system’s hardware. Others, like the /proc/filesystems file and the /proc/sys/ directory provide system configuration information and interfaces.

Q: Can we change files parameters placed under /proc directory ?

Ans: Yes To change the value of a virtual file, use the echo command and a greater than symbol (>) to redirect the new value to the file. For example, to change the hostname on the fly, type: echo http://www.redhatbible.com > /proc/sys/kernel/hostname

Q: What is the use of sysctl command ?

Ans: The /sbin/sysctl command is used to view, set, and automate kernel settings in the /proc/sys/ directory.

Q:30 /proc/ directory contains a number of directories with numerical names. What is that ?

Ans: These directories are called process directories, as they are named after a program’s process ID and contain information specific to that process.

Q:31 What is RAID ?

Ans: RAID, stands for Redundant Array of Inexpensive Disks. RAID is a method by which same data or information is spread across several disks, using techniques such as disk striping (RAID Level 0), disk mirroring (RAID Level 1), and disk striping with parity (RAID Level 5) to achieve redundancy, lower latency, increased bandwidth, and maximized ability to recover from hard disk crashes.

Q:32 Why should we use RAID ?

Ans: TSystem Administrators and others who manage large amounts of data would benefit from using RAID technology.
Following are the reasons to use RAID – Enhances speed – Increases storage capacity using a single virtual disk – Minimizes disk failure.

Q:33 Why should we use RAID ?

Ans: System Administrators and others who manage large amounts of data would benefit from using RAID technology.
Following are the reasons to use RAID – Enhances speed – Increases storage capacity using a single virtual disk – Minimizes disk failure.

Q: What is the difference between hardware RAID and Software RAID?

Ans: The hardware-based RAID is independent from the host. A Hardware RAID device connects to the SCSI controller and presents the RAID arrays as a single SCSI drive. An external RAID system moves all RAID handling “intelligence” into a controller located in the external disk subsystem. The whole subsystem is connected to the host via a normal SCSI controller and appears to the host as a single disk.
Software RAID is implemented under OS Kernel level. The Linux kernel contains an MD driver that allows the RAID solution to be completely hardware independent. The performance of a software-based array depends on the server CPU performance and load.

Q: Explain RAID 0 ?

Ans: RAID level 0 works on “striping” technique. In RAID 0 the array is broken down into strips and data is written into strips. RAID 0 allows high I/O performance but provides no redundancy. RAID 0 Array Size is equal to sum of disks in array. If one drive fails then all data in the array is lost.

Q: Explain RAID 1 ?

Ans: RAID Level 1 is based on Mirroring technique. Level 1 provides redundancy by writing identical data to each member disk of the array. The storage capacity of the level 1 array is equal to the capacity of one of the mirrored hard disks in a Hardware RAID or one of the mirrored partitions in a Software RAID. RAID 1 provides redundancy means good protection against disk failure. In RAID 1 write speed is slow but read speed is good.

Q: Explain RAID 5?

Ans: RAID Level 5 is based on rotating parity with striping technique. RAID-5 stores parity information but not redundant data (but parity information can be used to reconstruct data). The storage capacity of Software RAID level 5 is equal to the capacity of the member partitions, minus the size of one of the partitions if they are of equal size. The performance of RAID 5 is based on parity calculation process but with modern CPUs that usually is not a very big problem. In RAID 5 read and write speeds are good.

Q: Which kernel module is required for Software RAID?

Ans: “md” module

===

Q: which utility or command is used for creating software RAID’s for RHEL5?

Ans: mdadm

Q: Can I create software RAID during Linux installation?

Ans: Yes, we can create Software RAID during Linux Installation by “Disk Druid”.

Q: What is the role of chunk size for software RAID?

Ans:Chunk size is very important parameter on which RAID performance based. We know stripes go across disk drives. But how big are the pieces of the stripe on each disk? The pieces a stripe is broken into are called chunks.To get good performance you must have a reasonable chunk size.
For big I/Os we required small chunks and for small I/Os we required big chunks.

Q: What is SWAP Space?

Ans: Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. Swap space is located on hard drives, which have a slower access time than physical memory.

Q: What are the steps to create SWAP files or Partition ?

Ans: swapon –a” command – Add swap entry into /etc/fstab file.

Q: How you will create swap file of size 4 GB and explain swap file entry in /etc/fstab file ?

Ans: Use “dd” command to create swap file.
dd if=/dev/zero of=/SWAPFILE bs=1024 count=4
mkswap /SWAPFILE
swapon –a
Entry into /etc/fstab file.
/SWAPFILE swap swap defaults 0 0

Q: Tell me the steps to remove the swap file?

Ans: Firstly disable the swap file by “swapoff” command. Remove Swap file entry from /etc/fstab file. Now remove the swap file by “rm” command.

Q: What can we do with “parted” command or utility ?

Ans:
View the existing partition table – Add partitions from free space or additional hard drives – Change the size of existing partitions

Q: How we will check free space on drive /dev/sda with parted command?

Ans: #parted /dev/sda
print

Q: Can we resize the size of a partition ?

Ans: Yes, we can resize the size of partition by “parted” command. #parted /dev/sda print
To resize the partition, use the resize command followed by the minor number for the partition, the starting place in megabytes, and the end place in megabytes. For example:
resize 3 1024 2048
After resizing the partition, use the print command to confirm that the partition has been resized correctly, is the correct partition type, and is the correct file system type.

Q: What is LVM ?

Ans: LVM stands for Logical Volume Manager. LVM, is a storage management solution that allows administrators to divide hard drive space into physical volumes (PV), which can then be combined into logical volume groups (VG), which are then divided into logical volumes (LV) on which the filesystem and mount point are created.

Q: What are the steps to create LVM ?

Ans:
Create physical volumes by “pvcreate” command
#pvcreate /dev/sda2 – Add physical volume to volume group by “vgcreate” command
#vgcreate VLG0 /dev/sda2 – Create logical volume from volume group by “lvcreate” command.
#lvcreate -L 1G -n LVM1 VLG0 Now create file system on /dev/sda2 partition by “mke2fs” command.
#mke2fs -j /dev/VLG0/LVM1

Q: What is the difference between LVM and RAID ?

Ans: RAID provides redundancy but LVM doesn’t provide Redundancy.

Q: What are LVM1 and LVM2 ?

Ans: LVM1 and LVM2 are the versions of LVM. LVM2 uses device mapper driver contained in 2.6 kernel version. LVM 1 was included in the 2.4 series kernels.

Q: What is Volume group (VG) ?

Ans: The Volume Group is the highest level abstraction used within the LVM. It gathers together a collection of Logical Volumes and Physical Volumes into one administrative unit.

Q: What is physical extent (PE) ?

Ans: Each physical volume is divided chunks of data, known as physical extents; these extents have the same size as the logical extents for the volume group.

Q: What is logical extent (LE) ?

Ans: Each logical volume is split into chunks of data, known as logical extents. The extent size is the same for all logical volumes in the volume group.

Q: Explain LVM snapshot ?

Ans: LVM snapshots allow the administrator to create a new block device which presents an exact copy of a logical volume, frozen at some point in time.

Q: How you will check on Your server or system device-mapper is installed or not ?

Ans:
Check the following file. #cat /proc/misc
if this file contains “device-mapper” term it means device mapper is installed on your system.

Q:56 ow are snapshots in LVM2 different from LVM1 ?

Ans: In LVM2 snapshots are read/write by default, whereas in LVM1, snapshots were read only.

Q:57 What is the maximum size of a single LV ?

Ans: “For 2.4 based kernels, the maximum LV size is 2TB. For 32-bit CPUs on 2.6 kernels, the maximum LV size is 16TB. For 64-bit CPUs on 2.6 kernels, the maximum LV size is 8EB.

Q:58 f a volume group named as VG0 already exists but i need to extend this volume group up to 4GB.Explain all steps ?

Ans:
Firstly create Physical volume (/dev/sda7) of size 4GB.
Now run following command. vgextend VG0 /dev/sda7

Q:59 If a volume group VG0 have 3 PV’s (/dev/sda6, /dev/sda7, /dev/sda8) but i want to remove /dev/sda7 pv from this VG0 ?

Ans: vgreduce VG0 /dev/sda7

Q:60 Which command is used to extend a logical volume ?

Ans: lvextend –size + /dev//
resize2fs /dev//

Q:61 Tell me all steps to remove a LVM ?

Ans: To remove a logical volume from a volume group, first unmount it with the umount command:
umount /dev//
and then use the lvremove command: lvremove /dev//

Q:62 Which command is used to create LVM Snapshot ?

Ans: vcreate –size -s -n
The lvcreate command is used to create a new logical volume, meaning there must be free physical extents in the logical volume group to create a snapshot. The -s option means that the LV is a snapshot, is the name of the new LV created, and is the name of the LV from which to create the snapshot

Q:63 Is there any relation between modprobe.conf file and network devices ?

Ans:
Yes, This file assigns a kernel module to each network device.
For Example :- [root@localhost ~]# cat /etc/modprobe.conf alias eth0 b44
Here b44 is the kernel module for network device eth0.
We can Confirm by following command (This module “b44” is present or not).
[root@localhost ~]# lsmod |grep b44
b44 29005 0

Q:64What “neat” command will do ?

Ans: neat command provides Graphical interface to change network settings for network devices.

==================================
Q:65 Which protocol is required to allow local printing and print sharing ?

Ans: Internet Printing Protocol (IPP) is required to allow local printing and print sharing.

Q:66 What is CUPS ?

Ans: “CUPS stands for “Common UNIX Printing System”. CUPS is a open source printing system developed by Apple Inc. CUPS uses the Internet Printing Protocol (IPP) to allow local printing and print sharing.

Q:67 What is the location of log files for CUPS ?

Ans: “The log files for the CUPS printing system are located in the /var/log/cups/ directory.

Q:68 What is YUM ?

Ans: YUM stands for Yellow dog Updater, Modified because it is based on YUP, the Yellow dog Updater. Where does the name Yellow dog come from? Yellow Dog is a version of Linux for the Power Architecture hardware and is RPM-based, just like Red Hat Enterprise Linux and Fedora. YUP, and later YUM, were written by the Linux community as a way to maintain an RPM-based system.

Q:69 What are the advantages of YUM ?

Ans: Automatic resolution of software dependencies. – Multiple software locations at one time. – Ability to specify particular software versions or architectures.

Q:70 How you will install software by YUM ?

Ans: yum install

Q:71 Which option is required to assume the answer “yes” to any questions asked during installation of package dependencies for YUM ?

Ans: The “-y” option is used to assume the answer “yes”.
For Example
yum -y install squid

Q:72 How to remove a software by YUM ?

Ans: yum remove

Q:73 How Many Run Levels present in Linux ?

Ans: There are 7 run levels, with each having its own properties.
0: Halt the system –
1: Single-user mode
2: Not used –
3: Multi-user mode with text login –
4: Not used –
5: Multi-user mode with graphical login –
6: Reboot

Q:74 Which configuration file is required to change the Run Level of Server or system ?

Ans: /etc/inittab
To change the default run level, modify this line.
id:5:initdefault:

Q:75 Explain architectures required for RPMs ?

Ans:
noarch Architecture-independent, can run on any architecture
i386 Generic build for a 32-bit x86 system
i586 Sometimes used when building kernels for older x86 processors Intel® Pentium ® II, Intel Pentium III, Intel Pentium 4, AMD Athlon, and
i686 AMD Duron systems (Most RPMs for these architectures are built using the i386 architecture, with the kernel for these architectures being built with the i686 for optimal performance.)
x86_64 64-bit processors such as AMD Athlon64, AMD Opteron, and Intel EM64T
ia64 Intel® Itanium
ppc 32-bit IBM® POWER, IBM eServer„ pSeries®, and IBM eServer iSeries
s390x 64-bit IBM eServer System z

Q:76 How to install Linux software’s by RPM ?

Ans: rpm -ivh test-1.0-1.i386.rpm
test ######################### [100%]

Q:77 If a file associated with test-1.0-1.i386.rpm deleted, than How we will recover that file ?

Ans: We can reinstall this rpm again.

Q:78 If you are getting error “package is already installed” but you have to install package any how. what option you will use ?

Ans: rpm -ivh test-1.0-1.i386.rpm
Preparing… ########################################### [100%] package test-1.0-1 is already installed
In this case you can use “–replacepkgs” option.
rpm -ivh –replacepkgs test-1.0-1.i386.rpm

Q:79 Which options are required to upgrade a RPM ?

Ans: “Upgrading a package is similar to installing one. Type the following command at a shell prompt: rpm -Uvh test-2.0-1.i386.rpm

Q:80 Explain the command “rpm -qa” ?

Ans: It will queries all currently installed packages. /var/lib/rpm

Q: Explain the command “rpm -qf “ ?

Ans: It queries the RPM database for which package owns . When specifying a file, specify the absolute path of the file.

Q: How to verify all installed packages ?

Ans: rpm –Va

Q: How to verify the signature of an rpm ?

Ans: rpm -K test-1.0-1.i386.rpm

Q:84 How to list PCI Devices on your server or System ?

Ans: “use “lspci” command.

Q:85 What is the role of “Kudzu” ?

Ans: Kudzu is used to Detect new Hardware

Q:86 What happens when you add a new device after installation ?

Ans: “The Kudzu program runs each time the system boots and performs a hardware probe. If new hardware is found, Kudzu attempts to map it to a kernel module. If successful, the information is saved, and the device is configured.

Q:87 How to Enable ACLs for /home partition ?

Ans: Add following entry in /etc/fstab
LABEL=/home /home ext3 acl 1 2
Now remount /home partition with acl option.
mount -t ext3 -o acl /dev/sda3 /home

Q:88 How to View ACLs for a file(test file) ?

Ans: getfacl test_file

Q:89 How to remove an ACL ?

Ans: setfacl –remove-all

Q:90 What is the difference between pop3 and imap protocols ?

Ans: POP3 (Post Office Protocol) is the most commonly used internet mail protocol.It works on 110 port. It is easy to configure and use. With a POP account you download the mail to your local computer and keep it there. Most of the time it gets deleted off of the mail server after being downloaded. One disadvantage of POP is that once you download it to your computer you won’t be able to check your mail from a different computer since it will already be downloaded onto your own computer. It tends to be slower than IMAP as well.
IMAP (Internet Message Access Protocol) uses a method where all the mailboxes and messages are maintained on the server. Therefore you can access your e-mail from any location with an internet connection. IMAP is faster than POP because the mail client reads all of the message headers without having to download the entire message. IMAP is also supported in a variety of clients just like POP. One thing to keep in mind is the amount of disk space allocated to your mail on the server may not be enough to hold all of your mail.IMAP supports the folder synchronization option e.g if you create any folder on the client m/c in outlook(mail client) then that folder will automatically created on the mailserver for the account
POP works best when you are using only a single computer, since you don’t have to worry about checking your e-mail from multiple locations. Plus it is faster as well.
IMAP would suit you better if you need to check your e-mail from multiple locations if you travel a lot. To use IMAP your ISP/mail provider must offer that type of account.

Q:91 How to Disable a User Account in Linux ?

Ans: # passwd -l
This might be useful in the situation where you don’t want to permanently remove the user, but you just want it disabled and no longer able to use the system. The user will still receive emails for example, but he will not be able to login and check them out.
To re-enable the account ,just use below command

# passwd -u

Q:92 How to detect CPU architecture/bitmode (32-bit or 64-bit) for Linux ?

Ans: cat /proc/cpuinfo | grep flags
you will find one of them with name “tm(transparent mode)” or “rm(real mode)” or “lm(long mode)” 1. rm tells ,it is a 16 bit processor 2. tm tells, it is a 32 bit processor 3. lm tells, it is a 64 bit processor

Q:93 What is the difference between SSH and Telnet ?

Ans: The Primary difference between SSH and Telnet is of security i.e in ssh data transfer between the systems is in encrypted form so it is difficult for the hackers to understand what is going on network.
In Telnet data transfer between the systems is in plain text.
SSH uses a public key for authentication while Telnet does not use any authentication.
Due to the security measures that were necessary for SSH to be used in public networks, each packet contains less data to make room for the data of the security mechanisms. In order to transmit the same amount of data, you would need to take-up a lot more bandwidth. This is called overhead..
SSH adds a bit more overhead to the bandwidth compared to Telnet.

Q: What is the 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.

Q: What is network bonding in Linux and steps to configure network bonding ?

Ans:
Network interface card (NIC) bonding (also referred to as NIC teaming) is the bonding together of two or more physical NICs so that they appear as one logical device. This allows for improvement in network performance by increasing the link speed beyond the limits of one single NIC and increasing the redundancy for higher availability. For example, you can use two 1-gigabit NICs bonded together to establish a 2-gigabit connection to a central file server.
When bonded together, two or more physical NICs can be assigned one IP address. And they will represent the same MAC address. If one of the NICs fails, the IP address remains accessible
because it is bound to the local NIC rather than to a single physical NIC. Steps to configure :
Step #1: Create a bond0 configuration file
Red Hat Linux stores network configuration in /etc/sysconfig/network-scripts/ directory. First, you need to create bond0 config file:
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
Append following lines to it:
DEVICE=bond0 IPADDR=192.168.1.20 NETWORK=192.168.1.0 NETMASK=255.255.255.0 USERCTL=no BOOTPROTO=none ONBOOT=yes
Replace above IP address with your actual IP address. Save file and exit to shell prompt.
Step #2: Modify eth0 and eth1 config files:
Open both configuration using vi text editor and make sure file read as follows for eth0 interface # vi /etc/sysconfig/network-scripts/ifcfg-eth0 Modify/append directive as follows: DEVICE=eth0 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none
Open eth1 configuration file using vi text editor:
# vi /etc/sysconfig/network-scripts/ifcfg-eth1Make sure file read as follows for eth1 interface:
DEVICE=eth1 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none
Save file and exit to shell prompt.
Step # 3: Load bond driver/module
Make sure bonding module is loaded when the channel-bonding interface (bond0) is brought up. You need to modify kernel modules configuration file:
# vi /etc/modprobe.conf Append following two lines:
alias bond0 bonding options bond0 mode=balance-alb miimon=100
Step # 4: Test configuration
First, load the bonding module: # modprobe bonding Restart networking service in order to bring up bond0 interface: # service network restart
Verify everything is working: # less /proc/net/bonding/bond0Output:
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6:be:59
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6: be: 63

Q: What is the difference between LILO and GRUB ?

Ans:1) LILO has no interactive command interface, whereas GRUB does. 2) LILO does not support booting from a network, whereas GRUB does.

3) LILO stores information regarding the location of the operating systems it can to load physically on the MBR.
If you change your LILO config file, you have to rewrite the LILO stage one boot loader to the MBR. Compared with GRUB, this is a much more risky option since a misconfigured MBR could leave the system unbootable. With GRUB, if the configuration file is configured incorrectly, it will simply default to the GRUB command-line interface.

Q: What is LVM Snapshot ?

Ans: An LVM snapshot is an exact copy of an LVM partition that has all the data from the LVM volume from the time the snapshot was created. The big advantage of LVM snapshots is that they can be used to greatly reduce the amount of time that your services/databases are down during backups because a snapshot is usually created in fractions of a second. After the snapshot has been created, you can back up the snapshot while your services and databases are in normal operation.

Ron Jagannathan has written 54 articles

Ronan is a Caffeine dependent life-form from Planet Earth who wants to be a Jedi Knight of cloud computing. A man of mystery and power, whose power is exceeded only by his mystery. Quantum Physicist, TransHumanist, Systems Architect, Unix Administrator, Artificial Intelligence, Machine Learning and DIY Gadget enthusiast. Believes that the Universe has a high probability of being a simulation.
But he's real and hopefully some of his readers are too.
email: Ron.Jagannathan@gmail.com ph: 202 355 5205
https://www.linkedin.com/in/ronjagan/
My Famous Quotes:
“In a Unix Universe, God is known by a four letter word called root. To err is human...to really foul requires you to be root.. err.. god.” ― Ron Jagannathan

Github: github.com/ronjag
Linkedin: linkedin.com/in/ronjagan/

“Quotes found on the Internet are not always accurate.” ― Abraham Lincoln

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>