Page 1 of 1

[Solved] Deactivating journaling on ext

PostPosted: Aug 28th, '18, 21:28
by alopez
I'm using a SDD for my root (sda1) and home (sda2) partitions and both are formatted in ext4 with journaling.

I just learned that it's a bad idea to use jourmaling on a flash disk as it will wear it faster (quite logical).

From a Live Mageia6 I disabled the journalling on both partitions:
Code: Select all
# tune2fs -O ^has_journal /dev/sda1
# fsck /dev/sda1
# tune2fs -O ^has_journal /dev/sda2
# fsck /dev/sda2


and rebooted. The root filesystem cannot be mounted (I cannot tell about the home filesystem as not mounting the root fs blocks everything else - but I guess it would not mount either).

The problem is that the root filesystem is being mounted with the data=ordered option which seems to be specific to journalling. But surprise! This argument is not in the /etc/fstab file. I also checked MCC's mount options for those partitions but data is not configurable there. Someone else is setting it at runtime.

Who is setting this argument? Where can I remove it?

(In the meanwhile I enabled journaling again).

Re: Deactivating journalling on ext4

PostPosted: Aug 28th, '18, 23:19
by alopez
I also tried gnome-disks but the data option does neither appear there.

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 12:38
by ITA84
I'm not really sure if this is the reason, but you could try running the command systemctl daemon-reload (it'd regenerate all mount units after a change to fstab). Reference: https://www.freedesktop.org/software/systemd/man/systemd.generator.html#Examples

As an aside, please consider that an SSD isn't simply a flash disk, and the impact of journaling writes isn't quite as large; disabling journaling would mean risk of data loss in case of an unclean unmount

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 15:27
by alopez
ITA84 wrote:I'm not really sure if this is the reason, but you could try running the command systemctl daemon-reload (it'd regenerate all mount units after a change to fstab). Reference: https://www.freedesktop.org/software/systemd/man/systemd.generator.html#Examples


No ITA84, I didn't change the fstab file. The flag I wanted to remove is not present in that file but the filesystem is being mounted with that flag. My question is about that. Where is that flag stored? How is it being set?


ITA84 wrote:As an aside, please consider that an SSD isn't simply a flash disk

Sorry, I don't understand this.


ITA84 wrote:and the impact of journaling writes isn't quite as large; disabling journaling would mean risk of data loss in case of an unclean unmount

Yes, I'm aware of the unclean umount problem, but I still want to make some tests and only then decide what to do.

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 16:06
by ITA84
alopez wrote:No ITA84, I didn't change the fstab file. The flag I wanted to remove is not present in that file but the filesystem is being mounted with that flag. My question is about that. Where is that flag stored? How is it being set?

Sorry, I misunderstood. I suppose then it's because data=ordered is the default for Ext4, so maybe you should try setting it to something else in fstab (data=writeback, I guess). If that isn't it, then I have no idea.

alopez wrote:Sorry, I don't understand this.

What I was trying to say is that SSDs, compared with flash disks, have additional hardware and firmware to manage the memory, optimizing for performance and lessening wear-and-tear

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 16:17
by alopez
ITA84 wrote:I suppose then it's because data=ordered is the default for Ext4, so maybe you should try setting it to something else in fstab (data=writeback, I guess). If that isn't it, then I have no idea.

I'll try that, but don 't think it is the problem because data is described as "Specifies the journaling mode for file data." which should adopt the right default value if I disable journaling. In addition, the error said that the provided data= parameter was incorrect, which in my opinion means that the parameter is being passed to mount.

Anyway, as said, I'll give it a try in case there is a bug.

ITA84 wrote:What I was trying to say is that SSDs, compared with flash disks, have additional hardware and firmware to manage the memory, optimizing for performance and lessening wear-and-tear

Oh I see.

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 17:14
by JoesCat
ext4 roots are from ext2.
Might be worth trying fdisk and changing the partition type from ext4 to ext2.
...and /etc/fstab to mount ext2.

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 17:34
by alopez
JoesCat wrote:ext4 roots are from ext2.
Might be worth trying fdisk and changing the partition type from ext4 to ext2.

The partition type is 83 (Linux). There is no difference for ext2 or ext4, or most other filesystem types.

JoesCat wrote:...and /etc/fstab to mount ext2.

mount fails to mount the filesystem in this case.

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 17:43
by alopez
alopez wrote:
ITA84 wrote:I suppose then it's because data=ordered is the default for Ext4, so maybe you should try setting it to something else in fstab (data=writeback, I guess). If that isn't it, then I have no idea.

I'll try that, but don 't think it is the problem because data is described as "Specifies the journaling mode for file data." which should adopt the right default value if I disable journaling. In addition, the error said that the provided data= parameter was incorrect, which in my opinion means that the parameter is being passed to mount.


Now I remember that when I was using the LiveCD I could manually mount the filesystem by not providing the data= option, which confirms that the option is explicitly provided. By who/what?

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 17:55
by doktor5000
FWIW I'd not recommended disabling journaling just because you use an SSD. Wear was an issue with the really early SSDs but that was years ago.

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 19:11
by alopez
doktor5000 wrote:FWIW I'd not recommended disabling journaling just because you use an SSD. Wear was an issue with the really early SSDs but that was years ago.

Faire enough.

But I'd still like to know were those options are being set. The filesystem is currently being mounted with the options rw,relatime,discard,stripe=32708,data=ordered. But in fstab only relatime,acl,discard are present. Please notice also that acl is being removed.

Re: Deactivating journalling on ext4

PostPosted: Aug 29th, '18, 19:44
by alopez
Well, I finally got it.

Those options come from systemd:
Code: Select all
# systemctl show -- -.mount
Where=/
What=/dev/sda1
Options=rw,relatime,discard,stripe=32708,data=ordered
Type=ext4
TimeoutUSec=1min 30s
ControlPID=0
DirectoryMode=0755
SloppyOptions=no
Result=success
Slice=system.slice
ControlGroup=/system.slice/-.mount
...


It seems this information is generated by systemd-fstab-generator from /etc/fstab.

Re: [Solved] Deactivating journaling on ext

PostPosted: Sep 15th, '18, 23:38
by zeebra
Perhaps I am one of the few ones here who remember the disadvantages of using a non-journal filesystem in GNU/Linux. BEWARE!