Monday 29 October 2012

how to create terminal in redhat linux


How to create terminal in linux

Vi /etc/inittab

1: 2345:res                               tty 1
Upto 10 whatever
#          init q
#          chvt 13


Vi /etc/securetty
#          vi /etc/securetty

Vc        1         
Tty       1

Password = dGht4
:grub-md5-crypt

creating bootable pen drive or cd drive


Using cd and pendrive

Creating bootable cd or dvd
Copy the image folder from linux dvdor cd by mounting

#          Cp image /root/Desktop

Unmount the cd or dvd

#          Eject
#          Eject –t


Now copy the boot.iso file from image folder in blank cd or dvd by mounting and run the command
First
 #         cd /root/Desktop/image
#          cdrecord –v boot.iso


For bootable pendrive

We have copy diskboot.img file in pendrive
#          Cd /root/Desktop/image
#          Cat diskboot.img > /dev/sda1


Creating image of the dvd
 Insert the dvd or cd and writer this command to create image of disk
#          dd if=/dev/cdwriter /Deepak.iso

Write the image in cd or dvd
#          Cdrecord –v /Deepak.iso




Splitting the dvd image into many parts so that it can be written into cd.

Step 1 create image of the dvd or cd
#        dd if = /dev/cdwriter /vijay.iso
Step 2 to split the image
#        split vijay.iso     [it will split the image into default size]
To manually split the cd according to size
#        split –b 70000 (always in byte) /vijay.iso

Then write the image into blank cd
#        Cdrecord –v /vijay.iso1


To merge the cd into dvd

#        mkisofs –o 1.iso

Sunday 7 October 2012

how to set disk quota in linux for a user



Crete a partition if required

Fdisk /dev/sda

Create partition

Create user =vijay

#useradd vijay  [user add]

#passwd 12345  [set password for user vijay]

Create directory =redhat

#mkdir redhat [for create redhat directory]
 
Setp =2 

#chmod 777 /redhat [set default permission on the directory]

#vi  /etc/fstab    [entry in this file below mention detail ]

/dev/sda3         /redhat           ext3     usrquota          0 0
:wq
 [note: entry only that partition which is you make like that /dev/sda3, /dev/sda4, dev/sda5]

Mount –a

Mkfe2fs –J /dev/sda3     [format the partition ]

Mount –o remount /redhat

Quotacheck –mug /redhat

Ls /redhat [show quota]

Setquota –u vijay 30 70 5 8 /redhat 

30 warning disk quota 70 disk quota 5 warning file quota  8 file quota

Quotaon /redhat

Repquota –a [show all user quota ]

Quotaoff /vijay     [quota off on the user]

Sunday 30 September 2012

how to create yum server in linux

Firstly mount the DVD on any mount point:

#mount /dev/cdrom /mnt              (mount your cd or iso on /mnt )

#cd /mnt                          (go to the directory

#ls                               (list the file

#rpm -ivh createrepo* +use tab) (install this rpm through command to make default directory /var/ftp/pub

#cp -rav * /var/ftp/pub           (copy to content in /pub directory

#cd /var/ftp/pub                   (go to the /pub

#createrepo* /pub           (create repository in pub

#vi /etc/yum.repos.d/server.repo (Create a file with extn. .repo)

[server]
name= This is yum Server(for our information)
baseurl=file:///var/ftp/pub/
gpgcheck=0
enabled=1

:wq!

(save and exit)
 

#yum clean all              (to clean the errors in repository

#yum list all                 (display all rpm )

Wednesday 29 August 2012

What is Boot Process in Linux

Linux Boot Process:

In the linux we have a 6 level of boot process:


BIOS:
BIOS stands for Basic Input/Output System.Performs some system integrity checks.Searches, loads, and executes the boot loader programs.
Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it.

MBR:
MBR stands for Master Boot Record.
It is located in the 1st sector of the bootable disk. MBR is less then 512KB in size .
It contains information about GRUB (or LILO in old systems).in simple terms MBR loads and executes the GRUB boot loader.


GRUB:
GRUB stands for Grand Unified Bootloader.
If you have multiple kernel images installed on your system, you can choose which one to be executed.
Grub configuration file is (/boot/grub/grub.conf) (/etc/grub.conf is a link to this).
As you notice from the above info, it contains kernel and initrd image.GRUB just loads and executes Kernel and initrd images.

KERNEL:

mount the root file system located in /etc/grub.conf
Kernel executes the /sbin/init program
Since init was the 1st program to be executed by Linux Kernel, it has the process id (PID) of 1. Do a ‘ps -ef | grep init’ and check the pid.
initrd stands for Initial RAM Disk.

INIT:

 
after that it goes to /etc/inittab file to check the Linux run level.
 here are the available run levels in Linux:
0 – halt
1 – Single user mode
2 – Multiuser, without Network file system.
3 – Full multiuser mode
4 – unused (for testing purpose)
5 – X11 (Desktop Environment )
6 – reboot
Typically you would set the default run level to either 3 or 5.


RUNLEVEL:

When the Linux system is booting up, you might see various services getting started. For example, it might say “starting Spool …. OK”. Those are the runlevel programs, executed from the run level directory as defined by your run level.
Depending on your default INIT runlevel setting, the system will execute the programs from one of the following directories.
Run level 0 – /etc/rc.d/rc0.d/
Run level 1 – /etc/rc.d/rc1.d/
Run level 2 – /etc/rc.d/rc2.d/
Run level 3 – /etc/rc.d/rc3.d/
Run level 4 – /etc/rc.d/rc4.d/
Run level 5 – /etc/rc.d/rc5.d/
Run level 6 – /etc/rc.d/rc6.d/

Tuesday 28 August 2012

What is Linux and why we have to use it


what is linux ?  LINUX is freeware. anyone can view and edit the source code of OS It is fully customizable.
Most Important Feature is Stability, multitasking, multi-user,LINUX has better security structure.High Portability Easy to port new Hardware Platform Written in C which is highly portable.

Kernel:
Kernel is the heart of the operating system.It is the low level core of the System that is the interface between applications and H/W.
Functions
Manage The Memory, I/O devices, allocates the time between user and process, inter process communication, sets process priority.

Shell:
The shell is a program that provide interface to users for their commands.
It is a command interpreter and also has programming capability of its own.
Shell Types

  Sh  (First shell by Stephen Bourne at AT&T bell labs in 1977)
  Bash  C Shell(sh)
  Korn Shell (ksh)

File System:

Linux treats everything as a file including hardware devices. Arranged as a
directory hierarchy.

The top level directory is known as “root (/)”.

/bin    Essential command binaries
/boot    Static files of the boot loader
/dev     Device files
/etc     Host−specific system configuration
/lib     Essential shared libraries and kernel modules
/media     Mount point for removeable media
/mnt     Mount point for mounting a filesystem temporarily
/opt      Add−on application software packages
/sbin      Essential system binaries
/srv      Data for services provided by this system\
/tmp      Temporary files
/usr     Secondary hierarchy
/var     Variable data.