⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rhl37.htm

📁 linux的初学电子书
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<HTML>

<HEAD>

<TITLE>Red Hat Linux Unleashed rhl37.htm </TITLE>

<LINK REL="ToC" HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm">

<LINK REL="Index" HREF="htindex.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/htindex.htm">

<LINK REL="Next" HREF="rhl38.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl38.htm">

<LINK REL="Previous" HREF="rhl36.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl36.htm"></HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">

<A NAME="I0"></A>

<H2>Red Hat Linux Unleashed rhl37.htm</H2>

<P ALIGN=LEFT>

<A HREF="rhl36.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl36.htm" TARGET="_self"><IMG SRC="purprev.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm" TARGET="_self"><IMG SRC="purtoc.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="rhl38.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl38.htm" TARGET="_self"><IMG SRC="purnext.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>


<HR ALIGN=CENTER>

<P>

<UL>

<UL>

<UL>

<LI>

<A HREF="#E68E319" >The root Account</A>

<LI>

<A HREF="#E68E320" >Starting and Stopping the System</A>

<UL>

<LI>

<A HREF="#E69E413" >Booting from a Floppy</A>

<LI>

<A HREF="#E69E414" >Using LILO To Boot</A>

<LI>

<A HREF="#E69E415" >Shutting Down Linux</A></UL>

<LI>

<A HREF="#E68E321" >Mounting File Systems</A>

<UL>

<LI>

<A HREF="#E69E416" >Mounting a Floppy</A>

<LI>

<A HREF="#E69E417" >Creating a New File System</A>

<LI>

<A HREF="#E69E418" >Unmounting File Systems</A>

<LI>

<A HREF="#E69E419" >Checking File Systems</A>

<LI>

<A HREF="#E69E420" >Using a File as Swap Space</A></UL>

<LI>

<A HREF="#E68E322" >Compressing Files with gzip and compress</A>

<LI>

<A HREF="#E68E323" >Using tar</A>

<LI>

<A HREF="#E68E324" >Backups</A>

<LI>

<A HREF="#E68E325" >Setting Up Your System</A>

<UL>

<LI>

<A HREF="#E69E421" >Setting the System Name</A>

<LI>

<A HREF="#E69E422" >Using a Maintenance Disk</A>

<LI>

<A HREF="#E69E423" >Forgetting the root Password</A>

<LI>

<A HREF="#E69E424" >Setting the Login Message</A></UL>

<LI>

<A HREF="#E68E326" >Summary</A></UL></UL></UL>

<HR ALIGN=CENTER>

<A NAME="E66E37"></A>

<H1 ALIGN=CENTER>

<CENTER>

<FONT SIZE=6 COLOR="#FF0000"><B>37</B></FONT></CENTER></H1>

<BR>

<A NAME="E67E37"></A>

<H2 ALIGN=CENTER>

<CENTER>

<FONT SIZE=6 COLOR="#FF0000"><B>System Administration Basics</B></FONT></CENTER></H2>

<BR>

<P>So far in this book, you've seen how to use Linux for many different tasks. However, there are some issues we haven't dealt with because they are used rarely, or only by a single administrator (who may be the only user). This chapter looks at simple 
system administration tasks, including the following:

<BR>

<UL>

<LI>Starting and shutting down the system properly

<BR>

<BR>

<LI>Managing the disk partitions

<BR>

<BR>

<LI>Making backups

<BR>

<BR>

<LI>gzip, compress, and tar

<BR>

<BR>

<LI>Message of the day

<BR>

<BR>

<LI>Emergency boot floppies

<BR>

<BR>

</UL>

<P>Of course, we can't cover everything you need to know to run a system efficiently. Instead, we will look at the basic information and utilities and leave you to experiment. For more details, check the documentation files with your Linux operating 
system. Better yet, consider purchasing a good UNIX system administration book, such as Linux System Administrator's Survival Guide (Sams Publishing, 1995). Much of the information in a UNIX book will be applicable to Linux.

<BR>

<BR>

<A NAME="E68E319"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>The </B><B>root</B><B> Account</B></FONT></CENTER></H3>

<BR>

<P>The root login, as you probably know, has no limitations at all. It can do anything anywhere, access any files it wants, and control any processes. This power has its price, though: Any mistake can be disastrous, sometimes resulting in damage to the 
entire operating system.

<BR>

<P>A mystique has built up in the UNIX community about the root login, because it holds unlimited power over the system. The tendency to want to use this superuser login is overwhelming for many. However, a simple rm command in the wrong place can spell 
many hours of trouble.

<BR>

<P>For this reason, the root account should be employed only for limited system use, and then only when its power is necessary (such as when rebuilding a kernel, installing new software, or setting up new file systems). As a general rule, you should not 
use the root account for routine tasks.

<BR>

<P>Naturally, many people use root for their daily Linux sessions, ignoring any advice because they think they won't make mistakes. In truth, everyone makes a mistake occasionally. Check with any UNIX system administrator and you'll find that accidents 
happen with the root account. (I have managed to delete entire file systems more than once while trying to do two things at the same time.) Although many people will ignore the rule about using root only when necessary, most of them eventually find out why 
this rule is important!

<BR>

<BR>

<A NAME="E68E320"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Starting and Stopping the System</B></FONT></CENTER></H3>

<BR>

<P>There are several ways of booting the Linux operating system, as well as a few ways to safely shut it down. Some were mentioned earlier in this book. Because Linux can be installed in many different ways, there is no single &quot;right&quot; method of 
booting the operating system, so we must look at both hard-disk-based and floppy-disk-based boot procedures.

<BR>

<BR>

<A NAME="E69E413"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Booting from a Floppy</B></FONT></CENTER></H4>

<BR>

<P>A boot floppy, as its name implies, is a floppy disk that boots the Linux kernel. A boot floppy has the root partition installed on the floppy itself instead of the hard drive (although both may co-exist). Without the root partition, Linux would be 
unable to find the hard drives for the rest of the operating system.

<BR>

<P>You can create Linux boot floppies with the setup routine included in most distributions of the operating system. Check the documentation or information files that came with your Linux distribution, if there are any. Alternatively, most Linux setup 
utilities have a menu-driven interface that prompts you for a boot floppy setup when you rebuild or reconfigure the kernel. You should use this procedure to make a boot floppy, which is also useful for emergencies.

<BR>

<P>In most cases, a boot floppy is used only in emergencies when your system won't start up normally. The boot floppy enables you to load Linux, and then mount the hard drives that are causing the problem to check for damage. Luckily, this is not required 
very often. If you haven't used LILO to choose the partition to boot or set your boot sequence to Linux by default, you may need the boot floppy to start up Linux. In this case, the boot floppy is much like a DOS boot floppy.

<BR>

<P>You can create a boot floppy from scratch by copying over the kernel image from the hard drive. The kernel image is usually in the file vmlinuz, vmlinux, Image, or /etc/Image, depending on the distribution of Linux. The Red Hat distribution uses 
vmlinuz, which is a compressed kernel (hence the z in the name). Compressed kernels uncompress themselves as they are loaded into memory at boot time. The vmlinuz image expands to vmlinux. (Compressed kernels take up less disk space; that's why they are 
used.)

<BR>

<P>After you have identified the kernel, you can set the root device in the kernel image to point to the root partition on either the floppy or hard drive. In this case, we want the floppy. The root partition is set with the rdev command, whose format is 
as follows:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">rdev kernelname device</FONT></PRE>

<P>where kernelname is the name of the kernel image, and device is the name of the Linux root partition. To set a floppy boot device with the file vmlinuz, the command would be

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">rdev vmlinuz /dev/fd0</FONT></PRE>

<P>for the first floppy on the system. You can set other parameters with rdev as well if you want to change system defaults during boot. Check the rdev man page for the rdev help file for complete information.

<BR>

<P>As a final step in creating the boot floppy, copy the kernel image to the floppy disk. You should use a preformatted diskette (format with DOS if necessary) to allow the Linux routines to identify the type of diskette and its density. To copy the 
vmlinuz kernel to the first floppy drive, use this command:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">cp vmlinuz /dev/fd0</FONT></PRE>

<P>The floppy should now be ready to boot the system. You might not be able to boot the system without the floppy if you changed the location of the root partition. You can change the root partition back to the hard drive with the rdev command after 
completing the boot floppy, which enables you to boot from either. This can be useful when you have diskettes for several different boot configurations. You can also create the boot floppy from the Linux setup program.

<BR>

<BR>

<A NAME="E69E414"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Using LILO To Boot</B></FONT></CENTER></H4>

<BR>

<P>LILO is a program that resides in the boot sector of your hard drive and allows Linux to be booted from the hard disk either after you tell it to or after a default number of seconds has elapsed.

<BR>

<P>LILO can also be used with other operating systems such as OS/2 and DOS. If you have LILO set to autoboot Linux, you must interrupt the process by pressing the Ctrl, Alt, or Shift keys when the bootup is started if you want to boot into another 
operating system. This displays a boot prompt that enables you to specify another operating system.

<BR>

<P>If LILO is set to allow a given time before it boots into Linux, you can use the Ctrl-Alt-Shift sequence to interrupt the boot process before the timer expires and Linux starts loading. Finally, if LILO is set to not autoboot into Linux, but to wait for 
explicit instructions, you must press Enter to boot Linux or type the name of the other operating system.

<BR>

<P>Some Linux distributions have a configuration file in the directory /etc/lilo that can be edited to provide boot information, while other versions of Linux configure LILO during the installation process. If the latter is the case, you can change the 
settings with the setup utility. Some versions of Linux use the configuration file /etc/lilo.conf instead of /etc/lilo.

<BR>

<BR>

<A NAME="E69E415"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Shutting Down Linux</B></FONT></CENTER></H4>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -