Ubuntu 16.10, Kernel

I have an external hard drive connected. It is configured with the ext4 file system. It has 600 GB of important family photos and videos on it. I have a backup of it, so we are not in imminent danger of losing all that data. It is a fairly new (purchased about 18 months ago) 5TB drive.

Recently, whenever I try to copy or move a file from that drive, the system gives me this error message: "Error Code 9: Bad file descriptor". This happens only when that drive is the source of the copy or move - When I attempt copying or moving of files from other sources/drives, I do not get that error.

My guess is that the drive is failing, but I don't know that for certain. I have run fsck (via gparted) on the drive. The first time it reported an uncountable number of errors, but it said it was able to fix all of them. I repeated running fsck on it a couple more times after that, each time it reported no problems. Since then, my problem has been gone. But, my concern is, How do I know if it is only a lucky, temporary reprieve?

How can I determine for sure that the external hard drive is failing?

If it is, how can I determine if simply reformatting it and copying the data back onto it will be fine, versus having to replace it?

Or..... Is my guess incorrect, and the description of my problem indicate something else is wrong?


Here is the result of running the smartctl command, I do not know how to interpret these results (the "WHEN_FAILED" column had only dashes in it):

main1@system1:~$ sudo smartctl -a -d sat /dev/sdi [sudo] password for main1:  smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.8.0-45-generic] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION === Model Family:     Western Digital Green Device Model:     WDC WD60EZRX-11MVLB1 Serial Number:    WD-WX21DC42E2TP LU WWN Device Id: 5 0014ee 2b6db3009 Firmware Version:
80.00A80 User Capacity:    6,001,141,572,096 bytes [6.00 TB] Sector Sizes:     512 bytes logical, 4096 bytes physical Rotation Rate:    5700 rpm Device is:        In smartctl database [for details use: -P show] ATA Version is:   ACS-2, ACS-3 T13/2161-D revision 3b SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s) Local Time is:    Tue Apr  4 20:24:33 2017 CDT 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:  (0x82)   Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled. 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:      ( 4064) seconds. Offline data collection capabilities:           (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    Offline surface scan supported.
                    Self-test supported.
                    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:    ( 694) minutes. Conveyance self-test routine recommended polling time:      (   5) minutes. SCT capabilities:
           (0x3035) SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

    SMART Attributes Data Structure revision number: 16  
Vendor Specific SMART Attributes with Thresholds:  
 1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always      -       1  
 3 Spin_Up_Time            0x0027   202   187   021    Pre-fail  Always       -       8883  
 4 Start_Stop_Count        0x0032   097   097   000    Old_age   Always       -       3408  
 5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always      -       0  
 7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0  
 9 Power_On_Hours          0x0032   089   089   000    Old_age   Always       -       8454  
10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always      -       0  
11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0  
12 Power_Cycle_Count       0x0032   097   097   000    Old_age   Always       -       3405 
192 Power-Off_Retract_Count 0x0032   196   196   000    Old_age   Always      -       3259 
193 Load_Cycle_Count        0x0032   076   076   000    Old_age   Always       -       372574 
194 Temperature_Celsius     0x0022   102   093   000    Old_age   Always       -       50 
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always      -       0 
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0 
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0 
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always      -       0 
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1 No Errors Logged

SMART Self-test log structure revision number 1 No self-tests have been logged.  [To run self-tests, use: smartctl -t]

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.

  • Use both the -a and the -s sat on the smartctl command. sudo smartctl -a -d sat /dev/sdi – ubfan1 Apr 4 '17 at 4:07

Ensure when you backup you don't overwrite any previous backups -- you might have already lost some files, so the old backups may be your only source. Install the smartmontools package

sudo apt-get install smartmontools

then run a disk check on whatever disk you have problems with (sdb used below, use what your system has for the device:

sudo smartctl -a /dev/sdb

Post the results in your question for further opinions on disk health. Look at the "When failed" column to see if there is anything.

There are no errors reported on the drive, so the problem was probably not hardware. With fsck "fixing" many errors, maybe you'd be better off reformatting and restoring from your backups. Ensure you can read your backups first though!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.