[SMART] Preventing usage of some bad sectors

Hi, i recently found out that my HD has some problematic sectors:

>  systemctl status smartd | xclip
● smartd.service - Self Monitoring and Reporting Technology (SMART) Daemon
     Loaded: loaded (/usr/lib/systemd/system/smartd.service; enabled; vendor preset: disabled)
     Active: active (running) since Sun 2020-12-06 11:53:40 +03; 6 days ago
       Docs: man:smartd(8)
             man:smartd.conf(5)
   Main PID: 1039 (smartd)
     Status: "Next check of 3 devices will start at 14:23:40"
      Tasks: 1 (limit: 38365)
     Memory: 2.7M
     CGroup: /system.slice/smartd.service
             └─1039 /usr/bin/smartd -n

Dec 12 12:53:40 manjaro smartd[1039]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 120 to 122
Dec 12 12:53:40 manjaro smartd[1039]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 120 to 122
Dec 12 12:53:40 manjaro smartd[1039]: Device: /dev/sdc [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 130 to 136
Dec 12 12:53:40 manjaro smartd[1039]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 130 to 136
Dec 12 13:23:40 manjaro smartd[1039]: Device: /dev/sda [SAT], 1 Currently unreadable (pending) sectors
Dec 12 13:23:40 manjaro smartd[1039]: Device: /dev/sda [SAT], 2 Offline uncorrectable sectors
Dec 12 13:23:40 manjaro smartd[1039]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 122 to 121
Dec 12 13:23:40 manjaro smartd[1039]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 122 to 121
Dec 12 13:53:40 manjaro smartd[1039]: Device: /dev/sda [SAT], 1 Currently unreadable (pending) sectors
Dec 12 13:53:40 manjaro smartd[1039]: Device: /dev/sda [SAT], 2 Offline uncorrectable sectors

Is there a way to exclude usage of all the bad sectors on that hard disk by the drive itself?

Because i’m using the HD with full device LUKS2 encryption in this way:

HD
 + No partition table
  + LUKS2 encryption
   + LVM with VG's as a way of partitioning the space inside the LUKS2 container.
    + VG with Filesystem of choice like ext4 etc...

(The LVM could be replaced with a single BTRFS ofcourse)


FYI:

  • This is my current setup where i have my current Manjaro installed.
  • The ESP is located on a different HD, which i plan to move to an USB-Stick to keep it more secure and locked-down in the future :wink:
  • I’m planning on doing a complete fresh install with latest iso, so reformatting the drive is not something i worry about, but i plan to use the same layout as mentioned above.
  • The bootloader to be used in the fresh install will be sd-boot again, so i probably will be using the Architect installer again.

Some interesting points in this thread.

One of the takeaways is that it is going to take a LOOOOOOOOOOOOOONG time.

2 Likes

Yea i already knew it would occupy my system for several hours :sweat_smile:
The HD im talking about in OP is a 4TB also :smiley:
I already planned on doing something similar over night, but wanted to know if there is a way to get a list of all those bad sectors and just provide the drive with the info to make it all faster.
But i guess i need to try it that way?

From what I gathered from that thread, doing the complete drive and letting the drive itself map the bad sectors would be the only way to be sure.

Yea i was afraid of that, i’m now doing the dd way on a 2TB external HD who has same issues.
Thanks :+1:

1 Like

you could also try to fix it with diskscan which is available in AUR

Also if not done already make sure you have a backup of your valuable data. Since this could indicate a dying disk.

My valuable data is either in the cloud or another HD :wink:

Thanks for the interesting link, i’ll be sure to try it via AUR :+1:
I see two versions with a git-version that is lower, which one you prefer?

:face_with_raised_eyebrow: Neither, since I prefer not to have any bad sectors on the disk.

:stuck_out_tongue:

I would try the last version to be honest

Ok i build the latest version, seems it was also updated last as date.
Running it now on the external 2TB disk: ETA:20h48m45s :rofl:

>  sudo diskscan --size 4096 --fix /dev/sde
diskscan version 0.19

I: Validating path /dev/sde
I: Opened disk /dev/sde sector size 512 num bytes 2000398931456
I: Scanning disk /dev/sde in 4096 byte steps
I: Scan started at: Sat Dec 12 20:24:45 2020

Disk scan |                                                                                                          | ETA:20h48m45s
1 Like

Update:

I did that as a test to see how it works on a external HD that i don’t use anylonger…
That last command seems to have finished prematurely:

Output
>  sudo diskscan --size 4096 --fix /dev/sde                                                                                    
diskscan version 0.19

I: Validating path /dev/sde
I: Opened disk /dev/sde sector size 512 num bytes 2000398931456
I: Scanning disk /dev/sde in 4096 byte steps
I: Scan started at: Sat Dec 12 20:24:45 2020

Disk scan |===============================================================                                           | ETA: 8h46m29s
E: Error when reading at offset 1200382323712 size 4096 read 4096, errno=0: Success

E: Details: error=fatal data=full 04/00/00

E: Fatal error occurred, bailing out.
Disk scan |===============================================================                                           | ETA: 8h46m35s

Access time histogram:
       Value   Percentile   TotalCount 1/(1-Percentile)

       0.124     0.000000            1         1.00
       0.145     0.100000     31140543         1.11
       0.150     0.200000     62139038         1.25
       0.154     0.300000     92188451         1.43
       0.158     0.400000    128192896         1.67
       0.160     0.500000    150030536         2.00
       0.162     0.550000    170787691         2.22
       0.163     0.600000    181092934         2.50
       0.164     0.650000    191653697         2.86
       0.166     0.700000    211794500         3.33
       0.167     0.750000    221286212         4.00
       0.168     0.775000    230685275         4.44
       0.169     0.800000    240299321         5.00
       0.170     0.825000    248900835         5.71
       0.171     0.850000    256758702         6.67
       0.171     0.875000    256758702         8.00
       0.172     0.887500    263200792         8.89
       0.173     0.900000    268449086        10.00
       0.173     0.912500    268449086        11.43
       0.174     0.925000    272959872        13.33
       0.175     0.937500    276789067        16.00
       0.175     0.943750    276789067        17.78
       0.176     0.950000    280116487        20.00
       0.177     0.956250    282866566        22.86
       0.177     0.962500    282866566        26.67
       0.178     0.968750    284803462        32.00
       0.179     0.971875    286210142        35.56
       0.179     0.975000    286210142        40.00
       0.180     0.978125    287266099        45.71
       0.181     0.981250    288124857        53.33
       0.182     0.984375    288824510        64.00
       0.183     0.985938    289354463        71.11
       0.184     0.987500    289738648        80.00
       0.185     0.989062    290018518        91.43
       0.187     0.990625    290396510       106.67
       0.191     0.992188    290798052       128.00
       0.195     0.992969    291004018       142.22
       0.202     0.993750    291246839       160.00
       0.222     0.994531    291460882       182.86
       0.258     0.995313    291694555       213.33
       0.281     0.996094    291921281       256.00
       0.297     0.996484    292040928       284.44
       0.307     0.996875    292154234       320.00
       0.317     0.997266    292270415       365.71
       0.328     0.997656    292380105       426.67
       0.340     0.998047    292499247       512.00
       0.345     0.998242    292549726       568.89
       0.354     0.998437    292608669       640.00
       0.366     0.998633    292665591       731.43
       0.376     0.998828    292725468       853.33
       0.383     0.999023    292780499      1024.00
       0.388     0.999121    292806033      1137.78
       0.397     0.999219    292835018      1280.00
       0.406     0.999316    292865059      1462.86
       0.413     0.999414    292892225      1706.67
       0.422     0.999512    292921549      2048.00
       0.427     0.999561    292936178      2275.56
       0.432     0.999609    292949607      2560.00
       0.438     0.999658    292964192      2925.71
       0.444     0.999707    292976604      3413.33
       0.451     0.999756    292991883      4096.00
       0.454     0.999780    292997861      4551.11
       0.459     0.999805    293005975      5120.00
       0.465     0.999829    293012499      5851.43
       0.480     0.999854    293019451      6826.67
       0.511     0.999878    293026372      8192.00
       0.555     0.999890    293029945      9102.22
       0.597     0.999902    293033558     10240.00
       0.649     0.999915    293037077     11702.86
       0.734     0.999927    293040635     13653.33
       0.905     0.999939    293044220     16384.00
       1.046     0.999945    293045999     18204.44
       1.266     0.999951    293047793     20480.00
       1.490     0.999957    293049576     23405.71
       1.784     0.999963    293051366     27306.67
       2.263     0.999969    293053176     32768.00
       2.305     0.999973    293054060     36408.89
       2.333     0.999976    293054944     40960.00
       2.361     0.999979    293055883     46811.43
       2.387     0.999982    293056743     54613.33
       2.417     0.999985    293057653     65536.00
       2.439     0.999986    293058086     72817.78
       2.469     0.999988    293058541     81920.00
       2.521     0.999989    293058972     93622.86
       2.685     0.999991    293059415    109226.67
       2.895     0.999992    293059861    131072.00
       3.031     0.999993    293060086    145635.56
       3.183     0.999994    293060309    163840.00
       3.343     0.999995    293060533    187245.71
       3.601     0.999995    293060755    218453.33
       3.941     0.999996    293060979    262144.00
       4.391     0.999997    293061091    291271.11
       5.119     0.999997    293061202    327680.00
       6.347     0.999997    293061314    374491.43
       8.215     0.999998    293061426    436906.67
       9.719     0.999998    293061538    524288.00
      10.463     0.999998    293061594    582542.22
      11.151     0.999998    293061650    655360.00
      11.983     0.999999    293061705    748982.86
      13.007     0.999999    293061761    873813.33
      14.295     0.999999    293061817   1048576.00
      14.911     0.999999    293061845   1165084.44
      15.519     0.999999    293061874   1310720.00
      17.471     0.999999    293061901   1497965.71
      19.327     0.999999    293061929   1747626.67
      21.551     1.000000    293061957   2097152.00
      22.207     1.000000    293061971   2330168.89
      23.823     1.000000    293061985   2621440.00
      24.319     1.000000    293062001   2995931.43
      24.415     1.000000    293062014   3495253.33
      25.023     1.000000    293062027   4194304.00
      25.391     1.000000    293062034   4660337.78
      25.455     1.000000    293062041   5242880.00
      25.551     1.000000    293062049   5991862.86
      26.047     1.000000    293062055   6990506.67
      30.319     1.000000    293062062   8388608.00
      33.023     1.000000    293062065   9320675.55
      33.439     1.000000    293062070  10485760.00
      33.471     1.000000    293062072  11983725.71
      35.199     1.000000    293062076  13981013.34
      40.127     1.000000    293062079  16777216.00
      40.991     1.000000    293062081  18641351.10
      42.591     1.000000    293062083  20971519.98
      44.063     1.000000    293062084  23967451.45
      46.495     1.000000    293062086  27962026.68
      54.463     1.000000    293062088  33554432.00
      54.751     1.000000    293062089  37282702.28
      59.135     1.000000    293062090  41943039.96
      59.135     1.000000    293062090  47934902.91
      86.847     1.000000    293062091  55924053.19
      99.455     1.000000    293062092  67108864.00
     102.079     1.000000    293062093  74565404.57
     102.079     1.000000    293062093  83886080.31
     102.079     1.000000    293062093  95869805.31
     128.703     1.000000    293062094 111848106.39
     128.703     1.000000    293062094 134217728.00
     285.439     1.000000    293062095 149130807.90
     285.439     1.000000    293062095 167772160.62
     285.439     1.000000    293062095 191739610.61
     285.439     1.000000    293062095 223696215.56
     285.439     1.000000    293062095 268435456.00
     441.855     1.000000    293062096 298261615.80
     441.855     1.000000    293062096          inf
#[Mean    =        0.161, StdDeviation   =        0.048]
#[Max     =      441.855, Total count    =    293062096]
#[Buckets =           16, SubBuckets     =         2048]

Latency graph:
  480 |                                                                       
      |                                                                       
      |                                           ^                           
      |                                                                       
      |                                                                       
  400 |                                                                       
      |                                                                       
      |                                                                       
      |                                                                       
      |                                                                       
  320 |                                                                       
      |                                                                       
      | ^                                                                     
      |                                                                       
      |                                                                       
  240 |                                                                       
      |                                                                       
      |                                                                       
      |                                                                       
      |                                                                       
  160 |                                                                       
      |                  ^                                                    
      |                                                                       
      |                             ^                                         
      |                      ^                                                
   80 |                                                                       
      |         ^                                                             
      |  ^^^^^^^ ^^^^^^^^ ^^^ ^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      | **********************************************************************
      | ______________________________________________________________________
      +-----------------------------------------------------------------------

Conclusion: failed due to IO errors
I: Scan ended at: Sun Dec 13 09:34:39 2020

I: Scan took 47395 second
I: Closed disk /dev/sde

How to interpret that?
Can that disk now be used without fear of bad sectors?

I would be wary about that I/O error. The drive’s controller could be flaking out as well. Check outputs of:

smartctl -A /dev/sde

Search your journal and dmesg for any entries around that time WRT diskscan and/or I/O errors.

It seems that you have some bad sectors marked out, but unless you can get to the cause of that I/O error, bad sectors could be the least of your worries; especially if you are going to put your critical data on it.

IIRC those were related to the USB port being reset due to inability to communicate with the external HD connected via USB.
Looked to me like the drive was unresponsive while doing it’s own relocation of the bad sectors.

>  sudo smartctl -A /dev/sde | xclip
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.9.11-3-MANJARO] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
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       -       4785
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       14639
  5 Reallocated_Sector_Ct   0x0033   049   049   050    Pre-fail  Always   FAILING_NOW 15592
  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   068   068   000    Old_age   Always       -       13113
 10 Spin_Retry_Count        0x0033   253   100   030    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       10122
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       120
192 Power-Off_Retract_Count 0x0032   099   099   000    Old_age   Always       -       902
193 Load_Cycle_Count        0x0032   098   098   000    Old_age   Always       -       29856
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       25 (Min/Max 11/48)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       212
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       784
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
220 Disk_Shift              0x0002   100   100   000    Old_age   Always       -       0
222 Loaded_Hours            0x0032   077   077   000    Old_age   Always       -       9212
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       -       178
240 Head_Flying_Hours       0x0001   100   100   001    Pre-fail  Offline      -       0

