Disk Issues
Some notes on issues with disks.
Troubleshooting
bad geometry: block count exceeds size of device
When trying to mount a ext4 partition on an old disk via a USB SATA adapter, it fails:
# mount -o ro /dev/sda1 /mnt/sda
mount: /mnt/sda: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.
dmesg
shows a bit more information:
[Sun Nov 29 21:00:58 2020] EXT4-fs (sda1): bad geometry: block count 488378390 exceeds size of device (488378389 blocks)
[Sun Nov 29 21:01:20 2020] EXT4-fs (sda1): bad geometry: block count 488378390 exceeds size of device (488378389 blocks)
It looks like the disk shrank by one block? The disk doesn't appear to be very healthy either since running fsck causes a bunch of blk_update_request: critical medium error, dev sda
messages.
Fix: I could mount the disk when using a real SATA controller. Somehow, the USB SATA adapter which I pulled from an external hard drive shows the disk differently. This appears to be a common issue with using USB SATA adapters. See: USB External Hard Disks Appear Smaller