rhce notes
DESCRIPTION
Rhce NotesTRANSCRIPT
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 1 of 46
Red Hat Enterprise Linux 0.5
Lecture # 01 dated Oct 28, 2009
RHCE Paper
Time: 5:30 hrs
2:00 hrs Part I Troubleshooting & Maintenance Phase Marks 70%
1:00 hrs RHCT 4 Questions Must have to pass all 100% marks
1:00 hrs RHCE 3 Questions Must have to pass 2 70% marks
3:30 hrs Part II Installation & Configuration Phase Marks 80%
1:30 hrs RHCT 100% marks
2:00 hrs RHCE 30 Questions
70% marks
Course:
RH - 033
RH - 133
RH - 253
Book:
McGraw Hill RHCE v5, Michael Jang
Class Time: 6:30 PM
Monday, Tuesday & Wednesday
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 2 of 46
Lecture # 02 dated Nov 03, 2009
Installation of Red Hat Enterprise Linux 0.5
System Requirement:
RAM: 256 MB
Processor: PIV
Disk Space: 10 GB
To delete partition:
1. Right-click on My Computer
2. Click Manage
3. Click Disk Management
4. Right-Click on D: drive (or any drive that you want to delete)
5. Click Delete Logical Drive…
Message: All data on this volume will be lost. Do you want to continue?
6. Click Yes
7. Close
Boot from CD-ROM:
1 Insert Red Hat Enterprise Linux CD into CD-ROM (RHEL_5.2 i386
2 Click Start
3 Click Shut Down…
4 Select Restart
5 Click OK
To Install Red Hat Enterprise Linux 5:
1. Type boot: linux text and Press Enter Button (To install or upgrade in text mode)
OR
boot: Press Enter Button (To install or upgrade in graphical mode)
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 3 of 46
2. Press OK (To begin testing the CD media before installation)
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 4 of 46
3. Press Test (To test the CD currently in the drive)
OR
Press Skip (To skip the media test and start the installation)
4. Red Hat Enterprise Linux 5, Click Next
What language would you like to us during the installation process?
5. Select English (English)
6. Click Next
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 5 of 46
Select the appropriate keyboard for the system.
7. Select U.S. English
8. Click Next
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 6 of 46
Installation Number
9. Click Skip entering Installation Number
10. Click Ok
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 7 of 46
If you're unable to locate the Installation Number, consult http://www.redhat.com/apps/support/in.html.
11. Click Skip
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 8 of 46
Installation requires partitioning of your hard drive. You can either choose to use this or create your won.
12. Select Create custom layout
13. Click Next
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 9 of 46
Partitioning hard drive
14. Click New
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 10 of 46
Add Partition
15. Mount Point: Select "/" slash (Root)
16. File System Type: Select ext3
17. Size (MB): Enter 7000 (7 GB)
18. Click OK
19. Click New (again)
20. Mount Point: Select /boot
21. File System Type: Select ext3
22. Size (MB): Enter 100
23. Click OK
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 11 of 46
24. Click New (again)
25. File System Type: Select swap
26. Size (MB): Enter 1024 (double of RAM size)
27. Click OK
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 12 of 46
28. Click New (again)
29. Mount Point: Type /data
30. File System Type: Select vfat
31. Size (MB): Enter 2110 (all free space available)
32. Click OK
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 13 of 46
33. Click Next
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 14 of 46
34. Click The GRUB boot loader will be installed on /devsda
35. Click Next
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 15 of 46
36. Check Other
37. Click Edit button
38. Enter "Microsoft Windows XP"
39. Click OK
Time Zone: Please click into the map to choose a region or:
40. Select Asia/Karachi
41. Click Next
The root account is used for administering the system. Enter a password for the root user.
42. Enter Root Password: 123456 (password must be minimum 6 character long)
43. Confirm: 123456
44. Click Next
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 16 of 46
Custom Installation
45. Click Customize now
46. Click Next
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 17 of 46
47. Select Desktop Environments
48. Select GNOME Desktop Environment (31 out of 36 optional packages are installed. To install all the 36 options)
49. Click Optional packages button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 18 of 46
Packages in GNOME Desktop Environment. Please choose the packages which you would like to have installed.
50. Check all uncheck options one by one
51. Click Close button ( now all the 36 packages are installed)
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 19 of 46
52. Check KDE (K Desktop Environment) (6 out of 7 optional packages are installed. To install all the 7 options):
53. Click Optional packages button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 20 of 46
54. Check all uncheck options one by one
55. Click Close button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 21 of 46
(Similarly select main categories from left panel and installed its optional packages that you want to install one by one.)
56. Click Next
To begin installation of Red hat Enterprise Linux Server:
57. Click Next
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 22 of 46
The software we have selected to install will require the following CDs:
a. Red hat Enterprise Linux Server 5 CD # 1
b. Red hat Enterprise Linux Server 5 CD # 2
c. Red hat Enterprise Linux Server 5 CD # 3
d. Red hat Enterprise Linux Server 5 CD # 4
e. Red hat Enterprise Linux Server 5 CD # 5
58. Click Continue button (Starting install process. This may take several minutes…)
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 23 of 46
Please insert Red Hat Enterprise Linux Server disc 2 to continue.
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 24 of 46
59. Insert disc 2 into CD-ROM
60. Click OK
Please insert Red Hat Enterprise Linux Server disc 3 o continue.
61. Insert disc 3 into CD-ROM
62. Click OK
Please insert Red Hat Enterprise Linux Server disc 4 continue.
63. Insert disc 4 into CD-ROM
64. Click OK
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 25 of 46
Please insert Red Hat Enterprise Linux Server disc 5 to continue.
65. Insert disc 5 into CD-ROM
66. Click OK
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 26 of 46
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 27 of 46
Congratulations, the installation is complete.
Remove any media used during the installation process and press the "Reboot" button to reboot your system.
67. Click Reboot button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 28 of 46
Welcome
68. Click Forward button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 29 of 46
License Agreement
69. Click Yes, I agree to the License Agreement
70. Click Forward button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 30 of 46
Firewall
71. Check options as you like
72. Click Forward button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 31 of 46
SELinux
73. Click Forward button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 32 of 46
Kdump
74. Click Forward button
Date & Time
75. Set date & time, click Forward button
Set Up Software
76. Click Forward button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 33 of 46
Create User
77. Click Forward button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 34 of 46
Create User
78. Click Continue
Sound Card
79. Click Forward button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 35 of 46
Additional CDs
80. Click Finish
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 36 of 46
Login
81. Username: root
82. Press Enter button
83. Password: 123456
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 37 of 46
84. Press Enter button
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 38 of 46
There are two methods of installation: 1. GUI (for graphical installation)
2. Text (for text installation)
Installation Number: 1. Red Hat cluster Suite
2. Xen (like VMware)
Hard Disk Identification: IDE /dev/hda
/dev/hda - Primary Master
/dev/hdb - Secondary Slave
/dev/hdc - Secondary Master
/dev/hdd - Secondary Slave
SATA /dev/sda
Linux Partitions: "/" compulsory, everything is placed on slash partition.
/boot recommended, the most sensitive data store on /boot partition.
/boot = Boot Loader + Kernel
Linux boot loader file name is GRUB
Kernel name is Vmlinuz
/boot size 100 MB
Swap recommended, swap is not accessible by any system user. It is system accessible partition. Swap size is double of RAM (2 x RAM), Swap file system is swap
Partition Size for Software: 1 partition size 7 GB for all the software minimum 1 GB
1 partition for file system must be ext2, ext3 or ext4
To check size of RAM During Installation for Swap: Alt + F1, Alt + F2 – F6
# more /proc/meminfo
vfat for windows share
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 39 of 46
Lecture # 03 dated Nov 04, 2009
Yahoo Group: groups.yahoo.com/groups/rhcecorvit
Red Hat Website: www.redhat.com.in
Version of Red Hat: Latest version 5.4
Exam version 5.1
Logging in to a Linux System There are two types of login screens in Linux:
1. Virtual Consoles (text-based)
2. Graphical Logins (called display managers)
A typical Linux system will run six virtual consoles and one graphical console. Server systems often have only virtual consoles and Desktops and workstations typically have both.
To Run Text Terminal: Alt + Ctrl + F1 – F6
To Check User Logged: [root@server1~] # w
Red Hat Enterprise Linux Server (2.6.18-53-8.el5)
Kernel 2.6.18-53.el5
1. 2 Major segment (change if there is major change like text to graphical change)
2. 6 Minor segment (change in case of new hardware like USB)
3. 18-53 Patch No Revision No (change after removal of bugs, like Service Pack of MS Window)
4. el5 686 (32 bit)
To Check Kernel version: [root@server1 ~] # cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)
Terminal: [root@server1 ~] #
1. root User Name
2. server1 Computer Name
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 40 of 46
3. ~ Current working directory (Folder Name, it show we are in folder which contain all setting of a user)
4. # It shows that you are login with a most privilege user and you can destroy everything.
5. $ Limited user.
To Run Graphic Mode from Text: The default graphical login for Red Hat Enterprise Linux is gdm. The GNOME Display Manager (display manager is the technical term for a graphical login). By default, the display manager will start the GNOME desktop.
Ctrl + Alt + F7
Or
[root@server1 ~] # init s
GDM (GNOME display manager)
GNOME (GNU Network Object Model Environment, It is a GNU Product, the default desktop environment. It is specially designed for networking & contain more tools for networking)
KDE (K Desktop Environment, Red Hat product, it contain more tools for graphic)
To Open Terminal: 1. Right-Click on Desktop
2. Click Open Terminal
Or
1. Click Applications
2. Point-to Accessories
3. Click Terminal
To Check Date: [root@server1 ~] # date
Fri Nov 6 06:54:05 PKT 2009
To Check Calendar: [root@server1 ~] # cal
To Check Calendar of Aug 1947: [root@server1 ~] # cal 08 1947
To Clear Screen: [root@server1 ~] # clear
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 41 of 46
To Show Directories: To show directories ls command is used in linux. ls is like dir of MS DOS but only difference is ls show result in color i.e. folder in blue and text file in black.
[root@server1 ~] # ls
Note: there is no extension in Linux of system files.
File & Folder Colors: 1. Blue Folder
2. Green Executable or Commands
3. Black/White Text Files
4. Pink Link
5. Red Backup file, Compress file (Zip) & .rpm
To Check File: [root@server1 ~] # file /dev/loop2 (loop2 file name)
/dev/loop2: block special (7/2)
Listing Directory Contents with ls Lists the contents of the current directory or a specified directory.
Syntax: ls [options] [files_or_dirs]
ls (list directory contents)
ls –a (include hidden files)
ls –l (display extra information, file folder propriety)
ls –lh (list directory contents in human readable format)
ls –R (recurse through directories)
ls –id (directory and symlink information)
ls –t (for a time-based list)
ls –i (for inode numbers)
ls –ltr (display the most recently changed file last)
ls –al (include hidden files in list view)
Example:
To Show/List Directory Contents: ls without arguments lists the file and directory names in the current directory.
[root@server1 ~] # ls
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 42 of 46
To Show Hidden Files: ls –a includes hidden files and directories. All the files and directories start with leading "." (dot) are hidden.
[root@server1 ~] # ls –a
To Check File Propriety: Use ls –l for a more detailed "long" listing.
[root@server1 ~] # ls –l
-rw------- 1 root root 56464 May 31 05:28 install.log
1. rw Permission
2. root user
3. root group
4. 56464 size (56 K)
To Display File Propriety in Human Readable: [root@server1 ~] # ls –lh
-rw------- 1 root root 56K May 31 05:28 install.log
-rw------- 1 root root 809 May 31 05:29 anaconda-ks.cfg
To Show Contents of Sub-directories: ls –R recurses through subdirectories listing their contents too.
[root@server1 ~] # ls –R
To Show Directory and Symlink info: ls –id to show directory and symlink information.
[root@server1 ~] # ls –id
To Show Time-based List: ls –t for a time-based list.
[root@server1 ~] # ls –t
To Show Inode Numbes: ls –id to show inode number.
[root@server1 ~] # ls –i
To Show Most Recently Changed files: ls –ltr to display the most recently changed files last.
[root@server1 ~] # ls –id
To Show Hidden Files in List View:
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 43 of 46
ls –al to display proprietary of all files including hidden files in list view.
[root@server1 ~] # ls –al
The ls command has many other options. All options can be used in combination with other ls options.
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 44 of 46
Lecture # 04 dated Nov 16, 2009
Unit 3
Getting Help
The whatis Command The whatis command search the whatis database for complete words and display short description of a command.
[root@Localhost ~] # whatis ls
ls (1) - List directory contents
The --help Command
Displays usage summary and argument list
Used by most, but not all, commands
The --help command displays usage summary and argument list that describes the command's syntax and a list of the options it accepts and what they do. Few basic conventions of --help commands:
Anything in straight braces ( [ ] ) optional
Anything followed by . . . represents an arbitrary-length list of that thing
Multiple options separated by pipes ( | ) it means we can use any one of them
Text in straight brackets ( < > ) represents variable data
[root@Localhost ~] # ls --help
[root@Localhost ~] # ls –help | more
| more - Press Space bar for next page or enter/return key to display next line.
The man Command
Provides documentation for commands
Collectively referred to as the Linux Manual
Almost every command on a Red Hat Enterprise Linux system has an associated man page, which provides more thorough documentation than the --help option. Man pages normally contain sections discussing the following aspects of a command's usage:
Its NAME and a short description of what it does
A SYNOPSIS of its usage, including available switches
A longer DESCRIPTION of the command's functionality
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 45 of 46
A switch-by-switch listing of its OPTIONS
Any FILES associated with this command
Any known BUGS in the command
EXAMPLES, showing how to use command
A SEE ALSO section for further reference
[root@Localhost ~] # man ls - Press Q to quit man pages.
The info Command
Similar to man, but often more in-depth
Run info without args to list all page
Info pages are often much more verbose and go into more detail then man sometimes they are just copies of the corresponding man page.
[root@Localhost ~] # info ls
Create File
The touch command The touch command is used to create file.
Syntax: mkdir [option] DIRECTORY…
[root@Localhost ~] # touch Pakistan
Create Folder
The mkdir command The mkdir command is used to create the directory / folder.
Syntax: touch [option] … FILE …
[root@Localhost ~] # mkdir ISB
Unit 3
Getting Help
Objectives
I:\RHCE.doc; RAJA YASSER NAWAZ E-mail: [email protected] Page(s) 46 of 46
Upon completion of this unit, we should be able to:
Describe important element of the file system hierarchy
Linux File Hierarchy Concepts
Files and directories are organized into a single-rooted inverted-tree structure
Filesystem Basics
These Linux file hierarchy concepts will be expanded upon in the pages that follow:
Files and directories are organized into a single-rooted inverted-tree structure, including distinct physical volumes such as floppy disks, CD-ROMs and multiple hard drives.
The base of the inverted-tree hierarchy is known as root or / - the top of the file structure.