I'm quite sure it didn't happen before I started using LUKS and LVM on my disk (2 or 3 weeks ago), but now root user is constantly (every 2-3 seconds) writing (not reading, just writing) on disk and I can't figure out why.The disk has one LUKS partition with one LVM group, which contains both root (ext4) and home (ext4) logical partitions (besides the swap one).I've used iotop command to check what processes are accessing the disk and I've seen it's jbd2/dm-X-8, executed by root, the process which is writing constantly to the disk.It only happens with the disk containing the LVM; I have two more ext4 disks mounted (just for storage purposes; they also use LUKS encryption but not LVM) and they stay quite while no file operations are made on them.I've checked log files to see if this writing activity could be due to some kind of logging, but it doesn't seem to be the case.I've also read questions like this one:LVM keeping harddisk awake?But I can't understand why would the system keep on writing the disk even when no changes are being made to it.On the other hand, I've had some issues with the disk which I though that could be related to other programs crashes, but now I don't know whether it could be related to this constant writing to disk, so I'm quite worried about it.Is it normal? Can I do something to avoid it or is it something that just comes with LUKS/LVM? Or maybe it has nothing to do with LUKS/LVM and I should check some other thing?
Why is OS constantly writing to disk (ext4) on a Ubuntu 14.04 machine? Is it normal?
hard disk;lvm;ext4;io;journaling
I've finally managed to reduce dramatically this constant writing activity on the disk, though still I don't understand totally how all this is linked. I guess this is not a perfect solution to the problem, but fixed it to me some way, so for if it helps someone:I've edited the /etc/fstab file adding to the options column for the root partition defaults, since it was set by default to error... (I was just experimenting, I don't understand why it makes any difference, but apparently it does).I've set swappiness to 0, but again, even when this seems to affect to the writing rate, I don't understand why it does in my case, since the computer has 16GB of RAM, so IMHO this (as with the fstab issue) shouldn't make any difference.With this new low-frecuency-writing-rate at least I've achieved to be less worried about the disk health, but I'm still concerned about the logic behind this behaviour, so any explanation and/or better solutions will be really welcomed.