Input/Output Error during fdisk with Passport

12,578

Solution 1

fdisk works on disks, not partitions. On Linux, a disk is referred to as e.g. /dev/sdb, whereas the partitions on it are referred to as /dev/sdb1, /dev/sdb2 etc. Note that old-style (/dev/[hs]d?, /dev/[hs]d??) partition specifiers always end with a digit, whereas disk specifiers always end with a letter.

If you just format the disk (no bad blocks checking etc.), then a format time of a few seconds is not entirely unreasonable. All you did was write the initial file system metadata structures to disk, and while I don't have any exact numbers to cite, those are fairly small, and USB is pretty fast for writing such relatively small amounts of data. If you didn't get any errors, the format process probably did its thing.

The first thing you should do is run fdisk on the proper device. In your case, it sounds like that will be sudo fdisk /dev/sdb, but note that in some cases the device name can change with time. I recommend using one of the entries in /dev/disk/by-id instead, as those will not change. You can see what the disk shows up with there by running, immediately before you connect the disk:

diff <(ls /dev/disk/by-id) <(sleep 15; ls /dev/disk/by-id)

This will show the differences in directory content between the two executions of ls, which will be spaced 15 seconds apart thanks to the sleep invocation in the second input pipe. 15 seconds should give the kernel enough time to identify the disk and let udev create the appropriate device nodes. If it doesn't show any differences (empty output), unplug the disk and try it again increasing the delay. You will see both partition devices (ending with -part followed by a number and possibly @) and disk devices (without the -part part). If the file names do end with @, disregard that character; it's a ls output artefact.

Once you have partition(s) properly in place, you can make a file system on it/them. For example, sudo mkfs.ext4 -v /dev/disk/by-id/xxxxx-Passport-XXXXXXX-part1. The -v turns on extra output ("v" for verbose) which will give you an idea of whether the file system is created successfully.

After that, the disk should be perfectly usable.

Solution 2

First of all you need to make sure that Ubuntu see your new disk:

$ sudo fdisk -l

For example, your new disk might be /dev/sdb. Adjust as needed below.

Create partition(s) on it with fdisk:

$ sudo fdisk /dev/sdb

and then format all partitions with mkfs.

Here is example for first partition:

$ sudo mkfs.ext4 /dev/sdb1

See more details in this instruction and here

Share:
12,578

Related videos on Youtube

Hut8
Author by

Hut8

This site shows that I spend a lot of time acquiring useless internet points.

Updated on September 18, 2022

Comments

  • Hut8
    Hut8 over 1 year

    I bought a brand new WD Passport off Newegg. I couldn't copy anything to it (copy operations hung indefinitely then ended with IO error), so I tried reformatting it via the GUI. It now appears to be formatted as EXT4. Unfortunately, I still couldn't copy things to it. It formatted suspiciously fast (a few seconds; it's a 1TB drive). So I figured maybe it formatted wrong. So I tried:

    $ sudo fdisk /dev/sdb1   
    

    and got:

    fdisk: unable to read /dev/sdb1: Input/output error
    

    What do I do?! I'm in Ubuntu 12.10 in case it matters.

  • Hut8
    Hut8 almost 11 years
    I should have pointed out that I actually also tried /dev/sdb: fdisk: unable to read /dev/sdb: Input/output error