BTRFS filesystem read only with unkown error

I have an encrypted USB disk formatted with BTRFS with many subvolumes on it (and another linux distro).
I mount it on my Tumbleweed to take backups. But I have a BTRFS error that set the disk drive read only.

Here are the extract of the systemd log :

[HR][/HR][FONT=courier new]May 03 10:55:28 linux-0rk5 kernel: BTRFS info (device dm-5): disk space caching is enabled
May 03 10:55:28 linux-0rk5 kernel: BTRFS info (device dm-5): has skinny extents
May 03 10:55:30 linux-0rk5 kernel: BTRFS info (device dm-5): checking UUID tree
May 03 10:55:30 linux-0rk5 udisksd[2191]: Mounted /dev/dm-5 at /run/media/bt/b1377a2e-14fe-433a-b268-2fee065f1fc1 on behalf of uid 1000
May 03 10:55:30 linux-0rk5 kernel: BTRFS info (device dm-5): devid 1 device path /dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b changed to /dev/dm-5 scanned by systemd-udevd (12774)
May 03 10:55:30 linux-0rk5 kernel: BTRFS info (device dm-5): devid 1 device path /dev/dm-5 changed to /dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b scanned by systemd-udevd (12774)
May 03 10:55:31 linux-0rk5 kernel: BTRFS info (device dm-5): balance: resume -dusage=5
May 03 10:55:31 linux-0rk5 kernel: BTRFS info (device dm-5): relocating block group 7815036928 flags data
May 03 10:55:34 linux-0rk5 kernel: BTRFS info (device dm-5): found 395 extents, stage: move data extents
May 03 10:55:35 linux-0rk5 kernel: ------------ cut here ]------------
May 03 10:55:35 linux-0rk5 kernel: WARNING: CPU: 0 PID: 12794 at fs/btrfs/extent-tree.c:862 lookup_inline_extent_backref+0x65c/0x6a0 [btrfs]
May 03 10:55:35 linux-0rk5 kernel: Modules linked in: uas usb_storage ccm rfcomm nft_objref nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_REJECT xt_geoip(O) nft_fib_inet nft_fib_ipv4 nf>
May 03 10:55:35 linux-0rk5 kernel: ** snd_hda_codec irqbypass hp_wmi joydev wmi_bmof sparse_keymap snd_hda_core pcspkr rfkill libarc4 r8169 snd_hwdep thermal snd_pcm realtek mdio_devres snd_ti**>
May 03 10:55:35 linux-0rk5 kernel: CPU: 0 PID: 12794 Comm: btrfs-balance Tainted: G W O 5.12.0-1-default #1 openSUSE Tumbleweed
May 03 10:55:35 linux-0rk5 kernel: Hardware name: Hewlett-Packard HP Pavilion g6 Notebook PC/169B, BIOS F.34 08/16/2011
May 03 10:55:35 linux-0rk5 kernel: RIP: 0010:lookup_inline_extent_backref+0x65c/0x6a0 [btrfs]
May 03 10:55:35 linux-0rk5 kernel: Code: e9 5c fe ff ff 48 83 c1 01 48 83 f9 08 0f 85 f3 fd ff ff e9 59 fe ff ff 49 89 ed 4c 8b 7c 24 10 4c 89 e5 31 db e9 37 fc ff ff <0f> 0b b8 fb ff ff ff >
May 03 10:55:35 linux-0rk5 kernel: RSP: 0018:ffffaf7302403940 EFLAGS: 00010202
May 03 10:55:35 linux-0rk5 kernel: RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001
May 03 10:55:35 linux-0rk5 kernel: RDX: 00000000000000f5 RSI: 0000000000000004 RDI: 0000000000000000
May 03 10:55:35 linux-0rk5 kernel: RBP: ffff8ce40633f310 R08: 0000000000000000 R09: ffff8ce40633f310
May 03 10:55:35 linux-0rk5 kernel: R10: 00015953ed6426d0 R11: 0000000000000000 R12: ffff8ce40633f310
May 03 10:55:35 linux-0rk5 kernel: R13: ffff8ce3c04c0680 R14: ffff8ce2ce489000 R15: ffff8ce3e1d60000
May 03 10:55:35 linux-0rk5 kernel: FS: 0000000000000000(0000) GS:ffff8ce459400000(0000) knlGS:0000000000000000
May 03 10:55:35 linux-0rk5 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
May 03 10:55:35 linux-0rk5 kernel: CR2: 00007f53c1b37008 CR3: 00000000b5e10000 CR4: 00000000000006f0
May 03 10:55:35 linux-0rk5 kernel: Call Trace:
May 03 10:55:35 linux-0rk5 kernel: ** ? setup_inline_extent_backref.constprop.0+0x1df/0x260 [btrfs]

