Recently whenever I use my external USB hard drive on OpenBSD, I've been getting messages like "Input/Output error" whenever I copy files from it to my laptop. Also when I tried to mount it I get the error "No medium found" and "Device busy" or something like that. The drive is formatted in OpenBSD partition. Does this mean the drive is failing and I should back it up ASAP?

When I unplug it and re-plug it back into the USB port, it no longer sees the drive. In dmesg it doesn't show sd1 as being plugged in when usually it shows as being unplugged then plugged back in. I have to reboot to plug it in again.

Is the drive still mounted? If sd1a is still in the output of df(1) before issuing the newfs(8) command, this would explain the "device busy" message. newfs(8) will neither work, nor should it, on drives which are already mounted.

Quote:

When I unplug it and re-plug it back into the USB port, it no longer sees the drive.

Although USB devices can be attached & reattached at will, storage devices still have to be manually mounted/unmounted unless you have set up amd(8). Given the direction of discussion, I tend to doubt you have this in place.

No the drive is not mounted, because I cannot mount it. Like I said, when I reboot, plug in my drive, and try to "sudo mount /dev/sd1a /mnt/ext1/" I get a device busy error. df does not show the drive.

The firmware won't attach as a USB device if the internal ATA device is experiencing errors, usually.

However it is possible that the enclosure is having it's own problems, you might want to open it up and look for possible loose cables, maybe installing it locally in a machine and checking if any errors show up.

You might also want to attempt using it on another OS, if you happen to have any, as it could be a problem with OpenBSD's USB stack.. check out a snapshot as well.

Also, had newfs of succeeded.. your partition would have been wiped it out, you realize this, right?

When you plug the device in, your dmesg will get a few lines added to it. Your console will get blue/white kernel messages. Your /var/log/messages will have them too.

Read them. You might discover the device is sd2 instead of sd1. But until you take the time to see what device is actually attached, or not attached and why, all we can do is make conjecture.

This is the very reason I tend to run xconsole on my desktop:
when I plug in a USB printer or storage device, I can see what the /dev/ entry is and if the connection is reliable (I had a dodgy/damaged USB port which kept disconnecting/connecting).

When you plug the device in, your dmesg will get a few lines added to it. Your console will get blue/white kernel messages. Your /var/log/messages will have them too.

Read them. You might discover the device is sd2 instead of sd1. But until you take the time to see what device is actually attached, or not attached and why, all we can do is make conjecture.

Once you have confirmed you have a correctly attached device, you may then attempt to inspect it with fdisk(8) and disklabel(8).

The funny thing is my dmesg does not get lines added to it. A diff between my regular dmesg and a dmesg after I plug it in results in no differences. My console usually gets text with white text and blue background when I plug in an external hard drive, but this particular drive does not give me any sort of that message at all.