ext4 jbd2 journaling active even on empty filesystem
- by Paul
I have been having several issues with my ext4 filesystems that seem to be due to jbd2 journaling. I made a related post here and am rephrasing it with the hope that someone may be able to help.
For a minimal example, I start with an empty 8gb USB stick and use gparted to create one ext4 partition. The command used by gparted when creating the ext4 file system is:
mkfs.ext4 -j -O extent -L DataTraveler8gb /dev/sde1
I check the filesystem with gparted:
e2fsck -f -y -v /dev/sde1
and I mount it:
sudo mount /dev/sde1 /media/test
The disk is empty, but the journaling is very active on this disk (/dev/sde1). The other disks are ext4 SSDs formatted similarly. A snapshot of iotop:
% sudo iotop -oPa
Total DISK READ: 0.00 B/s | Total DISK WRITE: 2027.21 K/s
PID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
262 be/3 root 0.00 B 56.00 K 0.00 % 0.18 % [jbd2/sda1-8]
29069 be/3 root 0.00 B 0.00 B 0.00 % 0.16 % [jbd2/sde1-8]
891 be/3 root 0.00 B 4.00 K 0.00 % 0.03 % [jbd2/sdc1-8]
What is jbd2 doing with /dev/sde1?
If I follow the same steps with a larger 2Tb disk, iotop indicates this empty disk is constantly being written to by jbd2 at the rate of Mb/s as soon as I mount it.
On the other disks, which have the OS and /home, I have tried to find if any files are being modified by processes to cause this behavior but couldn't find any. I also moved many of the disk intensive process to use a tmpfs. And used noatime.
I have another non-SSD hard disk on this machine, /dev/sdb, that is also ext4 but was not formatted by gparted (given to me by a coworker). It does not appear in iotop. So I am assuming there an issue with gparted.
Any suggestions are appreciated. Also any tips on how to modify existing partitions to fix the issue without having to start from scratch would be great.
There are some posts related to jbd2 but they didn't help (eg. here).