Using tune2fs to maintain disks and free up space


Recommended Posts

tune2fs is a useful tool that allows users to adjust ext2/ext3 filesystem options. Chances are that the amount of times Linux does a fsck disk scan on boot is too frequent, or the default %1 reserved space on the file system is amounting to a significant portion of the hard drive. Using tune2fs, you can change these settings and more to better suit your needs.

Before you begin, you should get the names of your hard disks. You can use the command df in the terminal, or you can use System Monitor, shown below:

post-149838-1204575192_thumb.png

Freeing up reserved space

When you format a drive to ext2/ext3, some of that space is reserved automatically. This is a good thing for your root partition because if you fill up the hard drive, Linux will still have space to write to the log file and such. However, if you have say a 350GB hard drive, that 1% amounts to something significant. Additionally, you may not want reserved space on hard drives that are formatted in ext2/3 and are just used for storage.

Set the amount of reserved space to 0%:

tune2fs -m 0 /dev/HARDDRIVE

Set the amount of reserved blocks to 20000, which should be more than sufficient:

tune2fs -r 20000 /dev/HARDDRIVE

Telling tune2fs when to do fsck

If errors are found on the file system, fsck will run no matter what. fsck will also run automatically after 30 mounts by default in Ubuntu. You can use tune2fs to increase the number of mounts and/or have it run after a certain amount of days.

fsck will run after 80 mounts:

tune2fs -c 80 /dev/HARDDRIVE

fsck will disregard the number of mounts:

tune2fs -c 0 /dev/HARDDRIVE

fsck will run after 3 days, 2 months and 1 week

tune2fs -i d3 m2 w1 /dev/HARDDRIVE

Setting a volume label

Want to name your harddrive? You can do that too.

tune2fs -L PORNDRIVE /dev/HARDDRIVE

Edited by Unholy Moley!
  • 5 months later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I'm still rocking iOS 25.x on my primary phone cuz iOS 26 still has usability quirks (mostly aesthetic and thus its UX) which I don't wanna deal with -- and I've been piloting them with all of these updates on my backup phone, so I'm well aware of its "improvements" since iOS 26 was first released (compared to version 26.5.x).
    • Firefox 152.0.4 is out.
    • Then why are you still here?  
    • Glary Utilities 6.44.0.48 by Razvan Serea Glary Utilities offers numerous powerful and easy-to-use system tools and utilities to fix, speed up, maintain and protect your PC. Glary Utilities allow you to clean common system junk files, as well as invalid registry entries and Internet traces. You can manage and delete browser add-ons, analyze disk space usage and find duplicate files. You can also view and manage installed shell extensions, encrypt your files from unauthorized access and use, split large files into smaller manageable files and then rejoin them. Furthermore, Glary Utilities includes the options to find, fix, or remove broken Windows shortcuts, manage the programs that start at Windows startup and uninstall software. All Glary Utilities tools can be accessed through an eye-pleasing and totally simplistic interface. Glary Utilities 6.44.0.48 changelog: Optimized Context Menu Manager: Improved features based on user feedback. Optimized Wipe Free Space: Optimized the interface display for a better user experience. Minor GUI improvements. Minor bug fixes. Download: Glary Utilities 6.44.0.48 | 27.0 MB (Freeware) Download: Portable Glary Utilities | 32.3 MB View: Glary Utilities Homepage | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • why to touch this audio corpse? use aimp
  • Recent Achievements

    • Reacting Well
      Juan Dela earned a badge
      Reacting Well
    • Week One Done
      Collagen Project earned a badge
      Week One Done
    • Reacting Well
      Wakeen1966 earned a badge
      Reacting Well
    • Rookie
      Almohandis went up a rank
      Rookie
    • Apprentice
      jahara21 went up a rank
      Apprentice
  • Popular Contributors

    1. 1
      +primortal
      514
    2. 2
      +Edouard
      266
    3. 3
      PsYcHoKiLLa
      146
    4. 4
      Steven P.
      96
    5. 5
      macoman
      54
  • Tell a friend

    Love Neowin? Tell a friend!