Simple Steps for Creating Ext3 Filesystems

Here are the steps you can take to set up ext3 filesystems on a harddisk. It's assumed that your linux kernel has detected the harddisk and you have the required utilities and privilege to do the job.

Partition Harddisk

Suppose that your harddisk is located at /dev/hdb. First, partition your harddisk with fdisk.

# fdisk /dev/hdb

Create at least one Linux partition. You may need to reboot your system then so that the kernel reads the new partition information from the harddisk. You can also use other partitioning tools such as GNU Parted.

Format Ext3 Partitions

The standard utilities for managing ext2/ext3 filesystems are provided in e2fsprogs, which is packaged in almost every Linux distribution. Suppose that you want to format /dev/hdb1 as an ext3 partition. Do:

# mke2fs -j /dev/hdb1 -L label

That's all! The option -j tells mke2fs to include an ext3 journal. Without the option, an ext2 partition will be created instead. The option -L label specifies a volume label for the partition. It is generally advisable to tag a unique label for the partition so that you can use fstab to mount it in a simpler way.

To change the label of an existing ext3 partition, use e2label:

# e2label /dev/hdb1 label

Replace label with the label you would like to put. A label can be at most 16 characters long. If you omit the argument label, e2label simply displays the current label.

Other Useful Operations

If you want to upgrade an ext2 partition to ext3 partition, make sure that the partition is not mounted and do:

# tune2fs -j /dev/hdb1

To check the integrity of an ext3 partition, make sure that it's not mounted and do:

# e2fsck /dev/hdb1

Be aware that these ext3 tools can destroy your data if you use them incorrectly. So play with them carefully.