Chapter 30. Getting started with an ext3 file system
As a system administrator, you can create, mount, resize, backup, and restore an ext3 file system. The ext3 file system is essentially an enhanced version of the ext2 file system.
30.1. Features of an ext3 file system
Following are the features of an ext3 file system:
Availability: After an unexpected power failure or system crash, file system check is not required due to the journaling provided. The default journal size takes about a second to recover, depending on the speed of the hardware
NoteThe only supported journaling mode in ext3 is
data=ordered
(default). For more information, see the Red Hat Knowledgebase solution Is the EXT journaling option "data=writeback" supported in RHEL?.- Data Integrity: The ext3 file system prevents loss of data integrity during an unexpected power failure or system crash.
- Speed: Despite writing some data more than once, ext3 has a higher throughput in most cases than ext2 because ext3’s journaling optimizes hard drive head motion.
- Easy Transition: It is easy to migrate from ext2 to ext3 and gain the benefits of a robust journaling file system without reformatting.
Additional resources
-
ext3
man page on your system
30.2. Creating an ext3 file system
As a system administrator, you can create an ext3 file system on a block device using mkfs.ext3
command.
Prerequisites
- A partition on your disk. For information about creating MBR or GPT partitions, see Creating a partition table on a disk with parted.
.
+ Alternatively, use an LVM or MD volume.
Procedure
To create an ext3 file system:
For a regular-partition device, an LVM volume, an MD volume, or a similar device, use the following command:
# mkfs.ext3 /dev/block_device
Replace /dev/block_device with the path to a block device.
For example,
/dev/sdb1
,/dev/disk/by-uuid/05e99ec8-def1-4a5e-8a9d-5945339ceb2a
, or/dev/my-volgroup/my-lv
. In general, the default options are optimal for most usage scenarios.For striped block devices (for example, RAID5 arrays), the stripe geometry can be specified at the time of file system creation. Using proper stripe geometry enhances the performance of an ext3 file system. For example, to create a file system with a 64k stride (that is, 16 x 4096) on a 4k-block file system, use the following command:
# mkfs.ext3 -E stride=16,stripe-width=64 /dev/block_device
In the given example:
- stride=value: Specifies the RAID chunk size
- stripe-width=value: Specifies the number of data disks in a RAID device, or the number of stripe units in the stripe.
NoteTo specify a UUID when creating a file system:
# mkfs.ext3 -U UUID /dev/block_device
Replace UUID with the UUID you want to set: for example,
7cd65de3-e0be-41d9-b66d-96d749c02da7
.Replace /dev/block_device with the path to an ext3 file system to have the UUID added to it: for example,
/dev/sda8
.To specify a label when creating a file system:
# mkfs.ext3 -L label-name /dev/block_device
To view the created ext3 file system:
# blkid
Additional resources
-
ext3
andmkfs.ext3
man pages on your system
30.3. Mounting an ext3 file system
As a system administrator, you can mount an ext3 file system using the mount
utility.
Prerequisites
- An ext3 file system. For information about creating an ext3 file system, see Creating an ext3 file system.
Procedure
To create a mount point to mount the file system:
# mkdir /mount/point
Replace /mount/point with the directory name where mount point of the partition must be created.
To mount an ext3 file system:
To mount an ext3 file system with no extra options:
# mount /dev/block_device /mount/point
- To mount the file system persistently, see Persistently mounting file systems.
To view the mounted file system:
# df -h
Additional resources
-
mount
,ext3
, andfstab
man pages on your system - Mounting file systems
30.4. Resizing an ext3 file system
As a system administrator, you can resize an ext3 file system using the resize2fs
utility. The resize2fs
utility reads the size in units of file system block size, unless a suffix indicating a specific unit is used. The following suffixes indicate specific units:
-
s (sectors) -
512
byte sectors -
K (kilobytes) -
1,024
bytes -
M (megabytes) -
1,048,576
bytes -
G (gigabytes) -
1,073,741,824
bytes -
T (terabytes) -
1,099,511,627,776
bytes
Prerequisites
- An ext3 file system. For information about creating an ext3 file system, see Creating an ext3 file system.
- An underlying block device of an appropriate size to hold the file system after resizing.
Procedure
To resize an ext3 file system, take the following steps:
To shrink and grow the size of an unmounted ext3 file system:
# umount /dev/block_device # e2fsck -f /dev/block_device # resize2fs /dev/block_device size
Replace /dev/block_device with the path to the block device, for example
/dev/sdb1
.Replace size with the required resize value using
s
,K
,M
,G
, andT
suffixes.An ext3 file system may be grown while mounted using the
resize2fs
command:# resize2fs /mount/device size
NoteThe size parameter is optional (and often redundant) when expanding. The
resize2fs
automatically expands to fill the available space of the container, usually a logical volume or partition.
To view the resized file system:
# df -h
Additional resources
-
resize2fs
,e2fsck
, andext3
man pages on your system