# resizing an ext4 journal

## jel

Background: The journal of one of my ext4 partitions got corrupted somehow (unreliable external disk, has a history of failing) and I could neither mount nor fsck. I created a new journal with tune2fs, and now the filesys fscks and mounts OK. However, after perusing dumpe2fs -h and comparing journal size with a couple of other partitions I realize that I need to resize the journal (it is much too large).

How do I resize the journal of an ext4 fs? Failing that, how do I delete the current journal (is that safe?) so I can create a new one?

TIA!

----------

## coolsnowmen

you should not mess with this stuff with the FS mounted.  Make sure it was cleanly unmounted (e.g. that nothing important still resides in the journal); if necessary, mount it and unmount it again from commandline.

You can remove a journal as per tune2fs with -O ^has_journal, and you can add it again with -J size=

Feel free to check between commands with dumpe2fs -h  but more importantly, for safety, I would force an fsck before mounting it again.

Edit: all information obtained from 

```
man tune2fs
```

----------

## jel

Thanks, I knew I could count on the trusty old gentoo community.  :Smile: 

(I know about man pages, but I wanted to get a real opinion from a real person. I have a history of misinterpreting man pages and I really don't want to cause any more corruption to that poor disk.)

----------

## coolsnowmen

 *jel wrote:*   

> I have a history of misinterpreting man pages and I really don't want to cause any more corruption to that poor disk.)

  Understandable.  You can always test stuff like that on an image file.  Just dd a 100MB image. Mount it, put some files in it. Unmount it, tune2fs and be wary or warning or errors. mount it again, and make sure the files are still there.

----------

## jel

 *coolsnowmen wrote:*   

> You can always test stuff like that on an image file.  Just dd a 100MB image. Mount it, put some files in it. Unmount it, tune2fs and be wary or warning or errors. mount it again, and make sure the files are still there.

 

Great tip that never occured to me, thanks.

----------

