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:
As for the Disks SMART Data & Tests
, the menu is grayed out:
badblocks
command. If youman badblocks
you'll see a note that it shouldn't be used directly, and gives alternate instructions. I just added the correct way to bad block as an answer in that link. Edit your question and show megrep -i FPDMA /var/log/syslog*
, and show me a complete screenshot of theDisks
SMART Data & Tests data window, which is scrollable, and may require two screenshots. – heynnema Apr 26 '21 at 16:05badblocks
instead of the propere2fsck
command, you may have overwritten the original bad block table on disk, and lost all prior knowledge of bad blocks that existed at manufacture time, or any prior bad blocking. – heynnema Apr 26 '21 at 16:12Current_Pending_Sector
) but I still don't understand whybadblock
didn't add the bad blocks it found to theReallocated_Sector_Ct
– MagTun Apr 26 '21 at 19:17Disks
app isn't finding that your disk has SMART. Installgsmartcontrol
, which will also installsmartmontools
, and then run one/both to see if they can detect SMART data. – heynnema Apr 26 '21 at 20:00gsmartcontrol
but I don't understand which command I should do to see if they can detect SMART data on my HDD (https://gsmartcontrol.sourceforge.io/home/index.php/Documentation doesn't explain it clearly). I have already runsudo smartctl --all /dev/sdd
so I am not sure which command you mean. – MagTun Apr 30 '21 at 11:13sudo smartctl --all /dev/sdd
I did before and after running thesudo badblocks -svvn -c 262144 /dev/sdd
command: https://pastebin.com/mjGP3T8U and https://pastebin.com/g6SpJQq4 – MagTun Apr 30 '21 at 11:20lsusb
. Start comments to me with @heynnema or I may miss them. – heynnema Apr 30 '21 at 13:39lsusb
in my question but this is the most relevant line:Bus 001 Device 007: ID 1058:0730 Western Digital Technologies, Inc. My Passport Essential (WDBACY)
– MagTun Apr 30 '21 at 15:45