[Solved] Deactivating journaling on ext

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[Solved] Deactivating journaling on ext

Postby alopez » Aug 28th, '18, 21:28

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).
Last edited by alopez on Aug 29th, '18, 19:51, edited 2 times in total.
User avatar
alopez
 
Posts: 49
Joined: Aug 17th, '13, 18:26
Location: France

Re: Deactivating journalling on ext4

Postby alopez » Aug 28th, '18, 23:19

I also tried gnome-disks but the data option does neither appear there.
User avatar
alopez
 
Posts: 49
Joined: Aug 17th, '13, 18:26
Location: France

Re: Deactivating journalling on ext4

Postby ITA84 » Aug 29th, '18, 12:38

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
ITA84
 
Posts: 89
Joined: Mar 5th, '13, 18:15

Re: Deactivating journalling on ext4

Postby alopez » Aug 29th, '18, 15:27

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.
User avatar
alopez
 
Posts: 49
Joined: Aug 17th, '13, 18:26
Location: France

Re: Deactivating journalling on ext4

Postby ITA84 » Aug 29th, '18, 16:06

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
ITA84
 
Posts: 89
Joined: Mar 5th, '13, 18:15

Re: Deactivating journalling on ext4

Postby alopez » Aug 29th, '18, 16:17

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.
User avatar
alopez
 
Posts: 49
Joined: Aug 17th, '13, 18:26
Location: France

Re: Deactivating journalling on ext4

Postby JoesCat » Aug 29th, '18, 17:14

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.
User avatar
JoesCat
 
Posts: 91
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: Deactivating journalling on ext4

Postby alopez » Aug 29th, '18, 17:34

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.
User avatar
alopez
 
Posts: 49
Joined: Aug 17th, '13, 18:26
Location: France

Re: Deactivating journalling on ext4

Postby alopez » Aug 29th, '18, 17:43

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?
User avatar
alopez
 
Posts: 49
Joined: Aug 17th, '13, 18:26
Location: France

Re: Deactivating journalling on ext4

Postby doktor5000 » Aug 29th, '18, 17:55

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.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 14527
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Deactivating journalling on ext4

Postby alopez » Aug 29th, '18, 19:11

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.
User avatar
alopez
 
Posts: 49
Joined: Aug 17th, '13, 18:26
Location: France

Re: Deactivating journalling on ext4

Postby alopez » Aug 29th, '18, 19:44

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.
User avatar
alopez
 
Posts: 49
Joined: Aug 17th, '13, 18:26
Location: France

Re: [Solved] Deactivating journaling on ext

Postby zeebra » Sep 15th, '18, 23:38

Perhaps I am one of the few ones here who remember the disadvantages of using a non-journal filesystem in GNU/Linux. BEWARE!
zeebra
 
Posts: 112
Joined: Sep 7th, '13, 21:20


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest