External hard disk impossible to access after interruption in formatting

Not a problem with Fedora as such, but perhaps someone might help.

I’ve recently bought a 2TB Toshiba Canvio Basics external hard disk. I could plug it in and started writing on it, but then it accidentally dropped and disconnected. Then I could no longer access its content. So I tried to format it (the only operation I was allowed to do). I tried to format it as password-protected EXT4. This was taking absurdly long (after 5 hours it had done 0.3%, estimated one month and a half left…), so I had to interrupt it. Since then I can no longer access the drive in any way. I have tried to restart the formatting with a faster method but in the ‘Disks’ utility I get the message: ‘Error wiping device: Failed to probe the device ‘/dev/sdc’ (udisks-error-quark, 0)’. I’ve tried several lines of advice found online, including the Fedora-recommended method for creating a partition, but I get error each time - the device is seen (it appears on /dev/sdc when I connect it, and the ‘Disks’ utility recognises it as Toshiba etc), but cannot be accessed.
I use Fedora 38.
The manufacturer doesn’t offer Linux support, they say that since the disk doesn’t work, to try asking for a replacement under warranty, but this feels dishonest - it was working when I got it.
Any advice would be priceless.

You mean physically dropping it? HDDs are delicate inside and are sensitive to rough handling.
Can you show what dmesg reports when the formatting fails?

[19536.792457] sd 3:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
[19536.792473] sd 3:0:0:0: [sdc] tag#0 Sense Key : Medium Error [current] 
[19536.792484] sd 3:0:0:0: [sdc] tag#0 Add. Sense: Unrecovered read error
[19536.792495] sd 3:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[19536.792502] critical medium error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
[19536.792517] Buffer I/O error on dev sdc, logical block 0, async page read
[19536.792545] ldm_validate_partition_table(): Disk read failed.
[19536.793776] Buffer I/O error on dev sdc, logical block 0, async page read
[19536.797735]  sdc: unable to read partition table

Yes, it physically dropped, not from a great height, I don’t think/I hope it’s not physically damaged (though it may), but it disconnected from the USB plug.

Try creating a new partition table.

> parted -l
[...]

Error: /dev/sdc: unrecognised disk label
Model: TOSHIBA EXTERNAL_USB (scsi)                                        
Disk /dev/sdc: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Model: Unknown (unknown)
Disk /dev/zram0: 8590MB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  8590MB  8590MB  linux-swap(v1)

> parted /dev/sdc
GNU Parted 3.5
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
Error: Input/output error during read on /dev/sdc
Retry/Ignore/Cancel?   

1 Like

Try overwriting it like this:

sudo dd if=/dev/zero of=/dev/sdc bs=1M count=100 status=progress

Also check the SMART diagnostics:

sudo dnf install smartmontools
sudo smartctl -a /dev/sdc
> dd if=/dev/zero of=/dev/sdc bs=1M count=100 status=progress
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 11.7237 s, 8.9 MB/s

but I get the same errors as before from Disks and parted.

smartctl -a /dev/sdc
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.5.5-200.fc38.x86_64] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Toshiba 2.5" HDD MQ04UBD...
Device Model:     TOSHIBA MQ04UBD200
Serial Number:    X2GGT0QAT
LU WWN Device Id: 0 000000 000000000
Firmware Version: JT0B0U
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      2.5 inches
Zoned Device:     Device managed zones
Device is:        In smartctl database 7.3/5528
ATA Version is:   ACS-3 T13/2161-D revision 5
SATA Version is:  SATA 3.3, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Sat Oct  7 07:39:55 2023 BST
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: 		(  120) 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: 	 ( 334) minutes.
SCT capabilities: 	       (0x003d)	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     0x000b   100   100   050    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   100   100   050    Pre-fail  Offline      -       0
  3 Spin_Up_Time            0x0027   100   100   001    Pre-fail  Always       -       2228
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       25
  5 Reallocated_Sector_Ct   0x0033   100   100   050    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   050    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   100   100   050    Pre-fail  Offline      -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       4
 10 Spin_Retry_Count        0x0033   100   100   030    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       22
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       7
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       4
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       44
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       31 (Min/Max 20/43)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   253   000    Old_age   Always       -       0
220 Disk_Shift              0x0002   100   100   000    Old_age   Always       -       0
222 Loaded_Hours            0x0032   100   100   000    Old_age   Always       -       3
223 Load_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
224 Load_Friction           0x0022   100   100   000    Old_age   Always       -       0
226 Load-in_Time            0x0026   100   100   000    Old_age   Always       -       260
240 Head_Flying_Hours       0x0001   100   100   001    Pre-fail  Offline      -       0

SMART Error Log Version: 1
ATA Error Count: 2
	CR = Command Register [HEX]
	FR = Features Register [HEX]
	SC = Sector Count Register [HEX]
	SN = Sector Number Register [HEX]
	CL = Cylinder Low Register [HEX]
	CH = Cylinder High Register [HEX]
	DH = Device/Head Register [HEX]
	DC = Device Command Register [HEX]
	ER = Error register [HEX]
	ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 2 occurred at disk power-on lifetime: 3 hours (0 days + 3 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  04 51 00 00 00 00 40

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  f2 00 01 00 00 00 40 00      00:10:14.362  SECURITY UNLOCK
  e5 00 00 00 00 00 00 00      00:10:09.697  CHECK POWER MODE
  e5 00 00 00 00 00 00 00      00:10:04.692  CHECK POWER MODE
  f2 00 01 00 00 00 40 00      00:09:59.935  SECURITY UNLOCK
  e5 00 00 00 00 00 00 00      00:09:59.702  CHECK POWER MODE

Error 1 occurred at disk power-on lifetime: 3 hours (0 days + 3 hours)
  When the command that caused the error occurred, the device was in standby mode.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  04 51 00 00 00 00 40

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  f2 00 01 00 00 00 40 00      00:09:59.935  SECURITY UNLOCK
  e5 00 00 00 00 00 00 00      00:09:59.702  CHECK POWER MODE
  e5 00 00 00 00 00 00 00      00:09:54.708  CHECK POWER MODE
  e5 00 00 00 00 00 00 00      00:09:49.699  CHECK POWER MODE
  e5 00 00 00 00 00 00 00      00:09:44.698  CHECK POWER MODE

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%         3         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    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
1 Like

This looks like physical damage to your disk. Try running the badblocks utility to detect bad sectors.
You probably should also try some SMART self tests.

But the errors began to appear not after the disk fell, they began to appear after I interrupted the formatting. After the disk fell, I could not access its content - which may well have been due to an unclean mount, or something else that did not necessarily indicate physical damage.

One question is why the formatting was taking so absurdly long - I cannot rule out that this was because there had been some physical damage. But the errors began to appear after I interrupted the formatting, not after the disk fell.

I’ll try badblocks and report back. I don’t know which other SMART self tests to do, apart from the output I quoted above.

Seagate seems to define this as “Frequency of mistakes as a result of impact loads as detected by a shock sensor(?).” so there is evidence left showing the drive suffered a shock. Portable/laptop drives are expected to survive minor shocks, so it is possible that the drive is OK if your can find a way to correct the “mistakes”. It is possilble that some “mistakes” affect internal housekeeping data not accessible by user tools. If Seagate is willing to replace the drive that may be your easy solution.

1 Like

My 1TB HDD didn’t take long to format as ext4, maybe you picked an option that wipes the disk on Format?

If you have Gnome DIsk Utility, you can the tests from there.

What is not clear to me: why do these testing tools have access to the disk, but when I try to format it, I get an error? I don’t think the disk is physically damaged. George N White III’s answer makes sense, also, even without the G–sense-errors, clearly interrupting the formatting had the potential to cause problems. But there must be a tool that gets past these problems. Is fsck worth a try? I saw somewhere recommended testdisk, might this work?

I’ll report on extended smart self-check and badblocks later today, they’re pretty slow.

Does the drive have a USB cable that can be replaced? Dropping the drive may have broken the cable.

I can try another cable, but when the drive fell, it actually slipped, the cable remained connected to the laptop, so it doesn’t feel intuitive that it may have been damaged.

The extended smart self-test came with no errors, other than the G-sense ones, all rubrics were reported as ‘ok’. Badblocks is extremely slow, I’ll give it a bit more time but almost certainly I’ll interrupt it. But I don’t think it’s a physical problem, anyway.

Any other thoughts I might try? If not, I’ll try to send it back, with the exact explanation of what happened - perhaps they can reset it and send it to me, rather than replacing it.

> mkfs.ext4 /dev/sdc
mke2fs 1.46.5 (30-Dec-2021)
Warning: could not erase sector 2: Input/output error
Creating filesystem with 488378646 4k blocks and 122101760 inodes
Filesystem UUID: 25675e06-f3b8-4bd9-b7a1-2743fb045509
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848

Allocating group tables: done                            
Warning: could not read block 0: Input/output error
Warning: could not erase sector 0: Input/output error
Writing inode tables: done                            
Creating journal (262144 blocks): 
done
Writing superblocks and filesystem accounting information:     0/14905
mkfs.ext4: Input/output error while writing out and closing file system

however badblocks -w and smartctl find no errors.

gparted doesn’t see /dev/sdc at all (same as the gnome Files application). The gnome Disks application identifies the disk, but gives error when I try to format it.

I don’t know what else to try - any last-minute ideas?

1 Like

Try using a different USB port and cable, preferably the Y-type with a separate power cord.

I’ve tried using a different (similar) cable, but I don’t think I have a Y-type one.

I want to try testdisk, it sounds like it might work, but I’m a bit worried to not do damage to my system in the process - has anyone run it? Is it safe for dummies? I understand I cannot run testdisk /dev/sdc, but rather testdisk with no options, then navigate through menus, and I am worried to not accidentally choose a wrong option.

fsck -y /dev/sdc
fsck from util-linux 2.38.1
e2fsck 1.46.5 (30-Dec-2021)
fsck.ext2: Input/output error while trying to open /dev/sdc

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

and the e2fsck commands give exactly the same output

Shall I try testdisk? Any tips?

I wonder if it would work better by creating a partition table and a single partition then doing
mkfs.ext4 /dev/sdc1

It seems you are trying to format the raw device. Even though it may work at times that seems to not be the standard except for the smaller flash drives.

Was it not what I was trying to do with parted (see output above)? Is there another way I can try to make a partition table?
Sorry for ignorance.