USB Harddisk gets unavailable while restic backup running

I wanted to make a backup with restic on an 3-4 years old and less often used usb 3.0 harddisk. I plug in the cable, mount it under KDE and can access the filesystem from the shell.

If I start restic with a short backup, all is ok. If I start a longer backup, after some time, maybe >4 minutes, the harddisk gets unavailable and restic prints io-errors. From the desktop’s bottom right suddenly a dialogue window appears and questions for to mount the disk, if I interpret this right.

I tried to disable usb autosuspend and added »usbcore.autosuspend=-1« to the file /etc/default/grub , update-grub, reboot. But this did not change anything.

I also tried this:

  • I checked the harddisk with blockcheck, no errors found, no io-errors thrown.
  • I did an fsck.ext4 on this ext4 filesystem, all ok.
  • I tried another usb port, no change.

The strange thing is: The harddisk gets unavailabe while being used, not when being idle.

Do you have an idea what could be the reason of this behaviour?

These messages I get from dmesg:

[162565.462781] Buffer I/O error on dev sdf1, logical block 234784272, async page read
[162565.462791] Buffer I/O error on dev sdf1, logical block 234784272, async page read
[162565.462798] Buffer I/O error on dev sdf1, logical block 234784272, async page read
[162565.462807] Buffer I/O error on dev sdf1, logical block 234784273, async page read
[162565.462813] Buffer I/O error on dev sdf1, logical block 234784273, async page read
[162565.462819] Buffer I/O error on dev sdf1, logical block 234784273, async page read
[162565.462826] Buffer I/O error on dev sdf1, logical block 234784273, async page read
[162565.462834] Buffer I/O error on dev sdf1, logical block 234784274, async page read
[162565.462840] Buffer I/O error on dev sdf1, logical block 234784274, async page read


[249331.843573] JBD2: Error while async write back metadata bh 229647052.
[249331.843574] JBD2: Error while async write back metadata bh 229647053.
[249332.123857] usb 2-1: new SuperSpeed USB device number 25 using xhci_hcd
[249332.141390] usb 2-1: New USB device found, idVendor=1058, idProduct=0748, bcdDevice=10.15
[249332.141397] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[249332.141400] usb 2-1: Product: My Passport 0748
[249332.141402] usb 2-1: Manufacturer: Western Digital
[249332.141404] usb 2-1: SerialNumber: 575844314137324C33353732
[249332.143474] usb-storage 2-1:1.0: USB Mass Storage device detected
[249332.143649] scsi host7: usb-storage 2-1:1.0
[249333.157905] scsi 7:0:0:0: Direct-Access WD My Passport 0748 1015 PQ: 0 ANSI: 6
[249333.158289] scsi 7:0:0:1: Enclosure WD SES Device 1015 PQ: 0 ANSI: 6
[249333.160187] sd 7:0:0:0: Attached scsi generic sg2 type 0
[249333.160473] ses 7:0:0:1: Attached Enclosure device
[249333.162067] ses 7:0:0:1: Attached scsi generic sg4 type 13
[249333.163272] sd 7:0:0:0: [sdg] 1953458176 512-byte logical blocks: (1.00 TB/931 GiB)
[249333.163707] sd 7:0:0:0: [sdg] Write Protect is off
[249333.163717] sd 7:0:0:0: [sdg] Mode Sense: 47 00 10 08
[249333.164136] sd 7:0:0:0: [sdg] No Caching mode page found
[249333.164145] sd 7:0:0:0: [sdg] Assuming drive cache: write through
[249333.164698] ses 7:0:0:1: Wrong diagnostic page; asked for 1 got 8
[249333.164709] ses 7:0:0:1: Failed to get diagnostic page 0x1
[249333.164717] ses 7:0:0:1: Failed to bind enclosure -19
[249333.220300] sdg: sdg1
[249333.238170] sd 7:0:0:0: [sdg] Attached SCSI disk
[249336.152670] EXT4-fs error: 16 callbacks suppressed
[249336.152677] EXT4-fs error (device sdf1): __ext4_find_entry:1611: inode #57409537: comm restic: reading directory lblock 0
[249336.152766] EXT4-fs error (device sdf1): __ext4_find_entry:1611: inode #57409537: comm restic: reading directory lblock 0
[249337.118626] EXT4-fs error (device sdf1): __ext4_find_entry:1611: inode #57409537: comm restic: reading directory lblock 0
[249337.118728] EXT4-fs error (device sdf1): __ext4_find_entry:1611: inode #57409537: comm restic: reading directory lblock 0

Looks like your drive is failing. You should check its SMART data to confirm.

Yes, unfortunately it seems that the drive has physical block errors. I found these with:

fsck.ext4 -vcck /dev/sdf1

Well, it seems I should better change my disk in time and replace it with an ssd… Thanks.