Disable journaling on ext4 filesystem partition

9

5

I'm running Linux Mint on an SSD. I've read how one optimization is to disable journaling. However, when I run the command:

sudo mke2fs -t ext4 -O ^has_journal /dev/sda1

I get an error saying that the drive is busy. Well, of course it's busy, that's where the whole OS is.
How can I disable this?

Andi Jay

Posted 2012-12-08T22:11:03.397

Reputation: 222

1As in all *nix systems, you have to go into single maintenance user mode, unmount the volume and then do your changes from there. Otherwise the other option is to carry the drive over to another system, install it as a secondary drive, leave it umounted and carry on the operation from there. – Fiasco Labs – 2012-12-08T22:30:19.557

Well, I'm pretty much an idiot, so not sure how to enter single maintenance user mode. It looks like I can do that through the grub boot menu, but I don't know how to get that menu to show up. – Andi Jay – 2012-12-09T00:02:49.823

Answers

18

As written in the manpages mke2fs is used for creating new filesystems, not changing existing ones.

I think the tool you are looking for is tune2fs, it can use the same parameter:

tune2fs -O ^has_journal /dev/sdXY

Whatever you do, make a backup before you play with filesystems.

You might have to use the -f (force) parameter.
Check the manpages with man tune2fs before using the tool (and make a backup, seriously).

Baarn

Posted 2012-12-08T22:11:03.397

Reputation: 6 096

2@AndiJay, using the command you attempted (mke2fs) would have caused you to loose all your data since a new filesystem would have been created, overwriting your existing one. It is the equivalent of the windows "format" command. – terdon – 2012-12-09T00:22:07.577

1I don't mind if I wipe everything by mistake. There's nothing important in the machine. – Andi Jay – 2012-12-09T00:28:16.130

1ok, I made a bootable USB key off the mint .iso. I booted into recovery mode, adn I was able to run the tune2fs command. My question is, how can I confirm that journalling was actually shut off? – Andi Jay – 2012-12-09T00:51:02.330

3If has_journal is no longer present in Filesystem features when you issue dumpe2fs or tune2fs -l it is turned off. Or simply grep for it like this tune2fs -l /dev/sdXY | grep has_journal. – Baarn – 2012-12-09T07:50:17.553

2+1, Worked for my pen-drive on Arch without forcing. But I think you mean tune2fs -O ^has_journal /dev/sdXY (forgot the 2); that may cause confusion for future readers. – JMCF125 – 2014-01-24T20:58:00.113

1Thanks, was a typo. Next time feel free to edit these aparent mistakes yourself (although the system might reject them as too minimal). – Baarn – 2014-01-25T20:53:04.983