You are on page 1of 52

Partition Table GRUB NTLDR

40 GB Hard disk C:// 10 GB D:// 10 GB E:// 10 GB -----------/ 8GB /boot 200-512 MB Swap Ram*2 ------------hda primary master hdb primary slave hdc secondary master hdd secondary slave ---------------0 Sector size = 512 bytes IPL = 446 bytes

XP

Linux

0 Sector (MBR)

C://

D://

E://

/boot

/dev/hda5 /

/dev/hda

/dev/hda1

/dev/hda2

/dev/hda3

/dev/hda4

/dev/hda5

/dev/hda6

FAT32

FAT32

FAT32

Ext3

Ext3

swap

Primary

Extended (Logical)

1:- Linux file system

/boot

/etc

/usr

/var

/home

/tmp

/dev

/proc

/media

/bin /sbin /boot /etc /var /dev /usr /proc /home /tmp /media

All commands which are used by normal users All commands which are used by supper user Linux kernel ( vmlinuz , initrd ) Grub directory System conf files Server data logs Mail proxy cache All devices name stored in /dev All gui tools installed in /usr System informations ( picture of RAM ) User's home dir's Temporary files Auto mounted devices mount point in /media

2:--Concept of swap
/ /boot

Ext3

Ext3

swap

44MB

[Ram 256MB]

Linux os image size 300MB

Remaining os image in swap

3:-- Basic commonds


For changing directory / to /etc

One step back /etc to /

Go to previous working directory

Go to current login user home directory

Show the contents of /etc in single color

Show the contents of /etc in different colors with nature of contents

create a folder on root partition

Create a folder in /disk

Create multiple folder in multiple directories with single command

Create multiple folder in same directory

Copy a file in directory

Copy a file from /disk/file and paste it in /disk/dir/

Copy a directory with r option

Copy a file from /disk/file and paste it in /etc with myfile name

Remove a file

Remove a file with forcefully option

Remove a directory with out r option and you face will an error

Remove a directory with r option

Remove a directory with forcefully option

Move /etc/dir1 to /disk/ with different name

Rename the folder name mydir to dir

Rename the file name with myfile

Read a file on terminal

Read a file page by page with less command

Read a file page by page with more command

Read first ten lines of grub.conf

Read last ten lings of grub.conf

Read first 12 lines with n option

Read last 11 lines with n option

Copy the contents of /etc/grub.conf in /disk/file

Append the contents /etc/mtab in /etc/file

Merging tow commands with pipe sign output of the first command is input of second command

Count the total lines of squid.conf

Show only spool words in squid.conf

Flush the contents of file

4:- User Management


Adding user with graphical utility

Show the properties of fiaz user

Add tow uses ishaq and umar with different command with default properties

Assigning password to ishaq

Add a group

Customizing users properties at the time of creating user [u uid ] [-g primary group] [-G secondary group] [ -c comments] [ -d home directory path ] [-s login shell ]

Modify user properties with usermod command

Delete a user saleem with his home directory

Delete a group corvit

All users information stored in /etc/passwd every user have a seven column line in this file 1-user name [ user authenticate at the time of login from the first column of /etc/passwd ] 2-password required [ x means users must required password if remove this x user can login without password ] 3-uid [ 500 first user id 0 to 499 ids are reserved 0 for root user and remaining for services users ] 4-gid [ every user relate with any group which stored in /etc/group ] 5-comments [full name but it is not compulsory only for information ]

