Recreating ext4 journal: reboot required

ext4filesystems

Most docs on disabling/creating the ext4 journal for root involve a reboot. If we:

  • turn off the journal via tune2fs
  • fsck the filesystem
  • turn the journal back on via tune2fs
  • fsck the filesystem
  • then reboot

Will that effectively re-create the journal? In this specific case we have a corrupted journal we wish to re-initialize. If we can eliminate the intervening reboot then we can better automate this process.

I don't actually see why a reboot is required at any point?

Thanks.

Best Answer

Your point would be excellent if it were not for the logical impossibility in steps two and four. You cannot meaningfully fsck a mounted filesystem; they are made self-inconsistent by the very act of being mounted. You can't unmount the partition to fsck it, because it's the root partition. The fsck requirement, I suspect, is why all instructions involve a reboot or two.