sh: echo: I/O error on pm-suspend Ubuntu 14.04

Solution 1:

Okay, I managed to finally find the culprit for this issue, but first, a little background: I neglected to mention that my laptop has a hybrid HDD by default. It's a regular 500GB mechanical HDD supplemented by a 24GB SSD, which used to be used by Windows 8 for hibernation and probably cache stuff. I used the SSD to stash my root partition before in OpenSUSE until it eventually died (I/O errors all the way down), prompting me to move the partition to the HDD whilst also installing Ubuntu 14.04.

Long story short: The I/O errors I'm getting at standby were somehow caused by my faulty SSD.

What I did to fix this was to remove the block device of the SSD from /dev. In my case, my SSD is always shown as /dev/sdb, so I entered the following in a terminal as root (solution courtesy of this helpful article):

# echo 1 > /sys/block/sdb/device/delete

Be sure to replace 'sdb' with the device you think is faulty. I only have it as /dev/sdb because as I've mentioned before, my SSD always gets that first.

The "deletion" gets reset on every fresh boot, so what I did was add that line to my /etc/rc.local, which ensures that /dev/sdb will get deleted at boot. This might affect booting with removable drives inserted on your machine, but in my case the SSD is physically part of the HDD anyway so it automatically gets the /dev/sdb block device after the HDD gets /dev/sda.

Solution 2:

Same problem here: sh: echo: I/O error in /var/log/pm-suspend.log in 14.04 (or rather Mint 17).

Different answer. I played with 'su pm-hibernate' instead, it also fails with nice in-your-face warnings like "Freezing of tasks failed after...". Then doing "dmesg | less" and searching with "/Freezing" reveal a stack trace involving "fuse". The reason: a open network mount in Files/Nautilus/Nemo. The fix: unmount in the GUI. Then, use /etc/fstab entry instead to mount network drive. That's far more robust.


[122274.535148] Freezing user space processes ... 
[122294.540137] Freezing of tasks failed after 20.009 seconds (1 tasks refusing to freeze, wq_busy=0):
[122294.540167] bash            D ffff88022ec74480     0  6868   6825 0x00000004
[122294.540178]  ffff88021e6ddb50 0000000000000082 ffff8800c8a9e000 ffff88021e6ddfd8
[122294.540180]  0000000000014480 0000000000014480 ffff8800c8a9e000 ffff88021f7c8660
[122294.540181]  ffff880034813800 ffff88021e6ddb78 ffff88021f7c8740 ffff88021f7c8660
[122294.540183] Call Trace:
[122294.540188]  [<ffffffff81723129>] schedule+0x29/0x70
[122294.540192]  [<ffffffff812aaa95>] __fuse_request_send+0x115/0x280
[122294.540195]  [<ffffffff810aafd0>] ? prepare_to_wait_event+0x100/0x100
[122294.540197]  [<ffffffff812aac12>] fuse_request_send+0x12/0x20

Solution 3:

The most likely cause of this issue (for people reading this) is leaving a USB stick or SD card connected in the laptop (not necessarily mounted). Unmount if it's mounted (the I/O error means that is unlikely). Once you're happy it's not mounted, remove it and try pm-suspend again.

A big thank-you to @rey-balgs for sharing his research (and saving me a lot of grief).