Archive for the tag 'ext3'

SBDavid

Converting ext3 files system to ext4

Converting ext3 files system to ext4

You can convert an ext3 file system to ext4 by using a command like the following:

# tune2fs -O extents -E test_fs /dev/DEV

And, you can adjust the inode setting, for example from 128 to 256, to improve efficiency with a command like the following.

# tune2fs -I 256 /dev/DEV

After you have created the file systems on your partitions, a nice tool for adjusting those file systems is the tune2fs command. Using tune2fs, you can change volume labels, how often the file system is checked, and error behavior.
You can also use tune2fs to change an ext2 file system to an ext3 file system so the file system can use journaling.

For example:

# tune2fs -j /dev/sdb1

Creating journal inode: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

By adding the -j option to tune2fs, you can change either the journal size or attach the file system to an external journal block device. After you have used tune2fs to change your file system type, you will need to correct your /etc/fstab file to include changing the file
system type from ext2 to ext3.

tune2fs 1.41.12 (17-May-2010)
Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-g group]
[-i interval[d|m|w]] [-j] [-J journal_options] [-l]
[-m reserved_blocks_percent] [-o [^]mount_options[,...]]
[-r reserved_blocks_count] [-u user] [-C mount_count] [-L volume_label]
[-M last_mounted_dir] [-O [^]feature[,...]]
[-E extended-option[,...]] [-T last_check_time] [-U UUID]
[ -I new_inode_size ] device
SBDavid

Resizing Ext3

Resizing Ext3

An ext3 filesystem can supposedly be expanded with resize2fs while mounted, but standalone would be safer.

A few ways you can do it:

resize2fs
parted
Partition Magic 7.x

In all cases, first convert ext3 –> ext2: [Note: resize2fs works with ext3.]

tune2fs -O ^has_journal /dev/hdax
e2fsck -v -f /dev/hdax

Resize the partitions with tool of choice.

Convert back to ext3

tune2fs -j /dev/hdax
e2fsck -v -f /dev/hdax

-j Add an ext3 journal to the filesystem.

Optimizing the EXT3 file system on Linux

There are some things you can do to give ext3 a boost when you just want speed.

Mount Options noatime,nodiratime

noatime
Do not update inode access times on this file system (e.g, for faster access on the news spool to speed up news servers).

nodiratime
Do not update directory inode access times on this filesystem.

This is one of the quickest and easiest performance gains. This mount option tells the system not to update inode access times. This is a good option for web servers, news servers or other uses with high access file systems

Also from the man pages.

commit=nrsec
Sync all data and metadata every nrsec seconds. The default value is 5 seconds. Zero means default.

#
proc /proc proc defaults 0 0
# / was on /dev/sda1 during installation
UUID=164be035-6571-43b4-820e-cef57b74f1dc / ext3 relatime,noatime,nodiratime,errors=remount-ro 0 1

Disable journaling in ext3 file system

We know that EXT3 file system is nothing but EXT2 + a e. This allows faster FSCK process and avoids metadata corruption.

We can disable journaling (i.e convert EXT3 to EXT2) using tune2fs command.

tune2fs -O^has_journal /dev/xdy

Now the journaling is removed from /dev/xdy partition. The file system for this partition is know EXT2 rather than EXT3.

This is normally used when you want to re-size a partition.

If you want to convert it back to EXT3, use the following command:

tune2fs -j /dev/xdy

Note: The partition should be un-mounted before converting the file-systems. For converting EXT2 to EXT3 you can also have the partition re-mounted as read-only too, but the former is safer.

SBDavid

Creating an ext3 File System

Creating an ext3 File System

After installation, it is sometimes necessary to create a new ext3 file system. For example, if you add a new disk drive to the system, you may want to partition the drive and use the ext3 file system.
The steps for creating an ext3 file system are as follows:

1.Format the partition with the ext3 file system using mkfs.

2.Label the partition using e2label.

The tune2fs allows you to convert an ext2 filesystem to ext3.

/sbin/tune2fs -j block_device

Where block_device contains the ext2 filesystem you wish to convert. You must recreate the initrd image so that it will contain the ext3 kernel module. To create this, run the mkinitrd program.