May 03 10:55:35 linux-0rk5 kernel: ** insert_inline_extent_backref+0x5b/0xf0 [btrfs]

May 03 10:55:35 linux-0rk5 kernel: ** __btrfs_inc_extent_ref.isra.0+0x81/0x260 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** ? kmem_cache_free+0x40a/0x440**
May 03 10:55:35 linux-0rk5 kernel: ** ? __btrfs_run_delayed_refs+0xfbd/0x1010 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** __btrfs_run_delayed_refs+0x598/0x1010 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** ? kmem_cache_free+0x103/0x440**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_run_delayed_refs+0x73/0x1f0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_commit_transaction+0x6f/0xaa0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** ? btrfs_update_reloc_root+0x1ca/0x240 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** prepare_to_merge+0x21e/0x250 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** relocate_block_group+0x2d3/0x5e0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_relocate_block_group+0x15d/0x300 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_relocate_chunk+0x27/0xc0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_balance+0x6f7/0xec0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** ? btrfs_balance+0xec0/0xec0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** balance_kthread+0x35/0x50 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** kthread+0x11b/0x140**
May 03 10:55:35 linux-0rk5 kernel: ** ? __kthread_bind_mask+0x60/0x60**
May 03 10:55:35 linux-0rk5 kernel: ** ret_from_fork+0x22/0x30**
May 03 10:55:35 linux-0rk5 kernel: — end trace 8ec11e5725b0ca96 ]—
May 03 10:55:35 linux-0rk5 kernel: BTRFS: error (device dm-5) in btrfs_run_delayed_refs:2159: errno=-5 IO failure
May 03 10:55:35 linux-0rk5 kernel: BTRFS info (device dm-5): forced readonly
May 03 10:55:35 linux-0rk5 kernel: BTRFS info (device dm-5): balance: ended with status: -30

[/FONT][HR][/HR]
I have tried to btrfsck the disk but it abend with the same error message.

I have a copy of everything from this disk on my laptop disk since its a backup.
This is an almost new 1 Tb USB disk and it shouldn’t be faulty.

Any advices ? I’m not sure of what are my options to save the data.
and this does make me have some doubts about BTRFS .
I’m not an expert at BTRFS anybody here would have some clues ???

regards,
BT :’(

PS: It has a lot of free space on it and the device doesn’t report any IO errors.
[HR][/HR][FONT=courier new]linux-0rk5:/home/bt/bin # btrfs filesystem usage /run/media/bt/b1377a2e-14fe-433a-b268-2fee065f1fc1
Overall:
Device size: 922.51GiB
Device allocated: 279.52GiB
Device unallocated: 642.99GiB
Device missing: 0.00B
Used: 250.80GiB
Free (estimated): 669.82GiB (min: 348.32GiB)
Free (statfs, df): 669.82GiB
Data ratio: 1.00
Metadata ratio: 2.00
Global reserve: 358.08MiB (used: 0.00B)
Multiple profiles: no

Data,single: Size:274.01GiB, Used:247.18GiB (90.21%)
/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b 274.01GiB

Metadata,DUP: Size:2.75GiB, Used:1.81GiB (65.86%)
/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b 5.50GiB

System,DUP: Size:8.00MiB, Used:48.00KiB (0.59%)
/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b 16.00MiB

Unallocated:
/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b 642.99GiB

[/FONT]linux-0rk5:/home/bt/bin # btrfs device stats /run/media/bt/b1377a2e-14fe-433a-b268-2fee065f1fc1
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].write_io_errs 0
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].read_io_errs 0
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].flush_io_errs 0
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].corruption_errs 0
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].generation_errs 0

