Technofunction

Investigating And Managing Processes in Linux

In Linux the program that is running constitutes a process. In Linux two numbers are assigned to a process i.e.

  1. 1. PID (Process ID):-

The process ID is assigned by a Linux Kernel and will be unique.

  1. 2. JID (Job ID):-

The Job ID is assigned by shell and will be unique. Here again a concept a parent and child shell will be assigned and each will have its unique JOB ID in its own category.

Following command can be used in respect with processes on Linux:-

  • The command used to check the processes running in a current shell is

# ps

So it initially after you login you enter the ps command than it will show you the bash shell that you are running since you initiated it.

  • But there are processes which are running even before you login in to your account. These processes are not linked with the terminal an example of it can be send mail. You can check these processes by using “ps –ef” command an example of it is

#ps –ef | grep –i sendmail

ps-ef is already explained, (|) is used to display content page wise, “grep” is used to match the keyword here and sendmail is the process whose details we want to use.

If you simply use ps –ef command than it will list all the processes running independent of the terminal.

  • If you just want to check the process ID without much details you can use “pidof” command.

#pidof sendmail

(more…)

Mounting or Extracting files from .iso Image in Linux

If you download a file in .iso extension its an image file of the orginal File. You need to write it to a CD/DVD. But you can directly extract its files without the need of writing it out to a CD/DVD. For this consider the following scenario:

Suppose we have a file named file.iso on Desktop and we need to see all the files under it and even need to copy a file named Server to directory /etc. First login as root or you can even use sudo command if you have been alloted the priviledges:

  • You need to mount the image first so consider creating a iso directory under /mnt with following command

# mkdir /mnt/iso

  • Next mount the image file to this directory

# mount -o /root/Desktop/file.iso /mnt/iso

Ext3 file system and its advantages

The ext2 file system of Linux is a well-tested subsystem and very well optimized. Until ext3 & ext4 file system were introduced.

There are four file systems i.e : ext3, ReiserFS, XFS, and JFS. All the four of these file systems offers features that holds importance in different scenarios and needs, but the most important enhancement offered by all the four is called journaling. If we consider the Traditional file systems (such as ext2) it must search through the directory structure and find the right place on disk to lay out the data, and then lay out the data. (Linux is capable of cache the whole process of searching laying the data, including the directory updates and thereby making the process  faster to the user.)

(more…)

Linux filesystem and Partition Basics

It is important to remember that everything in Linux is configured as a File. Directories, hardware device drivers and partition all are represented by files. The organizational system for Linux Files is known as FILESYSTEM HIERARCHY STANDARD (FHS).

During installation of Linux you can mount all Linux directories on single partition or separate partitions. While separate partitions Limits risk to system like web servers such as APACHE can consume gigabytes of space. Due to which users will no longer be able to create file, you can’t set up the print jobs etc due to which will result in total chaos. However by mounting right directory in separate partitions, users can still work and save files even if the partitions with log files become full.

The different types of partitions on a Hard Drive are:-

1. Primary Partition:-

Upto four primary partitions can be created on IDE or SCSI hard drive. One primary partition must be active and it should include a boot loader such as GRUB or the Linux Loader (LILO).

2. Extended Partition:-

A primary partition can be converted into an extended partition which can further be subdivided into logical partitions depending upon your requirements. Usually extended partition separates a primary partition and a logical partition.

3. Logical partitions:-

An extended partition can be subdivided into logical partitions and there can be upto 11 logical partitions on a SCSI hard drive or upto 12 logical partitions on an IDE hard drive.

(more…)