SHARE
Facebook X Pinterest WhatsApp

tune2fs Makes It Easy to Play With Filesystems

Written By
thumbnail Juliet Kemp
Juliet Kemp
Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



Juliet Kemp

The tune2fs command allows you to set assorted filesystem parameters on a mounted ext2 or ext3 filesystem. The basic syntax is:

Tip of the Trade: With the tune2fs command you can set assorted filesystem parameters on a mounted ext2 or ext3 filesystem.
tune2fs OPTIONS device

device will be something like /dev/hda1. Here are a couple of useful options to try out.

  • -c max-mount-counts enables you to change the number of
    mounts that trigger an automatic e2fsck check. To turn checking
    off altogether, use -1 or 0 – but use this with extreme caution!
    More useful is setting the value to different numbers for different
    partitions, so that you will not have every partition checked on the same
    bootup.
  • -j adds an ext3 journal to the filesystem, enabling you to
    journalize your non-journaled ext2 filesystems on the fly. The
    -J option sets journal parameters – you can change the
    journal size, or use an external device for the journal, e.g. if your
    existing filesystem is full). Since the journal file created is
    immutable, the file will be moved to a special inode next time you reboot.
    However, if you’re editing the root filesystem, you may need to run
    e2fsck from a rescue floppy, as the root FS is mounted read-only
    on boot. (Some systems, including Debian, have a workaround for
    this.)
  • -O options sets mount options and/or filesystem features for
    the system. If you set -O sparse_super, this limits the number
    of backup superblocks and can save some space in really large filesystems.
    For large directories, -O dir_index uses hashed b-trees to speed
    up directory lookups. Set more than one option at the same time by using
    a comma (no space!) between options. For example, -O
    dir_index,sparse_super
    for that giant filesystem with the big
    directories.
thumbnail Juliet Kemp

Juliet Kemp is a ServerWatch contributor.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.