The EXT2 Filesystem
Oracle Tips by Mike Ault
The, Ext2fs is based on the Extfs code with many
reorganizations and many improvements. It has been designed with
evolution in mind and contains space for future improvements. The
Second Extended File System has been designed and implemented to fix
some problems present in the first Extended File System.
The Ext2fs supports standard Unix file types: regular
files, directories, device special files and symbolic links.
Ext2fs is able to manage filesystems created on really
big partitions. While the original kernel code restricted the maximal
filesystem size to 2 GB, recent work in the VFS layer have raised this
limit to 4 TB. Thus, it is now possible to use big disks without the
need of creating many partitions.
Ext2fs provides long file names. It uses variable length
directory entries. The maximal file name size is 255 characters. This
limit could be extended to 1012 if needed.
Ext2fs reserves some blocks for the super user (root).
Normally, 5% of the blocks are reserved. This allows the administrator
to recover easily from situations where user processes fill up
”Advanced” Ext2fs features
In addition to the standard Unix features, Ext2fs
supports some extensions which are not usually present in Unix
File attributes allow the users to modify the kernel
behavior when acting on a set of files. One can set attributes on a
file or on a directory. In the later case, new files created in the
directory inherit these attributes.
BSD or System V Release 4 semantics can be selected at
BSD-like synchronous updates can be used in Ext2fs.
Ext2fs allows the administrator to choose the logical
block size when creating the filesystem. Block sizes can typically be
1024, 2048 and 4096 bytes. Using big block sizes can speed up I/O
since fewer I/O requests, and thus fewer disk head seeks, need to be
done to access a file.
Ext2fs implements fast symbolic links.
Ext2fs keeps track of the filesystem state.
Always skipping filesystem checks may sometimes be
dangerous, so Ext2fs provides two ways to force checks at regular
intervals. A mount counter is maintained in the superblock. Each time
the filesystem is mounted in read/write mode, this counter is
incremented. When it reaches a maximal value (also recorded in the
superblock), the filesystem checker forces the check even if the
filesystem is ``Clean''.
Mount options can also be used to change the kernel
An attribute allows the users to request secure deletion
on files. When such a file is deleted, random data is written in the
disk blocks previously allocated to the file. This prevents malicious
people from gaining access to the previous content of the file by
using a disk editor.
Last, new types of files inspired from the 4.4 BSD
filesystem have recently been added to Ext2fs. Immutable files can
only be read: nobody can write or delete them. This can be used to
protect sensitive configuration files. Append-only files can be opened
in write mode but data is always appended at the end of the file. Like
immutable files, they cannot be deleted or renamed. This is especially
useful for log files which can only grow.
SEE CODE DEPOT FOR FULL SCRIPTS
For more information on this topic, I recommend Don
Burleson's latest book "Oracle
Tuning: The Definitive Reference".
You can buy it direct from the publisher for 50%-off and get
instant access to the code depot of Oracle tuning scripts:
Expert Remote DBA
BC is America's oldest and largest Remote DBA Oracle support
provider. Get real Remote DBA experts, call
BC Remote DBA today.