0

Linux is continuously throwing these error logs:

XFS: metadata I/O error in "xfs_trans_read_buf_map" at daddr ... len 32 error 5

XFS: xfs_imap_to_bp: xfs_trans_read_buf() returned error -5

The laptop is slow and opening a web browser takes minutes. What could be the cause?

Screenshot

Update

Also, there is a Windows virtual machine which is showing BSoD consistently at boot time. Maybe it's a related problem:

https://superuser.com/q/1692804/571029

Megidd
  • 1,549
  • Related: https://unix.stackexchange.com/q/607162/158683 – Megidd Dec 14 '21 at 08:27
  • 5
    this looks very much like a faulty drive, you can't fix filesystems on faulty drives, you have to ddrescue first then hope for the best – frostschutz Dec 14 '21 at 08:35
  • @frostschutz Thanks. Also, my Windows 10 virtual machine is showing blue-screen-of-death at boot time consistently. I'm not sure, but maybe that's a related problem. – Megidd Dec 14 '21 at 08:40
  • 2
    Maybe the read errors in the faulty drive are all in the sectors occupied by the VM virtual hard disk. Check badblocks and SMART – golimar Dec 15 '21 at 09:22
  • @golimar Thanks. I will try badblocks and SMART – Megidd Dec 15 '21 at 12:01
  • I will have to back up the data and replace the hard disk: https://unix.stackexchange.com/q/683313/158683 – Megidd Dec 21 '21 at 12:10
  • I will have to back up the data and replace the hard disk: https://unix.stackexchange.com/q/683313/158683 – Megidd Dec 21 '21 at 12:10

3 Answers3

1

RHEL XFS-File system Repair

Pre-repair Activity

  • Ensure Proper Data Backup (OR) at least a new snapshot
  • Attach the OS Disk to the VM

Action Plan

  • Boot the system into Rescue mode from an installation DVD

  • List and activate the volumes in order to scan them

  • Repair the File system using xfs_repair

  • Reboot the server from OS HDD

Boot a system into Rescue mode from an installation boot medium

Step-1: Boot the Red Hat 8 system from an installation source that can be a DVD image, ISO image, or USB drive. We will boot the system with the ISO image as it is easy to mount anywhere like a Physical system or Virtual system.

Step 2: Once the system has successfully booted from the ISO image, the boot screen will appear. Select the ‘Troubleshooting’ option and press enter

enter image description here

Step-3: In the next screen, select the ‘Rescue a Red Hat Linux system’ option and press enter

enter image description here

Step-4: When prompted to mount disks on the next screen, select the option '3 (Skip to shell)'. and hit ‘ENTER’.

enter image description here

Step-5: If you’re using LVM, activate the volumes in order to scan them.

# lvm vgchange -ay

enter image description here

Step-6: File system checker utilities such as ‘xfs_repair’ and ‘e2fsck’ guarantee only metadata consistency across the file system, they don’t know about actual data stored within the file system and are not data recovery tools. These applications are expected to detect and repair at least some inconsistencies.

For LVM Volume:

# xfs_repair /dev/mapper/[vg]-[lv]
# xfs_repair /dev/mapper/rhel-root

enter image description here

  • The VM will reboot when you enter the exit command.
  • Select the option to boot from a hard drive or to unmount the CD and boot the VM in normal mode
0

I just powered off the Linux laptop for a few hours and the XFS errors got resolved.

However, as soon as I start a Windows virtual machine inside Linux laptop, I receive some kernel errors. Not exactly the XFS errors, but some errors like:

blk_update_request: I/O error, dev sda, sector 1654298024 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0

ata1.00: exception Emask 0x0 SAct 0x80000000 SErr 0x40000 action 0x0

ata1.00: irq_stat 0x40000008

ata1: SError: { CommWake }

ata1.00: failed command: READ FPDMA QUEUED

ata1.00: cmd 60/08:f8:a8:95:9a/00:00:62:00:00/40 tag 31 ncq dma 4096 in res 41/40:08:a8:95:9a/00:00:62:00:00/40 Emask 0x409 (media error)

ata1.00: status: { DRDY ERR }

ata1.00: error: { UNC }

Screenshot

The virtual machine takes forever to boot. It doesn't boot. Just an empty screen is shown:

Virtual machine screenshot

Megidd
  • 1,549
0

Conclusion

I will have to back up the data and replace the hard disk:

What does command do: `badblocks -svn /dev/sda`? does it just report the bad blocks?

Tried

I just used badblocks -svn /dev/sda command to handle the bad blocks of the hard disk. As suggested here. It took almost two days to finish!

Screenshot

Megidd
  • 1,549