1

Topic: Input/output error during partition creation; can no longer see drive.

Hello, I use to have a 3TB external hard drive formatted in NTFS.

In GParted I attempted to change the drive into an ext4 drive but, in the process, ran into an input/output error.
First I deleted the drive's partitions, then created a new partition table (Device --> Create Partition Table.) Once the new partition table was created, I created a new ext4 partition.

Problem is while GParted was creating a new ext4 partition I got an "Input/output error during write on /dev/sdb" error. Now I can no longer even see the drive in GParted, or with these commands:

sudo fdisk -l

lsblk

The drive use to show itself in the command line with those commands, but not any more.

I suspect that this error may have been caused by the fact that I deleted a MS Windows partition on a GNU/Linux machine. After encountering this error, I read on the Ubuntu forums that messing around with Windows partitions on GNU/Linux can cause errors just like this one.

Is there any way to find the drive again, and fix it in GNU/Linux? Or should I just wait until I can get a windows machine to try to find the drive?

Thank you in advance for your time! smile

For reference, here's the GParted error message: https://0bin.net/paste/CgrzfZNJHRqzGRBl … auEPeixhtC


Edit: mfleetwo: Add text from linked gparted_details

GParted 0.25.0 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2
Create Primary Partition #1 (ext4, 2.73 TiB) on /dev/sdb  00:26:14    ( ERROR )
         
create empty partition  00:26:14    ( ERROR )
libparted messages    ( INFO )
         
Input/output error during write on /dev/sdb
Input/output error during write on /dev/sdb
Input/output error during write on /dev/sdb
Input/output error during write on /dev/sdb
Error fsyncing/closing /dev/sdb: Input/output error
Error opening /dev/sdb: No such file or directory
Error opening /dev/sdb: No such file or directory

========================================

2

Re: Input/output error during partition creation; can no longer see drive.

"Input/output error" messages are usually associated with hardware errors like bad sectors, faulting cables / connectors, perhaps a faulty power supply or even more severe problems like a dying hard disk.

So I would suggest to check the hardware: disconnect / reconnect power and data cables (SATA ? ) , and check the SMART data of the drive by the command

sudo smartctl -a /dev/sdb

(from a terminal window as root). It gives the eventual hardware issues with the drive as well as a "health" evaluation.


Another point is related to the partition table type: to make partitions bigger than 2 TiB (2.73 in your case) you have to use the GUID partition table (GPT) type, not the legacy msdos type. So, if you have made an msdos partition table, this could be an error source. As you have nothing on the drive, you can create a new partition table as GPT and try again.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

3 (edited by ilikecats 2019-02-22 05:01:40)

Re: Input/output error during partition creation; can no longer see drive.

Hello class413 thank you for your helpful reply!
Reconnecting the cable connectors helped! big_smile I can now see the drive with commands like "sudo fdisk -l" again. Sometimes I don't see the drive, and I see it after I reconnect the cable.
The external hard drive is connected to the computer by USB. The drive's disklabel type is gpt.

sudo smartctl -a /dev/sdb

Returned this:

smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-141-lowlatency] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: scsi error device will be ready soon

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

I'm not sure how to enable SMART. After I plug in the external hard drive correctly, gparted takes a long time to load the drives and then gives this error message as a pop-up: "Remote I/O error during write on /dev/sdb." I guess this is the drive's fault.

4

Re: Input/output error during partition creation; can no longer see drive.

USB is normally supported by smartctl under Linux (except perhaps some old kernels in the past).
I read that there was no error message while creating the new partition table. The error message appeared when trying to create the new partition. So, something happened between the two operations, or there is something wrong in the place where the new partition's sectors are located.

You can repeat the entire procedure, by creating a new GUID partition table, and next create a new partition for half of the entire disk space.

Another check is to run the command dmesg (as root) in the terminal.

sudo dmesg

You run the command, and after that you plug the external drive's USB connector. The terminal will display everything the system tries to do, including drive connection and any errors encountered. When the system recognizes and connects the drive, you'll see something related appearing in the terminal window. If you see the system trying again and again with no success, then probably something wrong happens with the device.

If the drive is connected, you can run the smartctl command (from another window). The dmesg terminal will continue to monitor the activity and give further messages.

In case the USB controller of the hard drive isn't compatible with smartctl , you can look for any special check tool provided by the drive's manufacturer. Western Digital, Seagate and other manufacturers offer such tools in their support web pages.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

5

Re: Input/output error during partition creation; can no longer see drive.

Another thing to try, just in case the drive isn't fully supported:
Use the '-T permissive' option according the error report.
The error message is:

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

Device's firmware isn't always fully compatible with the software. Norms often change, and manufacturers often implement their own (documented or not) commands. So, these "failures" appear.
The -T option means "tolerance" to command failures. The default setting is
-T normal

The available arguments for this option are:
conservative, normal, permissive, verypermissive
verypermissive will ignore any failure and try further.
permissive will ignore the first failure.
So, you can try

sudo smartctl -a -T permissive  /dev/sdb

or 

sudo smartctl -a -T verypermissive  /dev/sdb

to see if you can get anything more. Of course, you don't have to fully trust the output, however it can give some indication.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

6

Re: Input/output error during partition creation; can no longer see drive.

Hello sorry for the late reply.
I would just like to mark this thread as resolved since I found another satisfactory way to fix the drive for now. I'm not really sure how to mark posts as "resolved" yet though.

Thank you so much for your willingness to help me.

7

Re: Input/output error during partition creation; can no longer see drive.

You can edit your initial post to add [SOLVED] in the thread's title.

*** It is highly recommended to backup any important files before doing resize/move operations. ***