Wednesday, August 21, 2013

Training Docs - Part II



Notes taken in live session :
·         Thegeekstuff.com
·         Boot process : power on – BIOS –Post-MBR-GRUB-init-runlevel
·         Oracle VM – VirtualBox Manager
·         RPM
·         File system and file structure
·         LILO /boot/lilo/lilo.conf or /etc/lilo.conf
·         Linux flavours
·         Types of architecture : 86, X86, etc.
·         Runlevels :
0.       Halt – to shutdown
1.       Single usesr = for system administration purpose
2.       Multiuser without NFS
3.       Multiuser with NFS
4.       User-defined
5.       X11 – GUI
6.       Reboot
Examples, User-defined runlevels : LIC and Railway information terminals
Command to check runlevel :  runlevel
·         whoami – to see your login username
·         arch – to check architecture
·         cat /etc/redhat-release – to see OS version in centos/fedora
debian – cat /etc/lsb-release
ubuntu—cat /etc/lsb-release
·         mount – to see file version
·         /etc/SUSE-release – for SUSE release
·         linux is case sensitive and windows is not.
·         /etc/inittab
id:3:initdefault
·         Windows swap memory is called as virtual memory
·         Swap partition is the portion of the hard drive that linux uses as virtual memory.
It should be double the size of RAM.
free –m
·         Psuedo file system
·         CentOS Community Enterprise OS
·         OS installation :
1.       Install or upgrade
2.       media test
3.       language – US-EN
4.       types of devices
5.       configure network : Hostname
6.       time zone
7.       root password
8.       type of installation  : create custom layout
9.       select a device :  click create button
device - size(Mb) - mountpont/rain/volume – type – front
10.   Install boot loader
11.   ………………Select Basic server
·         Assigning Server IP :
cat /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR =
NETMASK =
you can define gateway in this file, but standard location is as below
/etc/sysconfig/network --- to define network gateway and hostname
HOSTNAME =
GATEWAY =

/etc/resolve.conf  --- to assign nameservers
nameserver = 8.8.8.8
nameserver = 4.2.2.2

service network restart

setup ---- command to set network, etc.

setup >> network configuration >> device configuration >> eth0
·         HARD DISK STRUCTURE :
4(four) hard drives can be connected to a system
1.       Primary Master – sda
2.       Primary Slave – sdb
3.       Secondary Master – sdc
4.       Secondary slave – sdd
·         fdisk –l
·         difference between sda and had :
sda ----- SCSI and SATA
sda ------IDE

SCSI – small computer system Interface
SATA ---
IDE --- integrated development environment
·         Steps to attach secondary hard disk :
1.       DC will add hard disk
2.       fdisk –l  ------command to see how many harddisks are attached
3.       fdisk /dev/sdb ======== to identify HDD
n
p
1
enter
enter
w
4.       fdisk –l           It should show /dev/sdb1
5.       mkfs .ext4 /dev/sdb1 --------------to format HDD (make file system)
6.       mount /dev/sdb1 /mnt  (temporary mounting)
7.       umount /mnt (to unmount)
8.       another example, mkdir backup         and       then  mount /dev/sdb1 /backup
·         To devide a new hard disk in two parts :
fdisk –l
fdisk /dev/sdb
n
p
2
enter
enter
w
fdisk –l
.
.
.
.
·         To make permanent mounting :
vi /etc/mtab
vi /etc/fstab
mount command shows information as per mtab
·         fstab
·         How to change hostname ?
hostname abc.xyz.com
to make permanent hostname change, edit
/etc/sysconfig/network
and
add entry in
vi /etc/hosts

entry to be added :  117.239.185.135 abc.xyz.com

hostname –i
·         Cpanel installation :
on debian OS it is not possible

cpanel runs on following OS only
centos 4,5,6
redhat 4,5,6
free bsd 7.3 7.4 8.0 8.1 8.2
cloudlinux 5 6

generally speaking 50gb hdd and 2gb RAM is good for cpanel.
·         cat proc/cpuinfo |grep processor
·         cat /proc/meminfo
·         cd /home
wget –N …………………….latest
sh latest
·         server password and cpanel/whm password will always be same and cannot be different.


·         HOMEWORK
fstab
Pseudo file system
CentOS Community Enterprise OS

·         /etc/fstab

fstab is a configuration file that contains information of all the partitions and storage devices in your computer.
The fstab (/etc/fstab) (or file systems table) file is a system configuration file commonly found on Unix systems. It is part of the util-linux package. The fstab file typically lists all available disks and disk partitions, and indicates how they are to be initialized or otherwise integrated into the overall system's file system. fstab is still used for basic system configuration, notably of a system's main hard drive and startup file system, but for other uses has been superseded in recent years by automatic mounting.
The fstab file is most commonly used by the mount command, which reads the fstab file to determine which options should be used when mounting the specified device. It is the duty of the system administrator to properly create and maintain this file.
# device name --  mount point --    fs-type      -- options --  dump-freq -- pass-num
LABEL=/         /               ext4         defaults                                            1 1
/dev/sda6       swap            swap         defaults                                            0 0
none            /dev/pts        devpts       gid=5,mode=620                                      0 0
none            /proc           proc         defaults                                            0 0
none            /dev/shm        tmpfs        defaults                                            0 0

The columns are as follows:
  1. The device name or other means of locating the partition or data source.
  2. The mount point, where the data is to be attached to the filesystem.
  3. The filesystem type, or the algorithm used to interpret the filesystem.
  4. Options, including if the filesystem should be mounted at boot.
  5. dump-freq adjusts the archiving schedule for the partition (used by dump).
  6. pass-num Controls the order in which fsck checks the device/partition for errors at boot time. The root device should be 1. Other partitions should be either 2 (to check after root) or 0 (to disable checking for that partition altogether).
defaults Uses the default options that are rw, suid, dev, exec, auto, nouser, and async.
A value of zero in either of the last 2 columns disables the corresponding feature. For the whitespace character in paths the character code "\040" is used.
Refer : http://www.tuxfiles.org/linuxhelp/fstab.html
Pseudo file system


The /proc directory on GNU/Linux systems provides a file-system like interface to the kernel. This allows applications and users to fetch information from and set values in the kernel using normal file-system I/O operation.
The proc file system is sometimes referred to as a process information pseudo-file system. It does not contain ``real'' files but rather runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). For this reason it can be regarded as a control and information center for the kernel. In fact, quite a lot of system utilities are simply calls to files in this directory. For example, the command lsmod, which lists the modules loaded by the kernel, is basically the same as 'cat /proc/modules' while lspci, which lists devices connected to the PCI bus of the system, is the same as 'cat /proc/pci'. By altering files located in this directory you can change kernel parameters while the system is running.
CentOS Community Enterprise OS
free, open source
uses code of Redhat
community support

No comments:

Post a Comment