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

📄 500-503.html

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

<HEAD>

<TITLE>Using Linux:Managing the Filesystem</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=0789716232//-->

<!--TITLE=Using Linux//-->

<!--AUTHOR=William Ball//-->

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

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

<!--CHAPTER=29//-->

<!--PAGES=500-503//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="498-500.html">Previous</A></TD>

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

<TD><A HREF="503-505.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P><FONT SIZE="+1"><B>Creating New Filesystems with <I>cabaret</I>

</B></FONT></P>

<P>After you have configured a new filesystem entry using <TT>cabaret</TT>, you must create the filesystem on the disk itself. The Status button in <TT>cabaret</TT> provides a Format button. The resulting menu gives several options for the filesystem type with the format, but the type you already configured is preselected for you. If the filesystem you want is VFAT (Windows 95), you must format the disk as an MS-DOS disk, because the only difference between the two kinds of filesystems is the different way they handle long filenames.</P>

<H4 ALIGN="LEFT"><A NAME="Heading8"></A><FONT COLOR="#000077">The Red Hat Filesystem Manager</FONT></H4>

<P>An easy way to set up filesystem entries in <TT>/etc/fstab</TT> is with the configuration tool Filesystem Manager in the Red Hat Control Panel (although you can invoke it separately as <TT>fstool</TT>). This program must be run during X11 sessions. The Filesystem Manager is shown in Figure 29.5.</P>

<P><A NAME="Fig5"></A><A HREF="javascript:displayWindow('images/29-05.jpg',640,400 )"><IMG SRC="images/29-05t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/29-05.jpg',640,400)"><FONT COLOR="#000077"><B>Figure 29.5</B></FONT></A>&nbsp;&nbsp;The Filesystem Manager.</P>

<P>When you start <TT>fstool</TT>, it produces a window that contains all the entries in <TT>/etc/fstab</TT>. Each entry shows the device name, mount point, filesystem type, size, space used, and space available. Additionally, each mounted filesystem is marked with an asterisk. The Info button displays extra information about the highlighted filesystem (the same information as is indicated in <TT>/etc/fstab</TT> and in the output of the <TT>df</TT> command).</P>

<P>Filesystems can be mounted or unmounted with two buttons: Mount and Unmount. Any errors that occur are shown in a dialog box; this can happen if, for example, you try to mount a CD-ROM when there is no CD in the drive. (Go ahead and try it.) The Format button works only for hard disk partitions; for these, it runs <TT>mkfs</TT> (see the section &#147;Creating New Filesystems Manually,&#148; later in this chapter). Other media (for example, floppy disks) are formatted differently.</P>

<P>The Check button works only for <TT>ext2</TT> and <TT>minix</TT> filesystems. If you get the error <TT>fsck: command not found</TT>, this just means that the directory <TT>/sbin</TT> is not on your path; you should be able to fix this by running <TT>su - root</TT>. (You might also need to do <TT>export DISPLAY=:0.0</TT>, if that is necessary.) Checking a filesystem can take a while, and the result is shown in a dialog box afterward. It is very unusual for errors to be shown for hard disk filesystems here because these are checked at boot time and don&#146;t get corrupted during the normal operation of Linux.</P>

<P>The NFS menu is used to add and remove NFS network mounts. You can exit the Filesystem Manager by selecting the Quit option from the FSM menu.</P>

<H4 ALIGN="LEFT"><A NAME="Heading9"></A><FONT COLOR="#000077">Editing <I>/etc/fstab</I> Manually

</FONT></H4>

<P>The filesystem table <TT>/etc/fstab</TT> is just a text file; it is designed to have a specific format that is readable by humans and not just computers. <TT>/etc/fstab</TT> is separated into columns by tabs or spaces and you can edit it with your favorite text editor. You must take care, however, if you modify it by hand, because removing or corrupting an entry can make the system unable to mount that filesystem next time it boots. My <TT>/etc/fstab</TT> looks like this:</P>

<!-- CODE //-->

<PRE>

#

# /etc/fstab

#

# You should be using fstool (control-panel) to edit this!

#

#&lt;device&gt; &lt;mountpoint&gt; &lt;filesystemtype&gt; &lt;options&gt;   &lt;dump&gt;

 &lt;fsckorder&gt;



/dev/hda1     /            ext2  defaults  1             1

/dev/hdb5     /home        ext2  defaults,rw        1    2

/dev/hda3     /usr         ext2  defaults           1    2

/dev/hdb1     /usr/src     ext2  defaults           1    3

/dev/hdc      /mnt/cdrom   iso9660  user,noauto,ro  0    0

/dev/sbpcd0   /mnt/pcd     iso9660  user,noauto,ro  0    0

/dev/fd1      /mnt/floppy  vfat     user,noauto     0    0



/proc           /proc          proc  defaults

/dev/hda2       none           swap  sw

</PRE>

<!-- END CODE //-->



<TABLE BORDER="2" BORDERCOLOR="#0000" ALIGN="CENTER">

<TR><TD>

<P><B>Order is important in <TT>/etc/fstab</TT></B><BR>Filesystems appear in <TT>/etc/fstab</TT> in the order in which they are mounted; <TT>/usr</TT> must appear before <TT>/usr/src</TT>, for example, because the mount point for one filesystem exists on the other. Be sure to use the proper order if you have partitioned your hard drive in order to separate parts of the Linux file system.</TABLE>



</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="498-500.html">Previous</A></TD>

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

<TD><A HREF="503-505.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 + -