I/O error when formatting new HDD

Hello all, I inserted a new 2TB HDD into my system with the intention of using 1500GB of it solely for Zorin (mostly for Steam games). I made it a GPT and used fdisk to create the 1.5T partition, so far, so good. However, when running sudo mkfs.ext4 /dev/sdc1, it failed after a long time with the error "Input/output error while writing out and closing file system" at the step "Writing superblocks and filesystem accounting information".

Running sudo dmesg -l crit,err (which I found somewhere else in response to someone getting a hanging format) I get several such lines...


ETA: Not sure if it's useful, but here are the results of sudo dmesg | grep sdc (uploading to Google Drive as the forum does not allow .txt attachments).

Any idea what might be up with the drive? It's brand new, so unless I'm truly unlucky, it should not have any disk errors yet.
Any way to diagnose it further?

Are you performing this while booted into the LiveUSB with the sdc1 drive unmounted?

Prior to running the above, you can disable the drive's write-protect with
sudo hdparm -r0 /dev/sdc1
Prior to formatting, run on that drive:
sudo dd if=/dev/zero of=/dev/XdY count=16

Lastly, though I often encourage using the terminal, you may have an easier time of it booting into the LiveUSB, then running Gparted to format the drive.

1 Like

This won't be the system drive, that's /dev/sdb2. Would running the formatter from LiveUSB instead of running it from the installed OS still make sense?

I didn't mount sdc1, how can I ensure it's not mounted?

I have removed the file table and recreated it, now I'm running mkfs.ext4 again... then I might try with MBR instead of GPT to see if it makes a difference. And I will definitely try your suggestions as well. That dd thing writes the disk full of 0s, right? Does that take long? Or does count=16 mean it only writes 16 bits?

I would, just for safety. When you boot normally, with the drive connected, it may automount.

Yes, it wipes the drive and like many of the dd commands, can be a dangerous command.
That's two terabytes of space... I wouldn't expect it to be phenomenally quick. But it shouldn't take very long, either. You can cancel the operation with ctrl+c if you feel it is taking too long.
I am not sure how long it would take, but trust your patience... and trust your suspicion if you feel it has gone on for too long.

1 Like

Well, this run of mkfs has been running for almost two hours now... no error so far but that's not normal for a 1.5T partition, is it? Should I let it keep running?

(BTW, I did try with Gparted (albeit not from LiveUSB) before, I stopped it because I felt it took too long and switched to terminal so that I could at least see progress in a little more detail. But if this run fails or I have to stop it, I will try running that again, this time, as you suggested, from LiveUSB.)
EDIT: Now it ended with the same error, so on to the next steps.

Two hours is a long time... I would have given in to impatience by then, too.

1 Like

I tried with LiveUSB and gparted -- I did not wait until the error, I stopped it because, again, it was taking a very long time. It started the superblocks etc. part, went to something like 3810/12000, then went blank and did not proceed anymore, even after ~30 minutes.

Upon further research, it seems to be something at the beginning of the disk. When creating an exFAT partition in Windows on the remaining space (left over after the not formatted but created Linux partition, at the end of the disk), it was very fast. When removing the Linux partition and trying to create an exFAT at the start, still in Windows, it got stuck.
When I have more time to experiment with this (probably Friday morning), I will try creating the partition not from the first available block and see if it goes better.
Just to make sure, I ran sudo smartctl --all /dev/sdc here and Crystal Disk Info in Windows, they report the drive to be healthy, so I really have no idea what this might be.

Welp, thanks for all the help, but now it's solved; looks like the SATA cable was loose. Seeing all the IO errors but still seeing no SMART warnings, I unplugged the SATA and plugged it back, now the new partition was created in a flash.

2 Likes