2

My HD had a few corrupted files so I wanted to check all the sectors and have the HD controllers mark the failing one.

Following the advices from this answer, I have run a badblocks on my external HD. From the answer, this command force checking of all sectors [...] If you have fully processed your disk this way, the disk controller should have replaced all bad blocks by working ones and the reallocated count will be increased in the SMART log.

I run this command sudo badblocks -svvn -c 262144 /dev/sdd

The result is Pass completed, 103 bad blocks found. (103/0/0 errors)

I did a sudo smartctl --all /dev/sdd before and after the badblocks and there are a few difference but not in the Reallocated_Sector_Ct even though badblocks found 103 read errors. After badblocks I still get the same output as before it :

  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always    -       0

The difference are only:
1- between the Raw_Read_Error_Rate:

Before badblocks:
    1 Raw_Read_Error_Rate   0x002f   196   196   051    Pre-fail  Always    -       429
After badblocks:
    1 Raw_Read_Error_Rate   0x002f   191   189   051    Pre-fail  Always    -       1221

2- between the Current_Pending_Sector : but here, the raw value increased after badblocks which doesn't makes sense to me as Pending are sectors which might be reallocated in case the next write fails. If bad sectors were found, the number should have decrease... or am I missing something?

Before badblocks:
    197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always    -       16
After badblocks:
    197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always    -       24

My main question is: Is the disk controller of my HD now aware of the sectors that are bad and won't used them anymore or did the badblocks simply informed me without having any effect on the way my HD will work in the future?


Edit3:

ubuntu@ubuntu:~$ sudo e2fsck -fccky /dev/sdd
e2fsck 1.45.5 (07-Jan-2020)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdd

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>

Found a dos partition table in /dev/sdd

Edit 2:

ubuntu@ubuntu:~$ lsusb
Bus 002 Device 004: ID 0bda:0138 Realtek Semiconductor Corp. RTS5138 Card Reader Controller
Bus 002 Device 003: ID 13fe:3123 Kingston Technology Company Inc. Verbatim STORE N GO 4GB
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0c45:6473 Microdia
Bus 001 Device 006: ID 0cf3:e004 Qualcomm Atheros Communications
Bus 001 Device 003: ID 04f2:0976 Chicony Electronics Co., Ltd
Bus 001 Device 007: ID 1058:0730 Western Digital Technologies, Inc. My Passport Essential (WDBACY)
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Edit: I am not sure how to do the grep -i FPDMA /var/log/syslog* and couldn't find any info on the web so I simply paste the command in a terminal but nothing happend: enter image description here

As for the Disks SMART Data & Tests, the menu is grayed out:

enter image description here

MagTun
  • 155

1 Answers1

3

WDC WD5000BMVW-11AMCS0

First we disable UAS for this WDC drive...

# drop this into /etc/modprobe.d/disable_uas.conf
# -rw-r--r--   1 root root  500 Apr 30 06:59 disable-uas.conf
#
# sources:
# https://unix.stackexchange.com/questions/525290/usb-hdd-not-found
# https://unix.stackexchange.com/questions/239782/connection-problem-with-usb3-external-storage-on-linux-uas-driver-problem
#
# examples:
# options usb-storage quirks=059f:105e:u 
# options usb-storage quirks=059f:105f:u,059f:105e:u,174c:1351:u
#
# do these commands:
# sudo update-initramfs -u
# reboot
#
# WDC WD5000BMVW-11AMCS0 drive
# Bus 001 Device 007: ID 1058:0730 Western Digital Technologies, Inc. My Passport Essential (WDBACY)
options usb-storage quirks=1058:0730:u

Bad Block

Then we bad block using the recommended method...

Note: do NOT abort a bad block scan!

Note: do NOT bad block a SSD

Note: backup your important files FIRST!

Note: this will take many hours

Note: you may have a pending HDD failure

Boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode.

In terminal...

sudo fdisk -l # identify all "Linux Filesystem" partitions

sudo e2fsck -fcky /dev/sdXX # read-only test

or

sudo e2fsck -fccky /dev/sdXX # non-destructive read/write test (recommended)

The -k is important, because it saves the previous bad block table, and adds any new bad blocks to that table. Without -k, you loose all of the prior bad block information.

The -fccky parameter...

   -f    Force checking even if the file system seems clean.

-c This option causes e2fsck to use badblocks(8) program to do a read-only scan of the device in order to find any bad blocks. If any bad blocks are found, they are added to the bad block inode to prevent them from being allocated to a file or direc‐ tory. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test.

-k When combined with the -c option, any existing bad blocks in the bad blocks list are preserved, and any new bad blocks found by running badblocks(8) will be added to the existing bad blocks list.

-y Assume an answer of `yes' to all questions; allows e2fsck to be used non-interactively. This option may not be specified at the same time as the -n or -p options.

heynnema
  • 73,649