430 lines
6.9 KiB
HTML
430 lines
6.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Using Disks and Other Storage Media</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="Linux System Administrators Guide"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Kernel Modules"
|
|
HREF="x1926.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Two kinds of devices"
|
|
HREF="block-char-dev.html"></HEAD
|
|
><BODY
|
|
CLASS="CHAPTER"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Linux System Administrators Guide: </TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x1926.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="block-char-dev.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="CHAPTER"
|
|
><H1
|
|
><A
|
|
NAME="DISK-USAGE"
|
|
></A
|
|
>Chapter 5. Using Disks and Other Storage Media</H1
|
|
><DIV
|
|
CLASS="TOC"
|
|
><DL
|
|
><DT
|
|
><B
|
|
>Table of Contents</B
|
|
></DT
|
|
><DT
|
|
>5.1. <A
|
|
HREF="block-char-dev.html"
|
|
>Two kinds of devices</A
|
|
></DT
|
|
><DT
|
|
>5.2. <A
|
|
HREF="hard-disk.html"
|
|
>Hard disks</A
|
|
></DT
|
|
><DT
|
|
>5.3. <A
|
|
HREF="san.html"
|
|
>Storage Area Networks - Draft</A
|
|
></DT
|
|
><DT
|
|
>5.4. <A
|
|
HREF="net-attached.html"
|
|
>Network Attached Storage - Draft</A
|
|
></DT
|
|
><DD
|
|
><DL
|
|
><DT
|
|
>5.4.1. <A
|
|
HREF="net-attached.html#NET-FILE-SYS"
|
|
>NFS</A
|
|
></DT
|
|
><DT
|
|
>5.4.2. <A
|
|
HREF="net-attached.html#CIFS"
|
|
>CIFS</A
|
|
></DT
|
|
></DL
|
|
></DD
|
|
><DT
|
|
>5.5. <A
|
|
HREF="floppies.html"
|
|
>Floppies</A
|
|
></DT
|
|
><DT
|
|
>5.6. <A
|
|
HREF="cdrom.html"
|
|
>CD-ROMs</A
|
|
></DT
|
|
><DT
|
|
>5.7. <A
|
|
HREF="tapes.html"
|
|
>Tapes</A
|
|
></DT
|
|
><DT
|
|
>5.8. <A
|
|
HREF="formatting.html"
|
|
>Formatting</A
|
|
></DT
|
|
><DT
|
|
>5.9. <A
|
|
HREF="partitions.html"
|
|
>Partitions</A
|
|
></DT
|
|
><DD
|
|
><DL
|
|
><DT
|
|
>5.9.1. <A
|
|
HREF="partitions.html#MBR"
|
|
>The MBR, boot sectors and partition table</A
|
|
></DT
|
|
><DT
|
|
>5.9.2. <A
|
|
HREF="partitions.html#EXTENDED-LOGICAL-PART"
|
|
>Extended and logical partitions</A
|
|
></DT
|
|
><DT
|
|
>5.9.3. <A
|
|
HREF="partitions.html#PART-TYPES"
|
|
>Partition types</A
|
|
></DT
|
|
><DT
|
|
>5.9.4. <A
|
|
HREF="partitions.html#PART-HD"
|
|
>Partitioning a hard disk</A
|
|
></DT
|
|
><DT
|
|
>5.9.5. <A
|
|
HREF="partitions.html#DEV-FILES-PARTS"
|
|
>Device files and partitions</A
|
|
></DT
|
|
></DL
|
|
></DD
|
|
><DT
|
|
>5.10. <A
|
|
HREF="filesystems.html"
|
|
>Filesystems</A
|
|
></DT
|
|
><DD
|
|
><DL
|
|
><DT
|
|
>5.10.1. <A
|
|
HREF="filesystems.html#FS-INTRO"
|
|
>What are filesystems?</A
|
|
></DT
|
|
><DT
|
|
>5.10.2. <A
|
|
HREF="filesystems.html#FS-GALORE"
|
|
>Filesystems galore</A
|
|
></DT
|
|
><DT
|
|
>5.10.3. <A
|
|
HREF="filesystems.html#USE-WHICH-FS"
|
|
>Which filesystem should be used?</A
|
|
></DT
|
|
><DT
|
|
>5.10.4. <A
|
|
HREF="filesystems.html#CREATE-FS"
|
|
>Creating a filesystem</A
|
|
></DT
|
|
><DT
|
|
>5.10.5. <A
|
|
HREF="filesystems.html#FS-BLOCK-SIZE"
|
|
>Filesystem block size</A
|
|
></DT
|
|
><DT
|
|
>5.10.6. <A
|
|
HREF="filesystems.html#FS-COMPARE"
|
|
>Filesystem comparison</A
|
|
></DT
|
|
><DT
|
|
>5.10.7. <A
|
|
HREF="filesystems.html#MOUNT-AND-UMOUNT"
|
|
>Mounting and unmounting</A
|
|
></DT
|
|
><DT
|
|
>5.10.8. <A
|
|
HREF="filesystems.html#AEN3099"
|
|
>Filesystem Security</A
|
|
></DT
|
|
><DT
|
|
>5.10.9. <A
|
|
HREF="filesystems.html#FSCK"
|
|
>Checking filesystem integrity with
|
|
<B
|
|
CLASS="COMMAND"
|
|
>fsck</B
|
|
></A
|
|
></DT
|
|
><DT
|
|
>5.10.10. <A
|
|
HREF="filesystems.html#BADBLOCKS"
|
|
>Checking for disk errors with <B
|
|
CLASS="COMMAND"
|
|
>badblocks</B
|
|
></A
|
|
></DT
|
|
><DT
|
|
>5.10.11. <A
|
|
HREF="filesystems.html#FRAGMENTATION"
|
|
>Fighting fragmentation?</A
|
|
></DT
|
|
><DT
|
|
>5.10.12. <A
|
|
HREF="filesystems.html#FS-OTHER-TOOLS"
|
|
>Other tools for all filesystems</A
|
|
></DT
|
|
><DT
|
|
>5.10.13. <A
|
|
HREF="filesystems.html#FS-EXT3-TOOLS"
|
|
>Other tools for the ext2/ext3 filesystem</A
|
|
></DT
|
|
></DL
|
|
></DD
|
|
><DT
|
|
>5.11. <A
|
|
HREF="disk-no-fs.html"
|
|
>Disks without filesystems</A
|
|
></DT
|
|
><DT
|
|
>5.12. <A
|
|
HREF="alloc-disk.html"
|
|
>Allocating disk space</A
|
|
></DT
|
|
><DD
|
|
><DL
|
|
><DT
|
|
>5.12.1. <A
|
|
HREF="alloc-disk.html#PART-SCHEMES"
|
|
>Partitioning schemes</A
|
|
></DT
|
|
><DT
|
|
>5.12.2. <A
|
|
HREF="alloc-disk.html#LVM"
|
|
>Logical Volume Manager (LVM)</A
|
|
></DT
|
|
><DT
|
|
>5.12.3. <A
|
|
HREF="alloc-disk.html#SPACE-REQ"
|
|
>Space requirements</A
|
|
></DT
|
|
><DT
|
|
>5.12.4. <A
|
|
HREF="alloc-disk.html#ALLOC-SPACE-EX"
|
|
>Examples of hard disk allocation</A
|
|
></DT
|
|
><DT
|
|
>5.12.5. <A
|
|
HREF="alloc-disk.html#ADDING-DISK"
|
|
>Adding more disk space for Linux</A
|
|
></DT
|
|
><DT
|
|
>5.12.6. <A
|
|
HREF="alloc-disk.html#SPACE-SAVING-TIPS"
|
|
>Tips for saving disk space</A
|
|
></DT
|
|
></DL
|
|
></DD
|
|
></DL
|
|
></DIV
|
|
><A
|
|
NAME="AEN1990"
|
|
></A
|
|
><BLOCKQUOTE
|
|
CLASS="BLOCKQUOTE"
|
|
><P
|
|
><SPAN
|
|
CLASS="QUOTE"
|
|
>"On a clear disk you can seek forever.
|
|
"</SPAN
|
|
></P
|
|
></BLOCKQUOTE
|
|
><P
|
|
>When you install or upgrade your system, you need to do a
|
|
fair amount of work on your disks. You have to make filesystems on
|
|
your disks so that files can be stored on them and reserve
|
|
space for the different parts of your system.</P
|
|
><P
|
|
>This chapter explains all these initial activities. Usually,
|
|
once you get your system set up, you won't have to go through the
|
|
work again, except for using floppies. You'll need to come back to
|
|
this chapter if you add a new disk or want to fine-tune your disk
|
|
usage.</P
|
|
><P
|
|
> </P
|
|
><P
|
|
>The basic tasks in administering disks are:
|
|
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
> Format your disk. This does various things to prepare it for use,
|
|
such as checking for bad sectors. (Formatting is nowadays
|
|
not necessary for most hard disks.)</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Partition a hard disk, if you want to use it for several activities
|
|
that aren't supposed to interfere with one another. One reason for
|
|
partitioning is to store different operating systems on the same
|
|
disk. Another reason is to keep user files separate from system
|
|
files, which simplifies back-ups and helps protect the system files
|
|
from corruption.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Make a filesystem (of a suitable type) on each disk or partition.
|
|
The disk means nothing to Linux until you make a filesystem; then
|
|
files can be created and accessed on it.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Mount different filesystems to form a single tree structure, either
|
|
automatically, or manually as needed. (Manually mounted filesystems
|
|
usually need to be unmounted manually as well.)
|
|
</P
|
|
></LI
|
|
></UL
|
|
>
|
|
|
|
</P
|
|
><P
|
|
><A
|
|
HREF="memory-management.html"
|
|
>Chapter 6</A
|
|
> contains information
|
|
about virtual memory and disk caching, of which you also need
|
|
to be aware when using disks.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x1926.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="block-char-dev.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Kernel Modules</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Two kinds of devices</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |