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

📄 unx35.htm

📁 Linux Unix揭密.高质量电子书籍.对学习Linux有大帮助,欢迎下载学习.
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<HTML>

<HEAD>

<TITLE>UNIX Unleashed unx35.htm</TITLE>

<LINK REL="ToC" HREF="index.htm">

<LINK REL="Next" HREF="unx36.htm">

<LINK REL="Previous" HREF="unx34.htm"></HEAD>

<BODY TEXT="#000000" LINK="#0000FF" VLINK="#800080" bgcolor=white>

<P><A HREF="unx34.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index.htm"><IMG SRC="blutoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="unx36.htm"><IMG SRC="blunext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>

<A HREF="index.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Home"></A>

</P><UL>

<LI>

<A HREF="#I1">35 &#151; File System Administration</A></LI>

<UL>

<UL>

<UL>

<UL>

<LI>

<A HREF="#I3">By Sidney Weinstein</A></LI></UL></UL>

<LI>

<A HREF="#I4">How UNIX Uses Disks</A></LI>

<UL>

<LI>

<A HREF="#I5">The Pathname</A></LI>

<LI>

<A HREF="#I6">Some Definitions</A></LI>

<LI>

<A HREF="#I7">The System V Release 4 File System Layout</A></LI></UL>

<LI>

<A HREF="#I8">Formatting a Disk</A></LI>

<UL>

<LI>

<A HREF="#I9">Low-Level Format</A></LI>

<UL>

<LI>

<A HREF="#I10">Formatting ESDI, MFM, or SMD Drives</A></LI>

<LI>

<A HREF="#I11">IDE</A></LI>

<LI>

<A HREF="#I12">SCSI</A></LI></UL>

<LI>

<A HREF="#I13">Dealing with Flawed Sectors</A></LI>

<UL>

<LI>

<A HREF="#I14">Factory Flaw Map</A></LI>

<LI>

<A HREF="#I15">Newly Developed Flaws After Formatting</A></LI></UL>

<LI>

<A HREF="#I16">Labeling the Disk</A></LI>

<UL>

<LI>

<A HREF="#I17">PC Partitions Versus UNIX Slices</A></LI>

<LI>

<A HREF="#I18">UNIX Slices</A></LI>

<LI>

<A HREF="#I19">Configuring the Slices</A></LI>

<LI>

<A HREF="#I20">Partition Uses</A></LI></UL></UL>

<LI>

<A HREF="#I21">Preparing a File System</A></LI>

<UL>

<LI>

<A HREF="#I22">Choosing a File System Type</A></LI>

<UL>

<LI>

<A HREF="#I23">s5&#151;The System V File System</A></LI>

<LI>

<A HREF="#I24">ufs&#151;The UNIX File System (Formerly the Berkeley Fast File System)</A></LI>

<LI>

<A HREF="#I25">vxfs&#151;The Veritas Extent-Based File System</A></LI></UL>

<LI>

<A HREF="#I26">Choosing File System Parameters</A></LI>

<UL>

<LI>

<A HREF="#I27">Number of Inodes</A></LI>

<LI>

<A HREF="#I28">Block Size</A></LI>

<LI>

<A HREF="#I29">Expected Fragmentation/Fragment Size</A></LI>

<LI>

<A HREF="#I30">Cylinder Size</A></LI>

<LI>

<A HREF="#I31">Rotational Delay</A></LI></UL>

<LI>

<A HREF="#I32">Making File Systems with newfs</A></LI>

<LI>

<A HREF="#I33">Making File Systems with mkfs</A></LI>

<UL>

<LI>

<A HREF="#I34">Making ufs File Systems</A></LI>

<LI>

<A HREF="#I35">Making vxfs File Systems</A></LI></UL>

<LI>

<A HREF="#I36">The lost+found Directory</A></LI></UL>

<LI>

<A HREF="#I37">Mounting File Systems</A></LI>

<UL>

<LI>

<A HREF="#I38">Where to Mount</A></LI>

<LI>

<A HREF="#I39">How Permissions of the Underlying Mount Point Affect the Mounted File System</A></LI>

<LI>

<A HREF="#I40">Mounting a File System One Time</A></LI>

<LI>

<A HREF="#I41">Mounting a File System Every Time at Boot</A></LI>

<LI>

<A HREF="#I42">Unmounting a File System</A></LI></UL>

<LI>

<A HREF="#I43">Checking File Systems</A></LI>

<UL>

<LI>

<A HREF="#I44">The fsck Utility</A></LI>

<UL>

<LI>

<A HREF="#I45">The Super-Block</A></LI>

<LI>

<A HREF="#I46">Inodes</A></LI></UL>

<LI>

<A HREF="#I47">What Is a Clean (Stable) File System?</A></LI>

<LI>

<A HREF="#I48">Where Is fsck?</A></LI>

<LI>

<A HREF="#I49">When Should I Run fsck?</A></LI>

<LI>

<A HREF="#I50">How Do I Run fsck?</A></LI>

<UL>

<LI>

