% Linux Installation and Getting Started    -*- TeX -*-
% mkfs.tex
% Copyright (c) 1992-1994 by Matt Welsh <mdw@sunsite.unc.edu>
%
% This file is freely redistributable, but you must preserve this copyright 
% notice on all copies, and it must be distributed only as part of "Linux 
% Installation and Getting Started". This file's use is covered by the 
% copyright for the entire document, in the file "copyright.tex".

\subsection{Creating the filesystems}
\namedlabel{sec-install-linux-mkfs}{Creating the filesystems}
\namedlabel{sec-install-linux-mke2fs}{Creating the filesystems}

\index{filesystems!creating|(}
\index{mke2fs@{\tt mke2fs}|(}
\index{installation!mke2fs@{\tt mke2fs}|(}

Before you can use your Linux partitions to store files, you must create
{\bf filesystems} on them. Creating a filesystem is analogous to formatting
a partition under MS-DOS or other operating systems. We discussed 
filesystems briefly in Section~\ref{sec-install-linux-reqs}.

There are several types of filesystems available for Linux. Each filesystem
type has its own format and set of characteristics (such as filename
length, maximum file size, and so on). Linux also supports several 
``third-party'' filesystem types such as the MS-DOS filesystem. 

The most commonly used filesystem type is the {\bf Second Extended 
Filesystem}, or {\em ext2fs}. The {\em ext2fs\/} is one of the most
efficient and flexible filesystems; it allows filenames up to 256 characters
and filesystem sizes of up to 4 terabytes. In Chapter~\ref{chap-sysadm},
we'll discuss the various filesystem types available for Linux. Initially,
however, we suggest that you use the {\em ext2fs\/} filesystem.

\ifodd\igsslack
If you are installing the Slackware distribution, filesystems are
created automatically for you by the installation procedure 
described in the next section. If you wish to create your filesystems
by hand, however, follow the procedure described here.
\fi

To create an {\em ext2fs\/} filesystem, use the command
\begin{tscreen}
mke2fs -c \cparam{partition} \cparam{size}
\end{tscreen}
where \cparam{partition} is the name of the partition, and
\cparam{size} is the size of the partition in blocks. For example, to
create a 82080-block filesystem on {\tt /dev/hda2}, use the command
\begin{tscreen}
\# {\em mke2fs --c /dev/hda2 82080}
\end{tscreen}

If you're using multiple filesystems for Linux, you'll need to use the
appropriate {\tt mke2fs} command for each filesystem. 

If you have encountered any problems at this point, see
Section~\ref{sec-install-probs} at the end of this chapter.

\index{filesystems!creating|)}
\index{mke2fs@{\tt mke2fs}|)}
\index{installation!mke2fs@{\tt mke2fs}|)}
