Input/output error on some filesystems not others

A while back I had a external HDD ‘die’ on me. I could no longer mount the drive or create a new ext4 filesystem. Fsck complained about bad superblocks and e2fsck couldn’t specify a backup superblock so I gave up. Don’t remember the exact error.

Today I thought let me try again. Trying to create an ext4 filesystem gave me the same error:

▶ sudo mkfs.ext4 /dev/sdb
mke2fs 1.47.2 (1-Jan-2025)
Creating filesystem with 122096646 4k blocks and 30531584 inodes
Filesystem UUID: e7071a34-f2a9-41d8-bad6-5d92a684ce99
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
	102400000

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: mkfs.ext4: Input/output error while writing out and closing file system

So I thought let me try some different filesystem:

▶ sudo mkfs.exfat /dev/sdb
exfatprogs version : 1.2.9
Creating exFAT filesystem(/dev/sdb, cluster size=131072)

Writing volume boot record: done
Writing backup volume boot record: done
Fat table creation: done
Allocation bitmap creation: done
Upcase table creation: done
Writing root directory entry: done
Synchronizing...

exFAT format fail!

No luck!

▶ sudo mkfs.msdos /dev/sdb
mkfs.fat 4.2 (2021-01-31)
mkfs.msdos: unable to synchronize /dev/sdb:Input/output error

But using vfat or btrfs works just fine:

▶ sudo mkfs.vfat /dev/sdb
mkfs.fat 4.2 (2021-01-31)
▶ sudo mkfs.btrfs -f /dev/sdb
btrfs-progs v6.15
See https://btrfs.readthedocs.io for more information.

Performing full device TRIM /dev/sdb (465.76GiB) ...
NOTE: several default settings have changed in version 5.15, please make sure
      this does not affect your deployments:
      - DUP for metadata (-m dup)
      - enabled no-holes (-O no-holes)
      - enabled free-space-tree (-R free-space-tree)

Label:              (null)
UUID:               2c743bc3-4e4f-49de-8885-d45d5830f755
Node size:          16384
Sector size:        4096	(CPU page size: 4096)
Filesystem size:    465.76GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         DUP               1.00GiB
  System:           DUP               8.00MiB
SSD detected:       no
Zoned device:       no
Features:           extref, skinny-metadata, no-holes, free-space-tree
Checksum:           crc32c
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1   465.76GiB  /dev/sdb

My questions is why? They all use superblocks right?

Have you something like a partition manager be able to format it? I don’t know why it would work for some formats and not others unless btrfs checks the device for badblocks and marks ones it finds. :man_shrugging:

I’m using the drive now with btrfs and no problems so far. I just think it’s weird that some fs work and others spit out an error.

since it’s a straight format the only thing i can think of is maybe something to do with the partition itself.

A successful mkfs.btrfs doesn’t guarantee a successful mount, and various issues can cause mounting to fail !!
please do a btrfs check : ‘sudo btrfs check /dev/sdb’
I don’t think you can mount /dev/sdb…
Can you mount /dev/sdb ? please try : ‘sudo mount /dev/sdb /mnt’.

▶ sudo btrfs check /dev/sdb
Opening filesystem to check...
ERROR: /dev/sdb is currently mounted, use --force if you really intend to check the filesystem
▶ sudo btrfs check --force /dev/sdb
Opening filesystem to check...
WARNING: filesystem mounted, continuing because of --force
Checking filesystem on /dev/sdb
UUID: 2c743bc3-4e4f-49de-8885-d45d5830f755
[1/8] checking log skipped (none written)
[2/8] checking root items
[3/8] checking extents
[4/8] checking free space tree
[5/8] checking fs roots
[6/8] checking only csums items (without verifying data)
[7/8] checking root refs
[8/8] checking quota groups skipped (not enabled on this FS)
found 35179626496 bytes used, no error found
total csum bytes: 34316640
total tree bytes: 39387136
total fs tree bytes: 3604480
total extent tree bytes: 442368
btree space waste bytes: 1399437
file data blocks allocated: 35142197248
 referenced 35136925696