[HR][/HR]

Sorry, I have nothing to contribute to solve your problem. But, I have a long thread going about read-only errors in btrfs. In my case, the disk is old and likely failing. But, this is the third thread reporting btrfs going read-only with no easy explanation.

It already happened to me before few years ago when BTRFS make its beginning after the bad history with the REISERFS guy.
But I assumed that BTRFS would be more reliable now, may be I’m still wrong.

Regards,
BT

Hi
Not in my experience for the actual operating system, never used it for encrypted backups. All backups to ext4 or xfs…

Found btrfs on my machines to be reliable as can be. You make an extraordinary claim. Provide evidence by running all 3 commands and posting their output exactly as described here: https://forums.opensuse.org/showthread.php/552966-read-only-file-system?p=3024405#post3024405

  • run ‘btrfs check --force /dev/sda6 2>&1|grep -v boudnary’ (this line is my copy and paste of a working command. No typos whatsoever. Don’t make any changes)
  • post the output of the command as is by copy/paste. Don’t make changes to the output
  • run a read-only foreground scrub using ‘btrfs scrub start -rB /dev/sda6’ (takes some time, be patient)
  • post the output of the command as is …
  • run ‘btrfs device stats /dev/sda6’
  • post the output of the command as is …

<br>

Sorry for the ****, it was added because I went to preview the post before going back to change some text. >:(

<br>I make no extraordinary claim. I’m just looking at results . BTRFS needs to be more reliable in my particular case with an USB disk, encryption and zstd compression.<br>I have nothing against BTRFS but I’m not having a good experience with it for a second time I try it. That’s the result I could have been happy to avoid.<br><br>Here are the results of the commands you wanted to see (I had tried it before an knew it would abend …) :<br><br>

<br><span style="font-family:monospace"><span style="font-weight: bold; color: rgb(255, 84, 84);">linux-0rk5:~ #</span><span style="color: rgb(0, 0, 0);"> btrfs check --force /dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b  2>&1|grep -v boudnary
</span><br>[1/7] checking root items
<br>[2/7] checking extents
<br>[3/7] checking free space cache
<br>[4/7] checking fs roots
<br>[5/7] checking only csums items (without verifying data)
<br>[6/7] checking root refs
<br>[7/7] checking quota groups
<br>check/qgroup-verify.c:546: account_all_refs: BUG_ON `ref-&gt;num_bytes != num_bytes` triggered, value 1
<br>btrfs(+0x1f7d0)[0x5649cbf887d0]
<br>btrfs(qgroup_verify_all+0x643)[0x5649cbf8a483]
<br>btrfs(+0x4a4ca)[0x5649cbfb34ca]
<br>btrfs(main+0x90)[0x5649cbf80e00]
<br>/lib64/libc.so.6(__libc_start_main+0xd5)[0x7f3be8628b25]
<br>btrfs(_start+0x2e)[0x5649cbf8113e]<br></span>



The abend is the same that posted on the first message of this thread.

The scrub won’t be done because the filesystem is made read-only by btrfs (error code 30)

<span style="font-family:monospace"><span style="font-weight: bold; color: rgb(255, 84, 84);">linux-0rk5:~ #</span><span style="color: rgb(0, 0, 0);"> mount /dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b /mnt/racine
</span><br><span style="font-weight: bold; color: rgb(255, 84, 84);">linux-0rk5:~ #</span><span style="color: rgb(0, 0, 0);"> btrfs scrub start -rB /mnt/racine
</span><br>ERROR: scrubbing /mnt/racine failed for device id 1: ret=-1, errno=30 (Read-only file system)
<br>scrub canceled for b1377a2e-14fe-433a-b268-2fee065f1fc1
<br>Scrub started:    Tue May  4 16:42:15 2021
<br>Status:           aborted
<br>Duration:         0:00:00
<br>Total to scrub:   279.52GiB
<br>Rate:             0.00B/s
<br>Error summary:    no errors found<br></span>



And the stats are going to show there is no errors …

<span style="font-family:monospace"><span style="font-weight: bold; color: rgb(255, 84, 84);">linux-0rk5:~ #</span><span style="color: rgb(0, 0, 0);"> btrfs device stats /mnt/racine
</span><br>[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].write_io_errs    0
<br>[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].read_io_errs     0
<br>[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].flush_io_errs    0
<br>[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].corruption_errs  0
<br>[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].generation_errs  0<br></span>

<br><br>It looks like it a problem with a back pointer on an extent. I’m considering reformatting the drive and getting rid of BTRFS for another 5 years.<br><br>Regards,<br> BT

Hi
I wouldn’t use it on a USB device, ext4 or XFS is your best bet…

btrfs check found a problem with quota groups. Turn off quota and try again.

No issues with btrfs and USB here. Last week the front USB headers went bad on host erlangen. It sits in a Silent Base 600: https://www.youtube.com/watch?v=camyX5txmLA They sent a replacement USB and fan control panel at no cost. :wink:

After replacement of the front panel I did some tests with the new hardware. During mirroring a large partition from internal SSD to a btrfs partition on an USB stick using rsync I several times removed the stick from the header and inserted it again. Upon rerunning rsync mirroring would resume smoothly until no space was left on device:

**erlangen:~ #** btrfs filesystem usage -T /run/media/karl/btrfs-stick 
Overall: 
    Device size:                  97.66GiB 
    Device allocated:             97.66GiB 
    Device unallocated:            1.00MiB 
    Device missing:                  0.00B 
    Used:                         97.17GiB 
    Free (estimated):              8.05MiB      (min: 8.05MiB) 
    Free (statfs, df):             8.05MiB 
    Data ratio:                       1.00 
    Metadata ratio:                   2.00 
    Global reserve:              231.84MiB      (used: 0.00B) 
    Multiple profiles:                  no 

             Data     Metadata System               
Id Path      single   DUP      DUP      Unallocated 
-- --------- -------- -------- -------- ----------- 
 1 /dev/sdd1 91.63GiB  6.01GiB 16.00MiB     1.00MiB 
-- --------- -------- -------- -------- ----------- 
   Total     91.63GiB  3.01GiB  8.00MiB     1.00MiB 
   Used      91.62GiB  2.77GiB 16.00KiB             
**erlangen:~ #**
**erlangen:~ #** btrfs check --force /dev/sdd1 2>&1|grep -v boudnary                      
WARNING: filesystem mounted, continuing because of --force 
[1/7] checking root items 
[2/7] checking extents 
[3/7] checking free space cache 
[4/7] checking fs roots 
[5/7] checking only csums items (without verifying data) 
[6/7] checking root refs 
[7/7] checking quota groups skipped (not enabled on this FS) 
Opening filesystem to check... 
Checking filesystem on /dev/sdd1 
UUID: 39e0955c-ea0e-44c7-9402-d7f3f2e3fd0e 
found 101356404736 bytes used, no error found 
total csum bytes: 96046800 
total tree bytes: 2979708928 
total fs tree bytes: 2735521792 
total extent tree bytes: 123420672 
btree space waste bytes: 454688664 
file data blocks allocated: 98376695808 
 referenced 98376695808 
**erlangen:~ #**
**erlangen:~ #** btrfs scrub start -rB /dev/sdd1 
scrub done for 39e0955c-ea0e-44c7-9402-d7f3f2e3fd0e 
Scrub started:    Wed May  5 09:12:23 2021 
Status:           finished 
Duration:         0:12:18 
Total to scrub:   97.66GiB 
Rate:             134.83MiB/s 
Error summary:    no errors found 
**erlangen:~ #**
**erlangen:~ #** btrfs device stats /dev/sdd1 
[/dev/sdd1].write_io_errs    0 
[/dev/sdd1].read_io_errs     0 
[/dev/sdd1].flush_io_errs    0 
[/dev/sdd1].corruption_errs  0 
[/dev/sdd1].generation_errs  0 
**erlangen:~ #**

**To my experience btrfs is pretty unbreakable. I am trying hard to break it, but failed so far. Suggestions are welcome. **

After a week of search for a solution. My conclusions are rather the opposite of yours : BTRFS is doomed to fail your data. Don’t use BTRFS for any data you want to keep. It is not mature and does cause irreparable errors that you can’t fix because this filesystem and its tools are not stable. I like a lot the BTRFS design but I won’t use it for another 5 years before to check again if it is reliable. >:(

Thank for all who tried to help. :good:

I am not sure whether you actually searched for a solution. You missed to check the suggestion made: https://forums.opensuse.org/showthread.php/553531-BTRFS-filesystem-read-only-with-unkown-error?p=3027070#post3027070

My conclusions are rather the opposite of yours : BTRFS is doomed to fail your data. Don’t use BTRFS for any data you want to keep. It is not mature and does cause irreparable errors that you can’t fix because this filesystem and its tools are not stable. I like a lot the BTRFS design but I won’t use it for another 5 years before to check again if it is reliable. >:(
That’s not a conclusion but a rant, in my opinion of course.

Disk was unmounted while a balance operation was running:

[FONT=courier new]balance: resume -dusage=5[/FONT]

Mounting again and it attempts to resume the operation, but fails for some reason.

Find the thread by user “Prexy” where the recovery for this is documented.

I found this thread while searching for an error in my dmesg output:
btrfs_run_delayed_refs:2159: errno=-5 IO failure
In my case, it’s a new but cheap SSD on a machine that recently had a disk failure. The Btrfs partition on the new disk started going read-only a few seconds or minutes after being mounted. So I can’t claim that it’s definitely a Btrfs bug, maybe I have another failing disk. But it seems suspicious that I’m seeing lots of balance errors in the dmesg output, and I had thousands of snapshots on this particular filesystem, and the problem started after a dirty shutdown. Additionally, I have another copy of openSUSE on a different Btrfs partition on the same disk, and it’s still working fine. Here’s the detailed bug report, if anybody can find any useful tidbits in the errors and logs I posted I’d appreciate it!
https://bugzilla.opensuse.org/show_bug.cgi?id=1185922

Did you ever try a raw read?

**erlangen:~ #** dd if=/dev/nvme0n1p3 of=/dev/null bs=4M 
13232+1 records in 
13232+1 records out 
55501127680 bytes (56 GB, 52 GiB) copied, 24.9852 s, 2.2 GB/s 
**erlangen:~ #**

Check the log for messages:

**erlangen:~ #** journalctl -b 0 _KERNEL_SUBSYSTEM=scsi 
-- Logs begin at Sun 2021-05-09 21:56:57 CEST, end at Sat 2021-05-15 21:24:50 CEST. -- 
May 15 10:04:27 erlangen kernel: scsi host0: ahci 
May 15 10:04:27 erlangen kernel: scsi host1: ahci 
May 15 10:04:27 erlangen kernel: scsi host2: ahci 
May 15 10:04:27 erlangen kernel: scsi host3: ahci 
May 15 10:04:27 erlangen kernel: scsi host4: ahci 
May 15 10:04:27 erlangen kernel: scsi host5: ahci 
May 15 10:04:27 erlangen kernel: **scsi 2:0:0:0: Direct-Access     ATA      CT2000BX500SSD1  030  PQ: 0 ANSI: 5**
May 15 10:04:27 erlangen kernel: **sd 2:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)**
May 15 10:04:27 erlangen kernel: **sd 2:0:0:0: [sda] Write Protect is off**
May 15 10:04:27 erlangen kernel: sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
May 15 10:04:27 erlangen kernel: **sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA**
May 15 10:04:27 erlangen kernel: **scsi 3:0:0:0: Direct-Access     ATA      WDC WD40EZRX-22S 0A80 PQ: 0 ANSI: 5**
May 15 10:04:27 erlangen kernel: **sd 3:0:0:0: [sdb] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)**
May 15 10:04:27 erlangen kernel: **sd 3:0:0:0: [sdb] 4096-byte physical blocks**
May 15 10:04:27 erlangen kernel: **sd 3:0:0:0: [sdb] Write Protect is off**
May 15 10:04:27 erlangen kernel: sd 3:0:0:0: [sdb] Mode Sense: 00 3a 00 00
May 15 10:04:27 erlangen kernel: **sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA**
May 15 10:04:27 erlangen kernel: **scsi 4:0:0:0: Direct-Access     ATA      Samsung SSD 850  3B6Q PQ: 0 ANSI: 5**
May 15 10:04:27 erlangen kernel: **sd 4:0:0:0: [sdc] 976773168 512-byte logical blocks: (500 GB/466 GiB)**
May 15 10:04:27 erlangen kernel: **sd 4:0:0:0: [sdc] Write Protect is off**
May 15 10:04:27 erlangen kernel: sd 4:0:0:0: [sdc] Mode Sense: 00 3a 00 00
May 15 10:04:27 erlangen kernel: **sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA**
May 15 10:04:27 erlangen kernel: **scsi 5:0:0:0: CD-ROM            PIONEER  DVD-RW  DVR-221  1.00 PQ: 0 ANSI: 5**
May 15 10:04:27 erlangen kernel: **sd 4:0:0:0: [sdc] supports TCG Opal**
May 15 10:04:27 erlangen kernel: **sd 4:0:0:0: [sdc] Attached SCSI disk**
May 15 10:04:27 erlangen kernel: **sd 2:0:0:0: [sda] Attached SCSI disk**
May 15 10:04:27 erlangen kernel: **sd 3:0:0:0: [sdb] Attached SCSI disk**
May 15 10:04:27 erlangen kernel: **sd 2:0:0:0: Attached scsi generic sg0 type 0**
May 15 10:04:27 erlangen kernel: **sd 3:0:0:0: Attached scsi generic sg1 type 0**
May 15 10:04:27 erlangen kernel: **sd 4:0:0:0: Attached scsi generic sg2 type 0**
May 15 10:04:27 erlangen kernel: **scsi 5:0:0:0: Attached scsi generic sg3 type 5**
May 15 10:04:28 erlangen kernel: sr 5:0:0:0: [sr0] scsi3-mmc drive: 40x/40x writer dvd-ram cd/rw xa/form2 cdda tray 
May 15 10:04:28 erlangen kernel: sr 5:0:0:0: Attached scsi CD-ROM sr0
**erlangen:~ #**

Hi karlmistelberger, thanks for the reply. For me I guess the command would be this?
dd if=/dev/sda3 of=/dev/null bs=4M

And what can be determined with this command? If the disk is failing it will throw errors in dmesg?

The command exercises all of kernel, interface, disk drive and file system. You want to filter messages as follows:

**erlangen:~ #** **journalctl -b 0 _KERNEL_SUBSYSTEM=scsi**              
-- Logs begin at Sun 2021-05-09 21:56:57 CEST, end at Sun 2021-05-16 17:19:57 CEST. -- 
May 16 14:46:54 erlangen kernel: scsi host0: ahci 
May 16 14:46:54 erlangen kernel: scsi host1: ahci 
May 16 14:46:54 erlangen kernel: scsi host2: ahci 
May 16 14:46:54 erlangen kernel: scsi host3: ahci 
May 16 14:46:54 erlangen kernel: scsi host4: ahci 
May 16 14:46:54 erlangen kernel: scsi host5: ahci 
May 16 14:46:54 erlangen kernel: **scsi 2:0:0:0: Direct-Access     ATA      CT2000BX500SSD1  030  PQ: 0 ANSI: 5**
May 16 14:46:54 erlangen kernel: **sd 2:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)**
May 16 14:46:54 erlangen kernel: **sd 2:0:0:0: [sda] Write Protect is off**
May 16 14:46:54 erlangen kernel: sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
May 16 14:46:54 erlangen kernel: **sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA**
May 16 14:46:54 erlangen kernel: **scsi 3:0:0:0: Direct-Access     ATA      WDC WD40EZRX-22S 0A80 PQ: 0 ANSI: 5**
May 16 14:46:54 erlangen kernel: **sd 3:0:0:0: [sdb] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)**
May 16 14:46:54 erlangen kernel: **sd 3:0:0:0: [sdb] 4096-byte physical blocks**
May 16 14:46:54 erlangen kernel: **sd 3:0:0:0: [sdb] Write Protect is off**
May 16 14:46:54 erlangen kernel: sd 3:0:0:0: [sdb] Mode Sense: 00 3a 00 00
May 16 14:46:54 erlangen kernel: **sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA**
May 16 14:46:54 erlangen kernel: **scsi 4:0:0:0: Direct-Access     ATA      Samsung SSD 850  3B6Q PQ: 0 ANSI: 5**
May 16 14:46:54 erlangen kernel: **sd 4:0:0:0: [sdc] 976773168 512-byte logical blocks: (500 GB/466 GiB)**
May 16 14:46:54 erlangen kernel: **sd 4:0:0:0: [sdc] Write Protect is off**
May 16 14:46:54 erlangen kernel: sd 4:0:0:0: [sdc] Mode Sense: 00 3a 00 00
May 16 14:46:54 erlangen kernel: **sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA**
May 16 14:46:54 erlangen kernel: **scsi 5:0:0:0: CD-ROM            PIONEER  DVD-RW  DVR-221  1.00 PQ: 0 ANSI: 5**
May 16 14:46:54 erlangen kernel: **sd 2:0:0:0: [sda] Attached SCSI disk**
May 16 14:46:54 erlangen kernel: **sd 4:0:0:0: [sdc] supports TCG Opal**
May 16 14:46:54 erlangen kernel: **sd 4:0:0:0: [sdc] Attached SCSI disk**
May 16 14:46:54 erlangen kernel: **sd 3:0:0:0: [sdb] Attached SCSI disk**
May 16 14:46:54 erlangen kernel: **sd 2:0:0:0: Attached scsi generic sg0 type 0**
May 16 14:46:54 erlangen kernel: **sd 3:0:0:0: Attached scsi generic sg1 type 0**
May 16 14:46:54 erlangen kernel: **sd 4:0:0:0: Attached scsi generic sg2 type 0**
May 16 14:46:54 erlangen kernel: **scsi 5:0:0:0: Attached scsi generic sg3 type 5**
May 16 14:46:55 erlangen kernel: sr 5:0:0:0: [sr0] scsi3-mmc drive: 40x/40x writer dvd-ram cd/rw xa/form2 cdda tray 
May 16 14:46:55 erlangen kernel: sr 5:0:0:0: Attached scsi CD-ROM sr0
May 16 17:16:16 erlangen kernel: **sd 2:0:0:0: [sda] Synchronizing SCSI cache**
May 16 17:16:16 erlangen kernel: **sd 2:0:0:0: [sda] Stopping disk**
May 16 17:16:16 erlangen kernel: **sd 4:0:0:0: [sdc] Synchronizing SCSI cache**
May 16 17:16:16 erlangen kernel: **sd 3:0:0:0: [sdb] Synchronizing SCSI cache**
May 16 17:16:16 erlangen kernel: **sd 3:0:0:0: [sdb] Stopping disk**
May 16 17:16:16 erlangen kernel: **sd 4:0:0:0: [sdc] Stopping disk**
May 16 17:16:16 erlangen kernel: **sd 3:0:0:0: [sdb] Starting disk**
May 16 17:16:16 erlangen kernel: **sd 2:0:0:0: [sda] Starting disk**
May 16 17:16:16 erlangen kernel: **sd 4:0:0:0: [sdc] Starting disk**
**erlangen:~ #**

