For a few months, I used the 3.5 inch WD Blue 500GB HDD and a SATA to USB docking station so that I can connect the HDD to my Raspberry Pi, to be used as a small version of NAS.

However, in some days, Raspberry Pi didn't boot into the system so I had to connect the HDD to my laptop (through the USB port, with the dock attached!)

It could be recognized as a 500GB drive in disk utility, but windows explorer couldn't detect anything because it was formatted as ext4 in the raspberry pi system. I tried to clean the drive and create a new partition using diskpart in cmd, and fortunately the command clean WORKED. However, when I entered the command create partition primary in diskpart, it showed the following error:

Diskpart has encountered an error: Data error (cycle redundancy check)

I did some Google search, and found that I can try using the chkdsk command in cmd to fix the drive physically. However, since the drive is not recognized as a volume with a drive letter, I couldn't do anything with that. (It should be in the format chkdsk /f (drive letter))

For the final step, I tried using the Low Level formatting tool from HDD GURU, but it showed an error again:

Disk is write-protected; could not format the sector xxxx...

And this kind of error continued to come up in the program each time the disk is read.

Any ideas to fix this drive? Is it perfectly damanged?


Based on your explanations it seems like you start to have a lot of bad sectors. And sector allocation already use all reserved sectors. What I can recommend is to try to save as much as possible information from the disk and forget about the disk.

Of course you can try to create partitions on such way they do not cover those bad sectors, but there is high probability the sectors where the partition table is stored are bad.

The best is to try to format the disk with vendor utility (if available) and check the map of bad sectors.

| improve this answer | |

I have not attempted this, but there is a possible procedure given the fact that you used the clean command in DISKPART.

Create a bootable Linux USB drive (I would recommend Ubuntu or Linux Mint if you have never used Linux before, as these are good distros for beginners). If you do know Linux commands, however, or have Linux, simply boot to your installation and skip this paragraph. To make a bootable USB drive, you would download an ISO file (these are usually quite large) from a Linux distribution's website. Then, download the utility Rufus from here. You will require admin permissions. Then, find an EMPTY USB drive (make sure it is empty as this will format the disk) and plug it in. Then, open Rufus, select "Disk or ISO image" and browse to your downloaded ISO image. Then, set your desired options and click on create (Stay with the defaults if you don't know what any of it will do). It will ask you about downloading SYSLINUX or GRUB files; download them. They are required to boot the USB. It also may ask you about ISO image or DD image. I would suggest using a DD image as it is faster and writes images with no errors. Then, wait for a little bit until it finishes writing the image. There is no turning back after confirming you will lose all data on the disk. After you are done, reboot the computer.

On reboot, the BIOS splash screen will come up, usually with the manufacturer logo. If you run Windows 8 or later, you have to disable fast boot from the OS. Get to the BIOS setup quickly with the designated button. The function button to enter the multiboot menu will usually be on the BIOS splash screen at the start of boot; if the screen disappears before you press the keys, quickly press Ctrl+Alt+Delete to start the boot process all over again; however, if you fail, then reboot the computer. Usually a good idea is to mash Esc, F1-F12, and Delete when the screen comes up. After you get to the multiboot menu, then select the USB. You will boot into a Linux distro soon enough.

After you are in the Linux distro (I will assume you are using Ubuntu 18.10 Cosmic Cuttlefish), open up a Terminal by right-clicking on the desktop and selecting Open Terminal. This will bring up a Bash shell similar to cmd in Windows, but with much more functionality and different commands.

From here, plug in your USB and wait for it to mount. Then, open up GParted. GParted is a partition editor similar to Disk Management in Windows, but again, with added functionality. Select your USB device (storage devices are in the form of /dev/sdxY, where dev means device and sd means storage device. x is a letter signifying a specific storage device, and Y is a partition number. Make sure to alter commands for your specific situation, or you can possibly wipe your existing Windows installation. I will assume your internal hard drive is /dev/sda, your USB for booting Ubuntu is /dev/sdb, and your malfunctioning hard drive is /dev/sdc. Access /dev/sdc from GParted after plugging it in (with USB) and unmount it. After it has finished unmounting, close GParted.

Go to your terminal again. In the terminal, type this:

sudo dd if=/dev/zero of=/dev/sdc bs=512 count=1

This uses the dd utility to write zeros to each sector of your hard drive no matter what the situation is. The last two parameters, bs and count, don't need to be specified but it's always a good idea to do it. This will take a lot of time as it is 500 GB of data. Make a cup of coffee, go shopping, do whatever, because dd won't display anything for a long time. And if you switch the parameters if and of or get a wrong letter in your output file, then the results will be disastrous. If you specified /dev/sda (your hard drive with Windows) instead of /dev/sdc (your malfunctioning hard drive), then you will wipe Windows and lose any trace of your installation. Be careful. dd is also nicknamed "data destroyer."

After this, open up GParted again and create an ext4 partition and a filesystem on your just-formatted drive. Then, reboot.

This should make your drive work again, though all the information will be wiped.

| improve this answer | |
  • Thank you for your long answer. I have Ubuntu 18.04.1 LTS installed in my laptop, and it recognizes my HDD successfully as /dev/sda along the partitions in my nvme ssd shown ad /dev/nvme0n1, nvme0n2, etc.. I tried using the command: mkfs ext4 /dev/sda, but it shows an input/output error during the process. – Felix Lee Dec 11 '18 at 1:27
  • The reason it shows an I/O error is because you can't make a filesystem on a whole drive. You need to mark a specific partition, which means you need a number at the end. If there is only one partition, it should be /dev/sda1. Try mkfs /dev/sdaX, where X is the partition number. You can check the partition number in GParted, as multiple partitions aren't necessarily always going to be in order. – user962725 Dec 11 '18 at 3:26

According to your description, you have a bad sector in the area of the disk that is used for storing the disk's partition table.

The disk's firmware is supposed in such a case to remap the bad sector to a healthy one, but this is not happening. This raises the question if all spare sectors of the disk have already been used, which means that your disk is failing.

If in Linux you can still access the disk, I would suggest to examine its S.M.A.R.T. data to look for danger signs. You may add the data to your post if you want our opinion.

In any case, you disk is in bad shape. If it's still under warranty, I would suggest returning it. If it's not, I would still recommend replacing it.

| improve this answer | |
  • I just ran a bad sector checking utility for the HDD, and it shows that there is only one bad sector at the beginning of the entire disk. Is that related to this problem? – Felix Lee May 6 '19 at 13:48

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.