RHCE preparation Guide

Source: Internet
Author: User
Chapter 1 Basic Requirements Section 1 Basic Knowledge linux and unix are managed through a series of text files. Linux administrators generally do not use a Graphical Editor to manage these configuration files. Various popular editor formats such as word and startoffice cannot be identified in linux. Common Linux text editors include vi, pico, joe, and emacs. Although emacs may be the most popular editor in the linux World, system administrators must understand the basic requirements of chapter 1 of vi.
Section 1 Basic Knowledge
Both linux and unix use a series of text files for management. Linux administrators generally do not use a Graphical Editor to manage these configuration files. Various popular editor formats such as word and startoffice cannot be identified in linux. Common Linux text editors include vi, pico, joe, and emacs. Although emacs may be the most popular editor in the linux World, system administrators must still understand the basic usage of vi. Emacs is more flexible and popular. vi can help you restore the system. If you want to use an emergency boot disk to restore an important file, vi is the only available editor.
In fact, RHEL 3 uses enhanced vi, I .e. vim. It adds colors to Distinguish important files. All vi commands are in the vim editor. You can use the "nohl" command in the vim editor to remove the color, which does not affect your management system.
Basic usage of Vi: vi filename
Basic command: I insert
O Insert a new row
: W save
: Q exit
: Wq! Save and force exit
: Q! Force exit without saving
Exercise 1: Use vi to add new users
1. # vi/etc/passwd, run the command yy to copy the current line, run the command p to copy a new line, and then modify it. Change the user name, user id, user group id, and home directory. After the change is complete, run the following command: wq! Save and exit.
2. Change the password of the New User: passwd username
3. Create a user's home directory: mkdir/home/username
Section 2 hierarchical structure of the file system
Everything in linux can be attributed to a file. Partition and file system device node association, for example:/dev/hda1. Hardware components correspond to node files such as/dev/modem. The detected devices are archived in the/proc directory. FHS is used to organize linux and unix files.
Basic file system hierarchy:
/Root directory, the most advanced directory in linux
/Bin basic command line tools should not be attached separately.
/Boot Directory, which contains the linux Startup file, including the linux kernel. Default size
It is 100 MB.
/Dev drivers for all hardware and software devices. Do not mount this directory to a single partition.
/Etc stores most basic configuration files
/Home stores the home directories of most users
/Lib kernel library and various command line tools. Do not mount this directory to a separate partition.
/Mount point of mnt removable devices, including floppy disk and optical drive
/Opt stores applications, such as wordperfect and openoffice suites.
/The current kernel-related processes of proc, including IRQ ports, I/O address, and DMA Channel
/Root user's home directory
/Sbin system management commands. Do not mount them separately.
/Tmp Temporary Folder
/Usr small programs available to all users, including some system management commands and functions
/Var variable data including log files, print pool
File System Format and Test
Tools used to manage different file systems include fdisk, mkfs, and fsck.
Fdisk: this command is powerful, but with this command, you must know that you need to change the hard disk, that is, you must specify the corresponding device. If you want to manage the first scsi hard disk, enter the following command: fdisk/dev/sda
Fdisk command: a specifies the boot Partition
L list the types of known partitions
N add new partition
Q: Do not save and exit
T change the partition File System
Mkfs: format a linux File System and use the mkfs command, for example:
Mkfs-t ext3/dev/hda1
Fsck: disk check command, similar to the chkdsk of windows 2000. Before using this command, detach the disk to be checked, for example, check the hda7 partition mounted to the/var directory: # umount/var
# Fsck-t ext3/dev/hda7
# Mount/dev/hda7/var
Exercise: Create a New lvm Partition
1. Add a new hard disk
2. Create a New partition and use the fdisk tool to set the partition as an lvm file system.
3. Backup/home Directory
4. Run the vgscan command to scan the lvm file system and create a database for other lvm commands.
5. Use pvcresate/dev/partition to create a volume
6. Run the vgcreate groupname/dev/partition1/dev/partition2 command to create a volume group.
7. Use lvcreate-L-xyM-n volname groupname to create a logical volume. xy indicates the volume size.
8. Use the mkfs command to format the logical volume.
9. Mount the logical volume to the/home directory. Modify/etc/fstab to make the system automatically mount the/home directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.