Newbie Question about Formating Partitions

Ken Fuchs kfuchs at winternet.com
Sun Jul 11 14:02:41 PDT 2004


"noname" aka braindead wrote:

>I have some small questions:

>1. After creating Partitions with cfdisk, is it enough to format these
>partitions with:
>    mke2fs - for ext2 partitions
>    mkfs.ext3 - for ext3 partitions
>    mkswap - for swap partitions (and then swapon)
>    to use them ?

First of all, the term "format" is not accurate.  These commands make
filesystems in the specified partition.  (Low level) formatting is
generally done on a hard drive as a final step in its production.

Yes (rephrasing "format" with "make a filesystem in"), just be sure to
specify the correct block device as the argument.  For example:

# mke2fs /dev/hda6

# mkfs.ext3 /dev/sda6

# mkswap /dev/hda5

# mkswap /dev/sda5

An ext3 filesystem can also be made with the -j option of mke2fs:

# mke2fs -j /dev/sda6

Note that ext3 is simply ext2 with a journaling file added.  The -j
option simply adds a journaling file whose size is determined by the
total size of the partition specified by the block device argument.

>2. I mentioned that a formating of a partition with mkfs.ext3 is much faster
>than formating it with the DOS command "format", is this normal ?

Yes, mkfs.ext3 is much faster than the DOS format.  It only needs to set
up the filesystem header information (which is a very small fraction of
the partition's size) and the similarly small journaling file.

Note that mkfs.ext3 (or mks2fs) do not actually format the partition.
They simply create a filesystem on the partition and usually write to
only a small fraction of the blocks on that partition (since the
filesystem created is almost empty).

>3. And i mentioned too, that formating a 600mb swap partition with mkswap
>takes more time than formating a 8gb ext3 partition with mkfs.ext3, is
>this normal, or did i made anything wrong ?

600MB is very big for a swap partition.  8GB for a ext3 partition is
becoming rather small now that 200+ GB drives are common and relatively
cheap.  It would not surprise to see that formating the 600MB partition
as swap would take longer than making a 8GB ext filesystem.

Sincerely,

Ken Fuchs <kfuchs at winternet.com>



More information about the lfs-support mailing list