I see, thank you. So just to confirm, I would use [LEFT]if=/dev/sda3[/LEFT] since I just have a regular SSD (not NVMe) right?

I think so, 3400G has:

**3400G:~ #** df -h / 
Filesystem      Size  Used Avail Use% Mounted on 
/dev/sdc3        40G   25G   16G  63% / 
**3400G:~ #**

Thus I run:
[FONT=monospace]

**3400G:~ #** dd if=/dev/sdc3 of=/dev/null bs=4M 
10240+0 records in 
10240+0 records out 
42949672960 bytes (43 GB, 40 GiB) copied, 77.6176 s, 553 MB/s 
**3400G:~ #**

Messages are:
[/FONT]

[FONT=monospace]**3400G:~ #** journalctl -b 0 _KERNEL_SUBSYSTEM=scsi 
-- Logs begin at Thu 2021-04-29 05:00:44 CEST, end at Sun 2021-05-16 19:01:01 CEST. -- 
May 16 15:49:37 3400G kernel: scsi host0: ahci 
May 16 15:49:37 3400G kernel: scsi host1: ahci 
May 16 15:49:37 3400G kernel: scsi host2: ahci 
May 16 15:49:37 3400G kernel: scsi host3: ahci 
May 16 15:49:37 3400G kernel: scsi host4: ahci 
May 16 15:49:37 3400G kernel: scsi host5: ahci 
May 16 15:49:37 3400G kernel: scsi host6: ahci 
May 16 15:49:37 3400G kernel: scsi host7: ahci 
May 16 15:49:37 3400G kernel: **scsi 0:0:0:0: Direct-Access     ATA      ST2000DM001-1CH1 CC29 PQ: 0 ANSI: 5**
May 16 15:49:37 3400G kernel: **sd 0:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)**
May 16 15:49:37 3400G kernel: **sd 0:0:0:0: [sda] 4096-byte physical blocks**
May 16 15:49:37 3400G kernel: **sd 0:0:0:0: [sda] Write Protect is off**
May 16 15:49:37 3400G kernel: sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
May 16 15:49:37 3400G kernel: **sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA**
May 16 15:49:37 3400G kernel: **sd 0:0:0:0: [sda] Attached SCSI disk**
May 16 15:49:37 3400G kernel: **scsi 1:0:0:0: Direct-Access     ATA      Samsung SSD 850  3B6Q PQ: 0 ANSI: 5**
May 16 15:49:37 3400G kernel: **sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/466 GiB)**
May 16 15:49:37 3400G kernel: **sd 1:0:0:0: [sdb] Write Protect is off**
May 16 15:49:37 3400G kernel: sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
May 16 15:49:37 3400G kernel: **sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA**
May 16 15:49:37 3400G kernel: **sd 1:0:0:0: [sdb] supports TCG Opal**
May 16 15:49:37 3400G kernel: **sd 1:0:0:0: [sdb] Attached SCSI disk**
May 16 15:49:37 3400G kernel: **scsi 4:0:0:0: Direct-Access     ATA      Samsung SSD 850  2B6Q PQ: 0 ANSI: 5**
May 16 15:49:37 3400G kernel: **sd 4:0:0:0: [sdc] 488397168 512-byte logical blocks: (250 GB/233 GiB)**
May 16 15:49:37 3400G kernel: **sd 4:0:0:0: [sdc] Write Protect is off**
May 16 15:49:37 3400G kernel: sd 4:0:0:0: [sdc] Mode Sense: 00 3a 00 00
May 16 15:49:37 3400G kernel: **sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA**
May 16 15:49:37 3400G kernel: **sd 4:0:0:0: [sdc] supports TCG Opal**
May 16 15:49:37 3400G kernel: **sd 4:0:0:0: [sdc] Attached SCSI disk**
May 16 15:49:37 3400G kernel: **sd 0:0:0:0: Attached scsi generic sg0 type 0**
May 16 15:49:37 3400G kernel: **sd 1:0:0:0: Attached scsi generic sg1 type 0**
May 16 15:49:37 3400G kernel: **sd 4:0:0:0: Attached scsi generic sg2 type 0**
May 16 18:58:22 3400G kernel: **sd 4:0:0:0: [sdc] Synchronizing SCSI cache**
May 16 18:58:22 3400G kernel: **sd 4:0:0:0: [sdc] Stopping disk**
May 16 18:58:22 3400G kernel: **sd 1:0:0:0: [sdb] Synchronizing SCSI cache**
May 16 18:58:22 3400G kernel: **sd 0:0:0:0: [sda] Synchronizing SCSI cache**
May 16 18:58:22 3400G kernel: **sd 1:0:0:0: [sdb] Stopping disk**
May 16 18:58:22 3400G kernel: **sd 0:0:0:0: [sda] Stopping disk**
May 16 18:58:22 3400G kernel: **sd 0:0:0:0: [sda] Starting disk**
May 16 18:58:22 3400G kernel: **sd 1:0:0:0: [sdb] Starting disk**
May 16 18:58:22 3400G kernel: **sd 4:0:0:0: [sdc] Starting disk**
**3400G:~ #**

[/FONT]