I fear I may have to revert to system defaults if I can't get this sorted out.
I'm trying to set various system configurations for more robust ext4 for a single-user desktop environment. Trying to assign desired configuration settings where they will take effect properly.
I understand that some of these should be included in the file mke2fs.conf
so that the filesystems are initially created with those proper settings. But I will address that later, keeping the distro default file for the following.
I understand that the EXT4 options I wanted could be set in /etc/fstab
. This following entry shows what I would typically want:
UUID=00000000-0000-0000-0000-000000000000 /DB001_F2 ext4 defaults,nofail,data=journal,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,block_validity,nodelalloc,data_err=ignore,nodiscard 0 0
where each DB001_F{p}
is a partition on the root disk ( p = [2-8] ).
I repeat those options here, in the same sequence as a list, in case that makes it more easy to assimilate:
defaults
nofail
data=journal
journal_checksum
journal_async_commit
commit=15
errors=remount-ro
journal_ioprio=2
block_validity
nodelalloc
data_err=ignore
nodiscard
Mounting during boot, the below syslog shows all as reporting what I believe to be acknowledged acceptable settings:
64017 Sep 4 21:04:35 OasisMega1 kernel: [ 21.622599] EXT4-fs (sda7): mounted filesystem with journalled data mode. Opts: data=journal,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,block_validity,nodelalloc,data_err=ignore,nodiscard
64018 Sep 4 21:04:35 OasisMega1 kernel: [ 21.720338] EXT4-fs (sda4): mounted filesystem with journalled data mode. Opts: data=journal,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,block_validity,nodelalloc,data_err=ignore,nodiscard
64019 Sep 4 21:04:35 OasisMega1 kernel: [ 21.785653] EXT4-fs (sda8): mounted filesystem with journalled data mode. Opts: data=journal,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,block_validity,nodelalloc,data_err=ignore,nodiscard
64021 Sep 4 21:04:35 OasisMega1 kernel: [ 22.890168] EXT4-fs (sda12): mounted filesystem with journalled data mode. Opts: data=journal,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,block_validity,nodelalloc,data_err=ignore,nodiscard
64022 Sep 4 21:04:35 OasisMega1 kernel: [ 23.214507] EXT4-fs (sda9): mounted filesystem with journalled data mode. Opts: data=journal,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,block_validity,nodelalloc,data_err=ignore,nodiscard
64023 Sep 4 21:04:35 OasisMega1 kernel: [ 23.308922] EXT4-fs (sda13): mounted filesystem with journalled data mode. Opts: data=journal,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,block_validity,nodelalloc,data_err=ignore,nodiscard
64024 Sep 4 21:04:35 OasisMega1 kernel: [ 23.513804] EXT4-fs (sda14): mounted filesystem with journalled data mode. Opts: data=journal,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,block_validity,nodelalloc,data_err=ignore,nodiscard
But mount
shows that some drives are not reporting as expected, even after reboot, and this is inconsistent as seen below:
/dev/sda7 on /DB001_F2 type ext4 (rw,relatime,nodelalloc,journal_checksum,journal_async_commit,errors=remount-ro,commit=15,data=journal)
/dev/sda8 on /DB001_F3 type ext4 (rw,relatime,nodelalloc,journal_checksum,journal_async_commit,errors=remount-ro,commit=15,data=journal)
/dev/sda9 on /DB001_F4 type ext4 (rw,relatime,nodelalloc,journal_checksum,journal_async_commit,errors=remount-ro,commit=15,data=journal)
/dev/sda12 on /DB001_F5 type ext4 (rw,relatime,nodelalloc,journal_async_commit,errors=remount-ro,commit=15,data=journal)
/dev/sda13 on /DB001_F6 type ext4 (rw,relatime,nodelalloc,journal_async_commit,errors=remount-ro,commit=15,data=journal)
/dev/sda14 on /DB001_F7 type ext4 (rw,relatime,nodelalloc,journal_async_commit,errors=remount-ro,commit=15,data=journal)
/dev/sda4 on /DB001_F8 type ext4 (rw,relatime,nodelalloc,journal_async_commit,errors=remount-ro,commit=15,data=journal)
I read somewhere about a limitation regarding the length of the option string in fstab
, so I used tune2fs
to pre-set some parameters at a lower level. Those applied via tune2fs
are:
journal_data,block_validity,nodelalloc
which is confirmed when using tune2fs -l
:
Default mount options: journal_data user_xattr acl block_validity nodelalloc
With that in place, I modified the fstab
for entries to show as
UUID=00000000-0000-0000-0000-000000000000 /DB001_F2 ext4 defaults,nofail,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,data_err=ignore,nodiscard 0 0
I did a umount
for all my DB001_F?
(/dev/sda*
), then I did a mount -av
, which reported the following:
/ : ignored
/DB001_F2 : successfully mounted
/DB001_F3 : successfully mounted
/DB001_F4 : successfully mounted
/DB001_F5 : successfully mounted
/DB001_F6 : successfully mounted
/DB001_F7 : successfully mounted
/DB001_F8 : successfully mounted
No errors reported for the options string for each of the drives.
I tried using journal_checksum_v3
, but mount -av
failed all with that setting. I used the mount
command to see what was reported.
I also did a reboot and repeated that mount
again for these reduced settings, and mount
shows again that the drives are not reporting as expected, and this is still inconsistent as seen here:
/dev/sda7 on /DB001_F2 type ext4 (rw,relatime,journal_checksum,journal_async_commit,commit=15)
/dev/sda8 on /DB001_F3 type ext4 (rw,relatime,journal_checksum,journal_async_commit,commit=15)
/dev/sda9 on /DB001_F4 type ext4 (rw,relatime,journal_checksum,journal_async_commit,commit=15)
/dev/sda12 on /DB001_F5 type ext4 (rw,relatime,journal_async_commit,commit=15)
/dev/sda13 on /DB001_F6 type ext4 (rw,relatime,journal_async_commit,commit=15)
/dev/sda14 on /DB001_F7 type ext4 (rw,relatime,journal_async_commit,commit=15)
/dev/sda4 on /DB001_F8 type ext4 (rw,relatime,journal_async_commit,commit=15)
Since these are all ext4
type filesystems, and all on the same physical drive, I don't understand the behaviour of the journal_checksum
not be uniformly actioned! I also, I find it interesting that there is a dividing line in terms of the 2 classes of behaviour, since the order listed above is the order specified in the fstab
(according to /DB001_F?
), which presumably is the mounting order ... so what "glitch" is causing the "downgrading" of the remaining mount actions ?
My thinking (possibly baseless) is that some properties might be better set at time of creation of the filesystems, and that this would make them more "persistent/effective" than otherwise. When I tried to again shift some of the property settings by pre-defining those in mke2fs.conf
. mke2fs.ext4
fails AGAIN, I suspect, because the option string is restricted to a limited length (64 characters ?). So ... I have backed away from making any changes to the mke2fs.conf
.
Ignoring the mke2fs.conf
issue for now, and focusing on the fstab and tune2fs functionality, can someone please explain to me what I am doing wrong that is preventing mount from correctly reporting what is the full range of settings currently in effect?
At this point, I don't know what I can rely on to provide the actual real state of the ext4 behaviour and am considering simply reverting to distro defaults, which leaves me wanting.
Is it possible that all is well and that the system is simply not reporting correctly? I am not sure that I could comfortably accept that viewpoint. It is counter-intuitive.
Can someone please assist?
Environment
UbuntuMATE 20.04 LTS
Linux OasisMega1 5.4.0-124-generic #140-Ubuntu SMP Thu Aug 4 02:23:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
RAM = 4GB
DSK = 2TB (internal, 8 data partitions, 3 1GB swap partitions) [ROOT]
DSK = 500GB (internal, 2 data partitions, 1 1GB swap partitions)
DSK = 4TB (external USB, 16 data partitions) [BACKUP drive]
This is what is being reported by debugfs
:
Filesystem features:
has_journal
ext_attr
resize_inode
dir_index
filetype
needs_recovery
extent
flex_bg
sparse_super
large_file
huge_file
dir_nlink
extra_isize
metadata_csum
Not very useful for additional insights into the problem.
debugfs
shows following supported features:
debugfs 1.45.5 (07-Jan-2020)
Supported features: (...snip...) journal_checksum_v2 journal_checksum_v3
Noteworthy is that debugfs
is showing either journal_checksum_v2
or journal_checksum_v3
available but not the journal_checksum
which is referenced in the manual pages.
Does that mean that I should be using v2
or v3
, instead of journal_checksum
?
file
command against each ext4 /dev/sdaX and compare output. Trydumpe2fs
against each ext4 /dev/sdaX and check Filesystem features and revisionmke2fs
creates the file system structure without help from the kernel (apart from background initialisation), and the version of the kernel doesn’t affect the features available inmke2fs
. The kernel does determine what features are actually available when the file system is mounted.