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

📄 265-268.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Special Edition Using Linux, Fourth Edition:Managing File Systems</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0789717468//-->

<!--TITLE=Special Edition Using Linux, Fourth Edition//-->

<!--AUTHOR=Jack Tackett//-->

<!--AUTHOR=Jr.//-->

<!--AUTHOR=Steve Burnett//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Que//-->

<!--CHAPTER=14//-->

<!--PAGES=265-268//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch13/262-262.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="268-270.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H2 ALIGN="CENTER"><FONT COLOR="#000077"><I>PART III<BR>Managing the File System

</I></FONT></H2>

<DL>

<DT>14&nbsp;&nbsp;Managing File Systems

<DT>15&nbsp;&nbsp;Using Samba

<DT>16&nbsp;&nbsp;Understanding the File and Directory System

<DT>17&nbsp;&nbsp;Managing Files and Directories

</DL>

<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 14<BR>Managing File Systems

</FONT></H2>

<P><I>by Jack Tackett</I></P>

<DL>

<DT><B>In this chapter</B>

<DT>Understanding File Systems

<DT>Mounting and Unmounting File Systems

<DT>Understanding the Network File System

<DT>Maintaining File Systems

<DT>Using the <TT>fsck</TT> Command

<DT>Creating and Formatting File Systems

<DT>Using Swap Files and Partitions

</DL>

<P>File systems form the basis for all data on a Linux system. Linux programs, libraries, system files, and user files all reside on file systems. Proper management of file systems is critical because all your data and programs exist on top of file systems.

</P>

<P>Many of the steps outlined in this chapter are performed automatically when you install Linux. However, you should learn to manage your file systems so that you can create, manage, and maintain your Linux system. Understanding file-system management is critical to successful systems administration. Your file system must work properly for your Linux system to work at all.</P>

<H3><A NAME="Heading2"></A><FONT COLOR="#000077">Understanding File Systems</FONT></H3>

<P>Under Linux, the file space that&#146;s visible to users is based on a tree structure, with the root at the top. The various directories and files in this space branch downward from the root. The top directory, /, is known as the <I>root directory</I>. Figure 14.1 gives a graphical example of a tree structure.</P>

<P><A NAME="Fig1"></A><A HREF="javascript:displayWindow('images/14-01.jpg',497,230 )"><IMG SRC="images/14-01t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/14-01.jpg',497,230)"><FONT COLOR="#000077"><B>Fig. 14.1</B></FONT></A>&nbsp;&nbsp;Picture the Linux file system as an upside-down tree, with the root at the top and the branches and leaves spreading downward.</P>

<P>To users, this directory tree looks like a seamless entity&#151;they just see directories and files. In reality, many of the directories in the file tree are physically located on different partitions on a disk, on different disks, or even on different computers. When one of these disk partitions is attached to the file tree at a directory known as a <I>mount point</I>, the mount point and all directories below it are referred to as a <I>file system</I>.</P>

<P>The Linux operating system is made up of several directories and many different files. Depending on how you selected your installation, these directories may be different file systems. Typically, most of the operating system resides on two file systems: the root file system, known as /, and a file system mounted under /usr (pronounced <I>user</I>).</P>

<P>If you change directories to the root directory with the <TT>cd /</TT> command and ask for a directory listing, you see several directories. These make up the contents of the root file system and provide the mount points for other file systems as well.</P>

<P>The /bin directory contains executable programs, known as <I>binaries</I>. (In fact, the directory named /bin is short for <I>binary</I>.) These programs are essential system files. Many Linux commands, such as <I>ls</I>, are actually programs found in this directory.</P>

<P>The /sbin directory is also used to store system binary files. Most files in this directory are used for system administration purposes.</P>

<P>The /etc directory is very important, containing many of the Linux system configuration files. Essentially, these files give your Linux system its &#147;personality.&#148; The password file, passwd, is found here, as is the list of file systems to mount at startup, fstab. Also, this directory contains the startup scripts for Linux, the list of hosts with IP addresses that you want permanently recorded, and many other types of configuration information.</P>

<P>The shared libraries that programs use when they run are stored in the /lib directory. By using shared libraries, many programs can reuse the same code, and these libraries can be stored in a common place, thus reducing the size of your programs at run time.</P>

<P>The /dev directory contains special files known as <I>device files</I>, which are used to access all the different types of hardware on your system. For example, the /dev/mouse file is for reading input from the mouse. By organizing access to hardware devices in this way, Linux effectively makes the interface to a hardware device look like any other piece of software. This means that you, in many cases, can use the same syntax that you use with software to perform operations on computer hardware devices. For example, to create a tape archive of your home directory on a floppy drive, you can use the following command:</P>

<!-- CODE SNIP //-->

<PRE>

tar -cdf /dev/fd0 -tackett

</PRE>

<!-- END CODE SNIP //-->

<P>/dev/fd0 indicates that the <TT>tar</TT> command should use the floppy drive identified by fd0.</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR>&#149; <B>See</B> &#147;Using <TT>tar</TT>,&#148; <B>p. 229</B><HR></FONT>

</BLOCKQUOTE>

<P>Many of the devices in the /dev directory are in logical groups. Table 14.1 lists some of the most commonly used devices in the /dev directory.

</P>

<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 14.1</B> Commonly Used Devices in the /dev Directory

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TH WIDTH="20%" ALIGN="LEFT">Device File

<TH WIDTH="80%" ALIGN="LEFT">Description

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TD VALIGN="TOP">/dev/console

<TD>The <I>system console</I>, which is the computer monitor physically connected to your Linux system.

<TR>

<TD VALIGN="TOP">/dev/hd

<TD>The device driver interface to IDE hard drives. The /dev/hda1 device refers to the first partition on hard drive hda. The device /dev/hda refers to the entire hard disk hda.

<TR>

<TD VALIGN="TOP">/dev/sd

<TD>The device driver interface for SCSI disks. The same conventions for SCSI disks and partitions apply as they do to the IDE /dev/hd devices.

<TR>

<TD VALIGN="TOP">/dev/fd

<TD>Device drivers that provide support for floppy drives. /dev/fd0 is the first floppy drive and /dev/fd1 is the second floppy drive.

<TR>

<TD VALIGN="TOP">/dev/st

<TD>The device driver for SCSI tape drives.

<TR>

<TD VALIGN="TOP">/dev/tty

<TD>Device drivers that provide different consoles for user input. The name comes from when terminals known as <I>teletypes</I> were physically hooked to a UNIX system. Under Linux, these files provide support for the virtual consoles that can be accessed by pressing &lt;Alt-F1&gt; through &lt;Alt-F6&gt;. These virtual consoles provide separate simultaneous local login sessions.

<TR>

<TD VALIGN="TOP">/dev/pty

<TD>Device drivers that provide support for pseudo-terminals, which are used for remote login sessions such as login sessions using Telnet.

<TR>

<TD VALIGN="TOP">/dev/ttyS

<TD>The serial interface ports on your computer. /dev/ttyS0 corresponds to COM1 under MS-DOS. If you have a serial mouse, /dev/mouse is a symbolic link to the appropriate ttyS device that your mouse is connected to.

<TR>

<TD>/dev/cua

<TD>Special call-out devices used with modems.

<TR>

<TD VALIGN="TOP">/dev/null

<TD>A very special device&#151;essentially a black hole. All data written to /dev/null is lost forever. This can be very useful if you want to run a command and throw away the standard output or the standard error. Also, if /dev/null is used as an input file, a file of zero length is created.

<TR>

<TD COLSPAN="2"><HR>

</TABLE>

<P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch13/262-262.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="268-270.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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