In my case i was using unrar program to extract a file in ubuntu which might be under the hood using some kind of script that throws this error inappropriate ioctl for device.
Turns out i was running out of space, clearing space caused it to extract properly.