<A HREF="#I51">Checking s5 File Systems</A></LI>

<LI>

<A HREF="#I52">Checking ufs File Systems</A></LI>

<LI>

<A HREF="#I53">Checking vxfs File Systems</A></LI></UL>

<LI>

<A HREF="#I54">What Do I Do After fsck Finishes?</A></LI>

<LI>

<A HREF="#I55">Dealing with What Is in lost+found</A></LI></UL>

<LI>

<A HREF="#I56">Finding and Reclaiming Space</A></LI>

<UL>

<LI>

<A HREF="#I57">What Takes Space</A></LI>

<LI>

<A HREF="#I58">Determining Who Is Using Up the Disk</A></LI>

<LI>

<A HREF="#I59">The System Administrator's Friend The find Utility</A></LI></UL>

<LI>

<A HREF="#I60">Reorganizing the File System Hierarchy</A></LI>

<UL>

<LI>

<A HREF="#I61">Using Symbolic Links to Hide Actual Disk Locations</A></LI>

<LI>

<A HREF="#I62">Moving Trees via cpio</A></LI></UL>

<LI>

<A HREF="#I63">Summary</A></LI></UL></UL></UL>



<H1 ALIGN="CENTER">

<CENTER><A ID="I1" NAME="I1">

<BR>

<FONT SIZE=5><A ID="I2" NAME="I2"></A><B>35 &#151; File System Administration</B>

<BR></FONT></A></CENTER></H1>

<H5 ALIGN="CENTER">

<CENTER><A ID="I3" NAME="I3">

<FONT SIZE=3><B>By Sidney Weinstein</B>

<BR></FONT></A></CENTER></H5>

<P>In DOS, the primary division of file storage space is disk drives. These are further broken down into directories. UNIX uses a slightly different system that is also a bit more flexible. The primary division of file storage space is the file system. 
File systems can be placed anywhere in the directory hierarchy, enabling the tree to be expanded wherever space is needed.

<BR></P>

<P>In DOS, a disk drive is divided into partitions, each of which is a logical drive letter. In UNIX, a disk drive is divided into slices, each one of which can be a file system. Both are dividing the disk into logical disks for use by their respective 
operating systems.

<BR></P>

<P>This chapter walks you through adding, administering, checking, and backing up UNIX file systems. From a basic review of where UNIX places things, to how to install, configure, and use disk drives, you will see how UNIX deals with disk devices. The file 

system section describes how to administer and maintain the files and free space. Finally, I cover protecting your data from destruction from hardware failure, software failure, and pilot error by performing regular backups using the backup tools built 
into each UNIX system.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I4" NAME="I4">

<FONT SIZE=4><B>How UNIX Uses Disks</B>

<BR></FONT></A></CENTER></H3>

<P>UNIX views all disks as a continuous hierarchy starting at /, the root. It doesn't matter whether they are on the same disk drive, of the same file system type, or even on the same computer. What makes this possible is the file system. Each file system 

is independent of the others and allows UNIX to make them all look the same. Before I delve into creating and administering the disk space, some definitions and introduction are in order.

<BR></P>

<H4 ALIGN="CENTER">

<CENTER><A ID="I5" NAME="I5">

<FONT SIZE=3><B>The Pathname</B>

<BR></FONT></A></CENTER></H4>

<P>A UNIX file is addressed by its pathname. This is the collection of directories starting in one of two places:

<BR></P>

<UL>

<LI>From the top of the tree (/), showing each directory from the root to the file, called an absolute pathname

<BR>

<BR>/usr/bin/cat

<BR>

<BR></LI>

<LI>From the current directory, going up or down the hierarchy to the file, called a relative pathname

<BR>

<BR>bin/cat

<BR></LI></UL>

<P>Each element between the pathname delimiters (/) is a directory, and the last element is the item being addressed, which in this case is a file.

<BR></P>

<H4 ALIGN="CENTER">

<CENTER><A ID="I6" NAME="I6">

<FONT SIZE=3><B>Some Definitions</B>

<BR></FONT></A></CENTER></H4>

<UL>

<LI><B>File.</B> A collection of bytes on the disk. Its characteristics are specified by the inode in the file system that describes it. Its name is specified by the directory entries that point to that inode. It has no structure but is just a collection 
of bytes.

<BR>

<BR></LI>

<LI><B>Directory.</B> A file with a special meaning overlaid on top of the collection of bytes. The contents of the file are a list of filenames and inode numbers. These are the files in this directory. Although there is a one-to-one mapping of inode to 
disk blocks, there can be a many-to-one mapping from directory entry to inode. Thus, the directory contains the list of items in this directory, but those items might also appear in a different directory.

<BR>

<BR></LI>

<LI><B>Device.</B> A device is a special type of inode entry. It describes a driver in the UNIX kernel. Using this entry, the system performs the I/O via the device driver. These types of entries are used to access the raw underlying disk drive. The UNIX 
device driver makes a device pointed to by these entries appear as a stream of bytes, just like any other file.

⌨️ 快捷键说明

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