Bugzilla – Bug 1144546
btrfs - mount external drive via USB fails with superblock can't be read
Last modified: 2019-12-23 01:24:17 UTC
not sure, when this was introduced - back to kernel 5.2.4 same situation mounting same device on a stable Leap 15.0 (VM on same host) works. Also different rescue / checking with btrfs-tools do not show any problems. Superblock and all copies are valid. affected system (host): ======================= Linux 5.2.6-1.g187170c-default #1 SMP Sun Aug 4 15:14:38 UTC 2019 (187170c) x86_64 GNU/Linux btrfs-progs v5.1 dmesg - output: (1) plug in USB storage-device: ... [25401.785475] usb 1-2: new high-speed USB device number 5 using xhci_hcd [25401.934546] usb 1-2: New USB device found, idVendor=04e8, idProduct=6034, bcdDevice= 0.00 [25401.934551] usb 1-2: New USB device strings: Mfr=1, Product=11, SerialNumber=3 [25401.934555] usb 1-2: Product: Samsung G2 Portable [25401.934557] usb 1-2: Manufacturer: JMicron [25401.934560] usb 1-2: SerialNumber: 00000011E09310C0005C [25401.936277] usb-storage 1-2:1.0: USB Mass Storage device detected [25401.936591] scsi host4: usb-storage 1-2:1.0 [25402.385579] usb 1-2: reset high-speed USB device number 5 using xhci_hcd ... (2) try to mount the device: sudo mount /dev/sdb1 /tmp --verbose mount: /tmp: Der Superblock von /dev/sdb1 konnte nicht gelesen werden. dmesg - output: ... [25440.914136] usb 1-2: reset high-speed USB device number 5 using xhci_hcd [25441.063783] usb-storage 1-2:1.0: USB Mass Storage device detected [25441.064320] scsi host4: usb-storage 1-2:1.0 [25442.090390] scsi 4:0:0:0: Direct-Access Samsung G2 Portable PQ: 0 ANSI: 2 CCS [25442.091044] sd 4:0:0:0: Attached scsi generic sg1 type 0 [25442.091288] sd 4:0:0:0: [sdb] 1250263728 512-byte logical blocks: (640 GB/596 GiB) [25442.091782] sd 4:0:0:0: [sdb] Write Protect is off [25442.091787] sd 4:0:0:0: [sdb] Mode Sense: 3c 00 00 00 [25442.092234] sd 4:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [25442.093668] sdb: sdb1 [25442.095245] sd 4:0:0:0: [sdb] Attached SCSI disk [25451.570591] BTRFS info (device sdb1): disk space caching is enabled [25452.014781] BTRFS info (device sdb1): bdev /dev/sdb1 errs: wr 2, rd 0, flush 0, corrupt 0, gen 0 [25453.817230] BTRFS critical (device sdb1): corrupt leaf: root=5 block=6576889856 slot=10 ino=265, invalid inode generation: has 18446744073709551492 expect [0, 17248] [25453.817240] BTRFS error (device sdb1): block=6576889856 read time tree block corruption detected ... =============================================================================== test-case system (VM guest): ============================ Linux 4.12.14-lp150.12.67-default #1 SMP Tue Jul 9 08:18:26 UTC 2019 (b610084) x86_64 GNU/Linux btrfs-progs v4.15 (1) autoplug the device to VM dmesg-output: ... [ 2.768209] usb 1-2: new high-speed USB device number 3 using xhci_hcd [ 3.204950] usb 1-2: New USB device found, idVendor=04e8, idProduct=6034 [ 3.204955] usb 1-2: New USB device strings: Mfr=1, Product=11, SerialNumber=3 [ 3.204959] usb 1-2: Product: Samsung G2 Portable [ 3.204961] usb 1-2: Manufacturer: JMicron [ 3.204964] usb 1-2: SerialNumber: 00000011E09310C0005C [ 3.214198] usb-storage 1-2:1.0: USB Mass Storage device detected [ 3.215805] scsi host4: usb-storage 1-2:1.0 [ 3.215957] usbcore: registered new interface driver usb-storage [ 3.218192] usbcore: registered new interface driver uas [ 4.163485] systemd: 19 output lines suppressed due to ratelimiting [ 4.222281] scsi 4:0:0:0: Direct-Access Samsung G2 Portable PQ: 0 ANSI: 2 CCS [ 4.222708] sd 4:0:0:0: Attached scsi generic sg2 type 0 [ 4.224492] sd 4:0:0:0: [sdb] 1250263728 512-byte logical blocks: (640 GB/596 GiB) [ 4.226021] sd 4:0:0:0: [sdb] Write Protect is off [ 4.226025] sd 4:0:0:0: [sdb] Mode Sense: 3c 00 00 00 [ 4.227906] sd 4:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 7.349640] sdb: sdb1 ... (2) mount device to userspace dmesg-output: ... [ 130.285374] BTRFS info (device sdb1): disk space caching is enabled [ 130.406519] BTRFS info (device sdb1): bdev /dev/sdb1 errs: wr 2, rd 0, flush 0, corrupt 0, gen 0
Since the bug is caused by bad fs, and now we have a btrfs wiki for it, it should be good enough for end-users.
Latest btrfs-progs should have been able to fix the generation problem. Closing.