6-home directory path [ linux file system is read only for normal user only his home directory is with full permission for normal user 7-login shell (/bin/bash, /bin/sh, /bin/tsh, /sbin/nologin) every user required a shell for login without shell user can never login at machine

All groups stored in this file

User password stored in this file

5:- Help

6:- Permission
Gui permission method...

Three types of permission read write and execute, Ever file and folder have three relations owner group and others [ Read = r write = w execute = x ] [ owner = u group = g other = o ]

10

1= nature of object [d=dir -=file L=link] 2= first three permission for owner [ rwx ] 3= second three permission for group members [ r-x] 4= third three permission for others [r-x] 5= number of inodes contain by this directory 6= owner of directory 7= group of directory 8= size of directory 9= creating date of object 10= name of object

Changing permission = give write permission to other on /disk

Give read write and execute permission for group on /disk

Assigning read writ and execute permission to user, group and other with single command

Assigning different permission with different commands which separate with semicolon

Using number system =----- [ Read = 4 ] rwx=7 r-x=5 ---=0

[ Write = 2 ]

[ Execute = 1 ]

Assigning full permission to owner and no permission for group and others

Assigning full permission for owner and group no permission for other

Assigning full permission to all

Assigning full permission for owner and read, and execute for group and others

Assigning no permission for all

Assigning sticky bit permission for other

Assigning suid permission for owner

Assigning sgid permission for group

7:-Archiving and Compression

8:-Partition
Fdisk utility use to manage hard disk

Help

Print partition table

Add new partition Starting cylinder

Size in Mb

Print partition table

New partition size 500MB Write and quite

This command sink and updating kernel real table with fdisk utility you can check this table cat /proc/partitions

Make file system ext3 on /dev/hdc6

Create a folder for mount point

Mount device name on /windisk folder

Show Linux mounted partitions size and usage percentage

Boot time Linux file system mount from /etc/fstab

Device name

Mount point

File system

Mounting option Auto dump

Order of fsck utility

Umounting partition

Assigning a label [work] to device name

Show device name label

Mounting device label on /windisk

/dev/hdc6 or LABEL=work

10:- RPM ( Redhat package manager )


Query about zsh package from installed rpm database

Removing zsh package

Again query after removing zsh package

For installing new rpms first mount your DVD in /media

Copy the contents of DVD in /var/ftp/pub

Installing zsh package

Information about installed zsh package

Show the path where zsh is installed

Query all installed rpms

Query all installed rpms but show only those which have bind word in there name

Query to squid.conf what is your package name

Query about information of uninstalled zsh package

Query the list of files and directories which zsh will be create after installing

Fresh installation of zsh package with new version ( old version of zsh must be installed before using Fvh )

Update zsh package with new version of zsh ( Uvh can work as ivh )

11:- Network Configuration


Show ip address and MAC of eth1

Show physical connectivity

Enable eth1

Disable eth1

Opening gui tool for configuring ip configuration

Restarting network service

Dns address stored this file

Mac, ip and more information about eth1 in this file

Check your machine name

Reconfigure your machine name

Permanent store your machine name in this file

Check your route way

12:- Disk Quota


Quota is mounting option before applying quota on any partition first mount this partition with quota option Add mounting option in /etc/fstab because our file system mounting from /etc/fstab

After adding usrquota option remount the partition

Show all mounted partitions mount points and mounting options

Run this utility it will create aquota.user file in /home this file contain the information of quota

After running quotacheck utility

13:- ACL

14:- Crontab

15:- SWAP (Partition & file)

SWAP Partition

/dev/hdc7

swap

swap

defaults

16:- Booting sequence


Bios initialization

1: POST 2: Boot device selected 3: First sector of boot device read and executed Reading information from MBR

Boot loader [GRUB ]nitilization


Reading /boot/grub.conf
1: Device detection

Kernel initialization [vmlinuz ]

2: Device driver initialization 3: Mount root file system read only Load some driver or modules which need for system booting every kernel have its own initrd (compress drivers or modules file

Initrd initialization [initial ram disk ]

File system mounting [ /etc/fstab ]


Read /etc/rc.d/rc.sysinit :- some general informa about OS

Init process run [ pid = 1 ]

Reda /etc/rc.d/rc*.d :-- Run level directory execute

X display Manager

Read /etc/rc.local :- script is run each time the system enters a run level its is a convenient place to start process that need to b running

/etc/rc.d/rc.sysinit 1: 2: 3: 4: 5: 6: 7: set kernel parameters in /etc/sysctl.conf load system maps Enables swap partition Sets hostname Root file system check and remount Active Raid and LVM devices Enable disk quota

Run levels:-# ls /etc/rc.d/ Rc0.d Rc1.d Rc2.d Rc3.d Rc4.d Rc5.d Rc6.d [halt or shutdown ] [ emergency mode or single user mode without password ] [ Multi user mode without nfs service ] [ Full multi user mode ] [ unused ] [ X11 ] [ Reboot ]

17:- Raid [redundant array independent disk]

0striping

1Mirroring

5Strip set with parity bit

Hard disk

2-32

2-2

3-32

Failure support

Size loss

0%

50%

=1 hard disk

18:- LVM (logical volume manager)

19:-YUM

On client

You might also like