3. Convert Filesystem Type using -j

You can use -j option to convert ext2 to ext3 file system as shown below.

tune2fs -j /dev/sdb1

Note: Execute the above command only on a test system for testing purpose. You might corrupt your filesystem, if you don’t know what you are doing.

4. Set Filesystem Features

You can use -O option to convert ext3 to ext4 file system as shown below.

tune2fs -O extents,uninit_bg,dir_index /dev/sda2

Note: Execute the above command only on a test system for testing purpose. You might corrupt your filesystem, if you don’t know what you are doing.

The following are some of the features that you can set on a filesystem using -O option

debug

bsdgroups

user_xattr

acl

uid16

journal_data

journal_data_ordered

journal_data_writeback

nobarrier

block_validity

discard

nodelalloc

5. Set Volume Label

The following indicates that /dev/sda1 doesn’t have any volume name.

# tune2fs -l /dev/sda1 | grep -i name
Filesystem volume name:

For accessibility purpose, you can set a volume name for your partitions. The following will set the name /home to /dev/sda1 partition.

# tune2fs -L /home /dev/sda1
tune2fs 1.41.12 (17-May-2010)

Now, when you do -l option, you’ll see the name as shown below.

# tune2fs -l /dev/sda1 | grep -i name
Filesystem volume name: /home

6. Last Mounted Directory and Last Time Check

You can use -M option to set the last mounted directory for your file system.

You can also use -T option to indicate the time when the last filesystem check was performed. Under normal circumstances, you don’t need to set this. But, when you are playing around with LVM, you may have to do this to take some consistent snapshots.