Hello Petros. All good with you ?
I have contacted the dm-cache writeback developers and them had replied.
Thanks very much for you adding writeback support to your amazing rapiddisk utility.
I use since before 2022 for writeback cache and I had reported to you as can break the BTRFS partition if not is done an flush command in intervals.
IMO not was related with your software. Thus I had posted to dm-cache developers about it.
What are the command you use to your software create writeback caches using dm-cache writeback ? That information is important to say in next reply to dm-cache developers email.
Have an nice week.
Here is the message
Writeback cache does damage in file system being an expected behavior, but in BTRFS is an serious problem even.
Partial writen in ext4 not does fatal damage, but does it in BTRFS.
Any partial writen in BTRFS does the parent transid error being in some times an fatal error not allowing mount or to do any fix.
I when using the OS for an long time without doing an dm writeback flush run the command below
sudo btrfs check --readonly --force --mode original --progress /dev/sda5
If is showed the parent transid error will be done in sequence the command below to writecache flush
sudo /usr/sbin/dmsetup message /dev/mapper/rc-wb_sda5 0 flush
running again the btrfs check command will show not errors.
I believe is possible an solution to avoid that issue in BTRFS.
If the error happen when is done an partial writen to disk the solution maybe for example :
- In dm-writeback cache with 256 MB size was done write of 2 files of 128 MB so the writeback cache is full.
- Another file is in queue being 64 MB size.
- The writeback need free 64 MB so the first file will be partially sent to disk and so does the damage in file system.
- To avoid that issue the dm-cache writecache module will free cache memory sent files with complete file size to disk. If need free 64 MB wil be sent do disk all files with complete size in that case the file of 128 MB.
dm-cache writeback avoiding any partial writen to disk avoid any possibilty of damage in the file system.
I not see any command or option to enable it in dm-cache module.
Please excuse if my explanation not was enough good. I am novice Linux user.
How you had requested below are the output results for the three commands.
OS Ubuntu 24.04.1.
The disk was partitioned for the OS in three partitions being
sda3 = OS
sda4 = /home
sda5 = /opt
the writeback cache are the rc-wb_sda3 , rc-wb_sda4 and rc-wb_sda5
rd0 , rd1 and rd2 are block devices
I have used multiple settings and "combos" in the fstab for BTRFS and not is possible avoid issues. I not see that issue being related with any settings in fstab.
==== lsblk ====
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931,5G 0 disk
├─sda1 8:1 0 8M 0 part
├─sda2 8:2 0 586M 0 part /boot
├─sda3 8:3 0 11,4G 0 part
│ └─rc-wb_sda3 252:0 0 11,4G 0 dm /
├─sda4 8:4 0 977M 0 part
│ └─rc-wb_sda4 252:1 0 977M 0 dm /home
└─sda5 8:5 0 20G 0 part
└─rc-wb_sda5 252:2 0 20G 0 dm /opt
sdb 8:16 0 931,5G 0 disk
├─sdb1 8:17 0 8M 0 part
├─sdb2 8:18 0 585,6M 0 part
├─sdb3 8:19 0 17,2G 0 part
├─sdb4 8:20 0 890,3G 0 part /BTRFS
├─sdb5 8:21 0 12G 0 part
└─sdb6 8:22 0 11,4G 0 part
sr0 11:0 1 1024M 0 rom
zram0 250:0 0 3G 0 disk [SWAP]
rd0 251:0 0 128M 0 disk
└─rc-wb_sda3 252:0 0 11,4G 0 dm /
rd1 251:1 0 256M 0 disk
└─rc-wb_sda4 252:1 0 977M 0 dm /home
rd2 251:2 0 16M 0 disk
└─rc-wb_sda5 252:2 0 20G 0 dm /opt
==== mount ====
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=3988400k,nr_inodes=997100,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=806428k,mode=755,inode64)
/dev/mapper/rc-wb_sda3 on / type btrfs (rw,noatime,nodiratime,lazytime,max_inline=0,compress-force=zlib:9,nossd,space_cache=v2,commit=6,subvolid=256,subvol=/@)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=3959)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,inode64)
tmpfs on /var/crash type tmpfs (rw,nosuid,nodev,relatime,inode64)
tmpfs on /var/log type tmpfs (rw,nosuid,nodev,relatime,inode64)
/dev/mapper/rc-wb_sda4 on /home type btrfs (rw,noatime,nodiratime,lazytime,max_inline=0,compress-force=zlib:9,nossd,space_cache=v2,commit=6,subvolid=5,subvol=/)
/dev/mapper/rc-wb_sda5 on /opt type btrfs (rw,noatime,nodiratime,lazytime,max_inline=0,compress-force=zlib:9,nossd,space_cache=v2,commit=6,subvolid=5,subvol=/)
/dev/sda2 on /boot type ext2 (rw,relatime)
/dev/sdb4 on /BTRFS type btrfs (rw,noatime,nodiratime,lazytime,max_inline=0,compress-force=zlib:9,nossd,nospace_cache,commit=360,subvolid=5,subvol=/)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=806424k,nr_inodes=201606,mode=700,uid=1000,gid=1000,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
==== dmsetup table ====
rc-wb_sda3: 0 24000512 writecache s 8:3 251:0 4096 0
rc-wb_sda4: 0 2000896 writecache s 8:4 251:1 4096 0
rc-wb_sda5: 0 42000384 writecache s 8:5 251:2 4096 0
Hello Petros. All good with you ?
I have contacted the dm-cache writeback developers and them had replied.
Thanks very much for you adding writeback support to your amazing rapiddisk utility.
I use since before 2022 for writeback cache and I had reported to you as can break the BTRFS partition if not is done an flush command in intervals.
IMO not was related with your software. Thus I had posted to dm-cache developers about it.
What are the command you use to your software create writeback caches using dm-cache writeback ? That information is important to say in next reply to dm-cache developers email.
Have an nice week.
Here is the message
Writeback cache does damage in file system being an expected behavior, but in BTRFS is an serious problem even.
Partial writen in ext4 not does fatal damage, but does it in BTRFS.
Any partial writen in BTRFS does the parent transid error being in some times an fatal error not allowing mount or to do any fix.
I when using the OS for an long time without doing an dm writeback flush run the command below
sudo btrfs check --readonly --force --mode original --progress /dev/sda5
If is showed the parent transid error will be done in sequence the command below to writecache flush
sudo /usr/sbin/dmsetup message /dev/mapper/rc-wb_sda5 0 flush
running again the btrfs check command will show not errors.
I believe is possible an solution to avoid that issue in BTRFS.
If the error happen when is done an partial writen to disk the solution maybe for example :
dm-cache writeback avoiding any partial writen to disk avoid any possibilty of damage in the file system.
I not see any command or option to enable it in dm-cache module.
Please excuse if my explanation not was enough good. I am novice Linux user.
How you had requested below are the output results for the three commands.
OS Ubuntu 24.04.1.
The disk was partitioned for the OS in three partitions being
sda3 = OS
sda4 = /home
sda5 = /opt
the writeback cache are the rc-wb_sda3 , rc-wb_sda4 and rc-wb_sda5
rd0 , rd1 and rd2 are block devices
I have used multiple settings and "combos" in the fstab for BTRFS and not is possible avoid issues. I not see that issue being related with any settings in fstab.
==== lsblk ====
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931,5G 0 disk
├─sda1 8:1 0 8M 0 part
├─sda2 8:2 0 586M 0 part /boot
├─sda3 8:3 0 11,4G 0 part
│ └─rc-wb_sda3 252:0 0 11,4G 0 dm /
├─sda4 8:4 0 977M 0 part
│ └─rc-wb_sda4 252:1 0 977M 0 dm /home
└─sda5 8:5 0 20G 0 part
└─rc-wb_sda5 252:2 0 20G 0 dm /opt
sdb 8:16 0 931,5G 0 disk
├─sdb1 8:17 0 8M 0 part
├─sdb2 8:18 0 585,6M 0 part
├─sdb3 8:19 0 17,2G 0 part
├─sdb4 8:20 0 890,3G 0 part /BTRFS
├─sdb5 8:21 0 12G 0 part
└─sdb6 8:22 0 11,4G 0 part
sr0 11:0 1 1024M 0 rom
zram0 250:0 0 3G 0 disk [SWAP]
rd0 251:0 0 128M 0 disk
└─rc-wb_sda3 252:0 0 11,4G 0 dm /
rd1 251:1 0 256M 0 disk
└─rc-wb_sda4 252:1 0 977M 0 dm /home
rd2 251:2 0 16M 0 disk
└─rc-wb_sda5 252:2 0 20G 0 dm /opt
==== mount ====
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=3988400k,nr_inodes=997100,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=806428k,mode=755,inode64)
/dev/mapper/rc-wb_sda3 on / type btrfs (rw,noatime,nodiratime,lazytime,max_inline=0,compress-force=zlib:9,nossd,space_cache=v2,commit=6,subvolid=256,subvol=/@)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=3959)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,inode64)
tmpfs on /var/crash type tmpfs (rw,nosuid,nodev,relatime,inode64)
tmpfs on /var/log type tmpfs (rw,nosuid,nodev,relatime,inode64)
/dev/mapper/rc-wb_sda4 on /home type btrfs (rw,noatime,nodiratime,lazytime,max_inline=0,compress-force=zlib:9,nossd,space_cache=v2,commit=6,subvolid=5,subvol=/)
/dev/mapper/rc-wb_sda5 on /opt type btrfs (rw,noatime,nodiratime,lazytime,max_inline=0,compress-force=zlib:9,nossd,space_cache=v2,commit=6,subvolid=5,subvol=/)
/dev/sda2 on /boot type ext2 (rw,relatime)
/dev/sdb4 on /BTRFS type btrfs (rw,noatime,nodiratime,lazytime,max_inline=0,compress-force=zlib:9,nossd,nospace_cache,commit=360,subvolid=5,subvol=/)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=806424k,nr_inodes=201606,mode=700,uid=1000,gid=1000,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
==== dmsetup table ====
rc-wb_sda3: 0 24000512 writecache s 8:3 251:0 4096 0
rc-wb_sda4: 0 2000896 writecache s 8:4 251:1 4096 0
rc-wb_sda5: 0 42000384 writecache s 8:5 251:2 4096 0