I’ve been using the drive and encountered no issues so far.

Have you done S.M.A.R.T. check for that disk?

▶ sudo smartctl -a /dev/sdb
smartctl 7.5 2025-04-30 r5714 [x86_64-linux-6.12.35-1-lts] (local build)
Copyright (C) 2002-25, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Samsung SpinPoint M8 (AF)
Device Model:     ST500LM012 HN-M500MBB
Serial Number:    S2ZYJ9DDC17055
LU WWN Device Id: 5 0004cf 20c137212
Firmware Version: 2BA30001
User Capacity:    500.107.862.016 bytes [500 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      2.5 inches
Device is:        In smartctl database 7.5/5706
ATA Version is:   ATA8-ACS T13/1699-D revision 6
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Wed Jul  9 08:57:58 2025 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever
					been run.
Total time to complete Offline
data collection: 		( 6600) seconds.
Offline data collection
capabilities: 			 (0x5b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 ( 110) minutes.
SCT capabilities: 	       (0x003f)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   100   100   051    Pre-fail  Always       -       16
  2 Throughput_Performance  0x0026   252   252   000    Old_age   Always       -       0
  3 Spin_Up_Time            0x0023   094   082   025    Pre-fail  Always       -       1851
  4 Start_Stop_Count        0x0032   055   055   000    Old_age   Always       -       45592
  5 Reallocated_Sector_Ct   0x0033   252   252   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   252   252   051    Old_age   Always       -       0
  8 Seek_Time_Performance   0x0024   252   252   015    Old_age   Offline      -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       2450
 10 Spin_Retry_Count        0x0032   252   252   051    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       16
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       1778
191 G-Sense_Error_Rate      0x0022   100   100   000    Old_age   Always       -       254
192 Power-Off_Retract_Count 0x0022   252   252   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0002   064   050   000    Old_age   Always       -       27 (Min/Max 3/50)
195 Hardware_ECC_Recovered  0x003a   100   100   000    Old_age   Always       -       0
196 Reallocated_Event_Count 0x0032   252   252   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   252   252   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   252   252   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0036   039   039   000    Old_age   Always       -       32502
200 Multi_Zone_Error_Rate   0x002a   100   100   000    Old_age   Always       -       31088
223 Load_Retry_Count        0x0032   100   100   000    Old_age   Always       -       16
225 Load_Cycle_Count        0x0032   094   094   000    Old_age   Always       -       61336

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%      2435         -
# 2  Short offline       Completed without error       00%      1739         -
# 3  Extended offline    Aborted by host               90%      1739         -
# 4  Short offline       Completed without error       00%      1739         -
# 5  Extended offline    Aborted by host               30%      1739         -
# 6  Extended offline    Aborted by host               90%      1738         -
# 7  Extended offline    Aborted by host               90%      1738         -
# 8  Extended offline    Aborted by host               90%      1738         -
# 9  Extended offline    Aborted by host               90%      1738         -
#10  Extended offline    Aborted by host               40%      1738         -

SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been run
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Completed [00% left] (0-65535)
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

The above only provides legacy SMART information - try 'smartctl -x' for more

This is high value. Is there a problem with the cabling?

The dive is in an external enclosure connected with a USB cable to the PC. The cable is fine and I had it connected with a different cable yesterday when I was testing the drive.

And the disk has been heavily treated at some point.
Disk has detected 254 shocks that are strong enough to register with the G-Sense sensor.

100 is the starting value so that means it hasn’t detected high G-forces when turned on right?

The drive, as far as I know, has always been treated with the care a spinning drive deserves. But the drive is old so who knows.

VALUE and WORST here may not change at all, only RAW_VALUE (ID# 191)

Never understood these RAW values but I’ll keep an eye on it and see if it increases.

Probably good to follow these (RAW_VALUE) too:

1 Raw_Read_Error_Rate     0x002f   100   100   051    Pre-fail  Always       -       16
199 UDMA_CRC_Error_Count    0x0036   039   039   000    Old_age   Always       -       32502
200 Multi_Zone_Error_Rate   0x002a   100   100   000    Old_age   Always       -       31088