0

Problem:

Installed Archlinux on a USB pen-drive (ext4) about a month ago.

Everything was working fine up until recently. After a while I would not be able to execute commands (except bash built-ins).
$ ls
-bash: /usr/bin/ls: Input/output error
$ ls
-bash: ls: command not found
$ bash
Bus error

When this happens a reboot usually "fixes" the problem temporarily. Everything would be working again but these errors would come up eventually again. When they do the system becomes unusable and I have to reboot again. This makes it difficult to troubleshoot the issue.

Tried:

  • First backing up all important data
  • Booting into a "live usb" and doing fsck on the partition in question
  • Freeing up some disk space on the partition in question
  • Plugging in the USB pen-drive to a different USB port and making sure it's plugged in correctly
  • Staying logged in as root to try to peek echo "$(</proc/kmsg)" - doesn't work
  • Running dmesg -n err did produce errors in the VT console eventually but forgot to write them down. Will add them to this post if I see them again and if relevant. I remember it mentioning the journal.

Ideas:

I remember having similar problems years back when installing Linux on a USB drive. I remember it having something to do with disk caching and the lifespan of the device. Of course this may be about something different.

I was considering doing `dd if=/dev/sdd of=/dev/null` to see if I get any errors. Haven't done that yet but will and will post results - if you think it's relevant.

What I'd like ideally is to:
  • Find out what exactly the problem is
  • See if I can still save this storage medium
  • Prevent this from happening again in the future with another USB drive.
  • Check if there's anything I could do to not have to reboot

Let me know if there's anything else I should try and what the most likely explanation could be for what is happening.

Edit:
Don't know how relevant this is but I noticed with iostat that something is constantly trying to write to the drive every few seconds. Looking into this currently. Apparently it's to do with /sys/module/workqueue/parameters/power_efficient

6114 be/4 root        0.00 B/s    0.00 B/s  0.00 % 69.00 % [kworker/u8:6+events_freezable_power_]
7945 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.11 % [kworker/u8:5-events_freezable_power_]
7207 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.01 % [kworker/u8:1-events_freezable_power_]
  • I think you're on the right path. I think you should try the dd command. You may also be able to get the USB drive to execute a self-test using smartctl: smartmontools.org – Emmanuel Rosa Jul 5 at 12:41
  • Check dmesg output when errors start coming. Most USB pen drives are incompatible with smartctl. – Artem S. Tashkinov Jul 5 at 12:57
0

Input/output errors are always hardware. You may try different USB ports but I assume the stick to be the problem. Maybe after some time when it has got warm.

I suggest to throw away the stick.

| improve this answer | |

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.