Looking at this thread on Ars, the Reallocated_Sector_Ct is the number of sectors that have been marked, and are not visible to the OS.

However, the Current_Pending_Sector is the number of bad sectors that could be written to.

Me, I would try to see if I could hook that drive up to a SATA port on my mobo, and attempt the diskscan program again, before I would consider using it.

1 Like

Very interesting thread indeed, thanks ! :+1:

I can’t hook the drive to a SATA port because it is one of those things that are enclosed in a plastic frame and i would need to break it open…
But i will start the diskscan app again on it right after this reply, hope it fixes itself so i can use it again :wink:
This all is a learning curve for me, and i will need to do it with my HD of the current system also, which has way less as this one i hope…

sorry for the late reply,

@merlock explained it perfectly

When you run it again I would (in this case) advice to add -r <file> to get an full log. Mind the file can get rather large, but it will show more details of all that is done.

I just started it with the -o flag, because the -r flag created a few MB in a fraction of a second already so i aborted :smiley:
I will edit this post with the output if it isn’t too big :wink:


The logfile that got generated
{
    "Disk": {
        "Vendor": "TOSHIBA",
        "Model": "External",
        "FwRev": "5438",
        "Serial": "--hidden-by-me--",
        "NumSectors": 3907029163,
        "SectorSize": 512
        },
    "Machine": { "System": "--hidden-by-me--", "Chassis": "--hidden-by-me--", "BaseBoard": "--hidden-by-me--", "Mac": "--hidden-by-me--", "OS": "GNU/Linux" },
    "Scan": {
        "StartTime": "2020-12-14 07:13:45",
        "Events": [
            {"LBA":                0, "Len":        8, "LatencyNSec": 1130671051, "Data": "data_full", "Error": "error_none", "Sense": {"SenseKey": 0, "Asc": 0, "Ascq": 0, "FruCode": 0, "VendorCode": 0, "Hex": ""}},
            {"LBA":       2344496726, "Len":        8, "LatencyNSec": 3441098679, "Data": "data_full", "Error": "error_fatal", "Sense": {"SenseKey": 4, "Asc": 0, "Ascq": 0, "FruCode": 0, "VendorCode": 0, "Hex": "700004000000000A"}}
        ],
        "EndTime": "2020-12-14 19:39:02",
        "Histogram": "HISTFAAADfJ4nE1WAXAU13n2//bd3t5qtVqWZX0c5+O4HOKQNapKiKoqGFSPKlOiMtRDKeMwriNjRVVVhtGoGpVRNWdZFbKiKDJ2iKpRiEqwRsUKIdijYqohIBSCZUIVhhCiUkqoRmUIcTEjU0xl2u9/e56pVnf73vv/9//f/73vf1K8882lTzzhbXki+NFyb1KTN/c/selesPAJSat+ITQWu/VHnd8Jdfy3d/xXj+hxNkuPFj+hnu92yfv3fqg96H4cmvj4M33x0/fCBy58bHT8573wpfufGpNTr0b63v93o/cHQ2bn7AWz74P/MU92/1ferV+/a908ds46s/+X5mz3w0hHzxuRR73vhx++8yP98ruLoauXx/T+Bz/RF/93Wr89/i197rPJ0FufHg+d+X5P6NhvP5FX7l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P0X4gdC/FITH3Ou/YbYHxbfJvGzNeI3T4v/A/skSto="
        "Latencies": [
            {"StartSector":                0, "EndSector":         55814703, "LatencyMinMsec":        0, "LatencyMaxMsec":     5425, "LatencyMedianMsec":        0},
            {"StartSector":         55814703, "EndSector":        111629406, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":        111629406, "EndSector":        167444109, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":        167444109, "EndSector":        223258812, "LatencyMinMsec":        0, "LatencyMaxMsec":       32, "LatencyMedianMsec":        0},
            {"StartSector":        223258812, "EndSector":        279073515, "LatencyMinMsec":        0, "LatencyMaxMsec":       14, "LatencyMedianMsec":        0},
            {"StartSector":        279073515, "EndSector":        334888218, "LatencyMinMsec":        0, "LatencyMaxMsec":       15, "LatencyMedianMsec":        0},
            {"StartSector":        334888218, "EndSector":        390702921, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":        390702921, "EndSector":        446517624, "LatencyMinMsec":        0, "LatencyMaxMsec":       24, "LatencyMedianMsec":        0},
            {"StartSector":        446517624, "EndSector":        502332327, "LatencyMinMsec":        0, "LatencyMaxMsec":       53, "LatencyMedianMsec":        0},
            {"StartSector":        502332327, "EndSector":        558147030, "LatencyMinMsec":        0, "LatencyMaxMsec":       34, "LatencyMedianMsec":        0},
            {"StartSector":        558147030, "EndSector":        613961733, "LatencyMinMsec":        0, "LatencyMaxMsec":       22, "LatencyMedianMsec":        0},
            {"StartSector":        613961733, "EndSector":        669776436, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":        669776436, "EndSector":        725591139, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":        725591139, "EndSector":        781405842, "LatencyMinMsec":        0, "LatencyMaxMsec":       42, "LatencyMedianMsec":        0},
            {"StartSector":        781405842, "EndSector":        837220545, "LatencyMinMsec":        0, "LatencyMaxMsec":       26, "LatencyMedianMsec":        0},
            {"StartSector":        837220545, "EndSector":        893035248, "LatencyMinMsec":        0, "LatencyMaxMsec":       12, "LatencyMedianMsec":        0},
            {"StartSector":        893035248, "EndSector":        948849951, "LatencyMinMsec":        0, "LatencyMaxMsec":       14, "LatencyMedianMsec":        0},
            {"StartSector":        948849951, "EndSector":       1004664654, "LatencyMinMsec":        0, "LatencyMaxMsec":      140, "LatencyMedianMsec":        0},
            {"StartSector":       1004664654, "EndSector":       1060479357, "LatencyMinMsec":        0, "LatencyMaxMsec":       15, "LatencyMedianMsec":        0},
            {"StartSector":       1060479357, "EndSector":       1116294060, "LatencyMinMsec":        0, "LatencyMaxMsec":       14, "LatencyMedianMsec":        0},
            {"StartSector":       1116294060, "EndSector":       1172108763, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":       1172108763, "EndSector":       1227923466, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":       1227923466, "EndSector":       1283738169, "LatencyMinMsec":        0, "LatencyMaxMsec":       28, "LatencyMedianMsec":        0},
            {"StartSector":       1283738169, "EndSector":       1339552872, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":       1339552872, "EndSector":       1395367575, "LatencyMinMsec":        0, "LatencyMaxMsec":       24, "LatencyMedianMsec":        0},
            {"StartSector":       1395367575, "EndSector":       1451182278, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":       1451182278, "EndSector":       1506996981, "LatencyMinMsec":        0, "LatencyMaxMsec":       31, "LatencyMedianMsec":        0},
            {"StartSector":       1506996981, "EndSector":       1562811684, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":       1562811684, "EndSector":       1618626387, "LatencyMinMsec":        0, "LatencyMaxMsec":       36, "LatencyMedianMsec":        0},
            {"StartSector":       1618626387, "EndSector":       1674441090, "LatencyMinMsec":        0, "LatencyMaxMsec":       23, "LatencyMedianMsec":        0},
            {"StartSector":       1674441090, "EndSector":       1730255793, "LatencyMinMsec":        0, "LatencyMaxMsec":       25, "LatencyMedianMsec":        0},
            {"StartSector":       1730255793, "EndSector":       1786070496, "LatencyMinMsec":        0, "LatencyMaxMsec":       32, "LatencyMedianMsec":        0},
            {"StartSector":       1786070496, "EndSector":       1841885199, "LatencyMinMsec":        0, "LatencyMaxMsec":       18, "LatencyMedianMsec":        0},
            {"StartSector":       1841885199, "EndSector":       1897699902, "LatencyMinMsec":        0, "LatencyMaxMsec":       68, "LatencyMedianMsec":        0},
            {"StartSector":       1897699902, "EndSector":       1953514605, "LatencyMinMsec":        0, "LatencyMaxMsec":       39, "LatencyMedianMsec":        0},
            {"StartSector":       1953514605, "EndSector":       2009329308, "LatencyMinMsec":        0, "LatencyMaxMsec":       32, "LatencyMedianMsec":        0},
            {"StartSector":       2009329308, "EndSector":       2065144011, "LatencyMinMsec":        0, "LatencyMaxMsec":       27, "LatencyMedianMsec":        0},
            {"StartSector":       2065144011, "EndSector":       2120958714, "LatencyMinMsec":        0, "LatencyMaxMsec":       33, "LatencyMedianMsec":        0},
            {"StartSector":       2120958714, "EndSector":       2176773417, "LatencyMinMsec":        0, "LatencyMaxMsec":       24, "LatencyMedianMsec":        0},
            {"StartSector":       2176773417, "EndSector":       2232588120, "LatencyMinMsec":        0, "LatencyMaxMsec":       33, "LatencyMedianMsec":        0},
            {"StartSector":       2232588120, "EndSector":       2288402823, "LatencyMinMsec":        0, "LatencyMaxMsec":       24, "LatencyMedianMsec":        0},
            {"StartSector":       2288402823, "EndSector":       2344217526, "LatencyMinMsec":        0, "LatencyMaxMsec":       33, "LatencyMedianMsec":        0},
            {"StartSector":       2344217526, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":      813, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0},
            {"StartSector":                0, "EndSector":                0, "LatencyMinMsec":        0, "LatencyMaxMsec":        0, "LatencyMedianMsec":        0}
        ],
        "Conclusion": "failed due to IO errors"
    }
}
smartctl -A /dev/sde
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.9.11-3-MANJARO] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
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       -       4858
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       14644
  5 Reallocated_Sector_Ct   0x0033   044   044   050    Pre-fail  Always   FAILING_NOW 15680
  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   068   068   000    Old_age   Always       -       13138
 10 Spin_Retry_Count        0x0033   253   100   030    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       10124
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       121
192 Power-Off_Retract_Count 0x0032   099   099   000    Old_age   Always       -       902
193 Load_Cycle_Count        0x0032   098   098   000    Old_age   Always       -       29868
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       25 (Min/Max 11/48)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       215
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       696
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
220 Disk_Shift              0x0002   100   100   000    Old_age   Always       -       0
222 Loaded_Hours            0x0032   077   077   000    Old_age   Always       -       9224
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       -       188
240 Head_Flying_Hours       0x0001   100   100   001    Pre-fail  Offline      -       0

SMART remaps the sectors automatically. If it failed to do so it means the disk is days away from dying.

Yea seems this external HD has had it’s time ohh well, i’ll run a last long offline test.

>  sudo smartctl -H /dev/sde
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.9.11-3-MANJARO] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Status not supported: Incomplete response, ATA output registers missing
SMART overall-health self-assessment test result: FAILED!
Drive failure expected in less than 24 hours. SAVE ALL DATA.
Warning: This result is based on an Attribute check.
Failed Attributes:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   044   044   050    Pre-fail  Always   FAILING_NOW 15680

>  sudo smartctl --test=long /dev/sde
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.9.11-3-MANJARO] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 469 minutes for test to complete.
Test will complete after Tue Dec 15 19:26:42 2020 +03
Use smartctl -X to abort test.

The way SMART work is that modern disks have spare sector pool where a bunch of ‘good’ sectors are kept. With SMART when it finds a (logical) bad sector it will replace it with a good sector from this pool. When all 'good’sectors are used from out of this pool it will stop this progress on any logical sector even if there is stil room in the G-list. In this case you could try other ways to repair those Logical bad sectors.

When this happens you can try to use another solution like diskscan, zero-filling the drive on the unmounted drive (with sudo dd if=/dev/zero of=/dev/<harddrive> bs=<blocksize> ) or even try a low level format as last resolve (not recommended) .

Bad sectors can indicate a dying disk, but there are 2 kinds of bad sectors. Logical and physical… The first can be repaired (most of the time) and the later will be remapped. Even when there are multiple physical bad-sectors a drive can run for months, years even as long there is a way to remap them. Just keep an eye on the disk and if physical bad-sectors keep popping up replace it asap.

Well because this external disk seems to have died anyhow, how does one do the low-level format with these new drive types?
I remember way back in time we had ways to do so with the ancient IDE HD’s but i forgot how plus these drives are not IDE…
Could be interesting to try :wink: