|
When a hard drive is partitioned,
it is cut into sections, but the sections are empty. It is like a newly
contructed library; shelves, signs, and a card catalogue system must be
put in place before the books are put away.
|
|
The organizational structure inside a partition is called a file system.
With Linux, the standard file system is ext2 and ext3. The ext3 file system
is ext2, plus a log of disk writes called a journal. The journal allows the
system to recover quickly from accidental power outages, among other things.
|
The principal tool for making an ext2/3 file system in a
partition is mke2fs. It
is usually found in /sbin. mkfs.ext2
and mkfs.ext3 are frontends which pass specific options
to mke2fs.
|
|
Simple invocation
|
|
both of which make an ext2 file system on the first partition of
the second drive, and
|
|
|
| make an ext3 file system. |
|
Reserved blocks
The -m option is probably the one of most use to non-experts.
If the file system becomes filled and there is no more space to
write, it is basically unusable because the operating system is
constantly writing to disk. By default, five percent of the
partition is reserved for use by the root user. This allows root
to conduct administrative activities on the partition and
perhaps move some data off. However, this is most critical when
the partition contains / or home directories. For pure data
partitions, this is just lost space. Five percent of a 250Gb
partition is 12.5 Gb. Especially in the case of large
partitions, it is safe to set the reserved space to the minimum,
which is one percent.
|
|
|
|
creates a file system with only 1% of its space reserved for the
root user. tune2fs -m can be used to adjust the reserved blocks
after data is loaded on the partition.
|
|
Volume label
Use -L to add a label to the partition. You can
later refer to this label instead of the device name when
mounting. This provides the same functionality as e2label.
|
mkfs.ext3 -L HOME /dev/hdb1
|
|