My Raspberry Pi 2 root filesystem is ext4 on a Samsung EVO+ 32 GB micro SD card. The system will run just fine for several days, but then, occasionally, if I do some io-heavy job like a pacman upgrade, the system seems to lose its root filesystem. Trying to run ls or dmesg results in a message like "ls: file not found", while any reads or writes on the root filesystem return an input/output error. Eventually, the Pi drops off the network. (I'm running this as a headless server, so I have to power cycle it.)
With my desktop machine and a USB 3.0 card reader, I actually reformatted this micro SD card and ran a full f3read/f3write cycle on it, which found no errors. However, several days later, I've encountered I/O errors again.
I haven't enabled any over-clocking, either of the CPU or of the micro SD card in the Pi config file. I'm using a Plugable USB hub's 5V power supply and a short USB power cable to the Pi 2. Running CPU-intensive tasks does not seem to trigger the filesystem errors.
I suspect that the card is bad, somehow, but is there any way to confirm that it's bad before replacing it? Is it possible that there is some kind of incompatibility with this type of card on the Pi 2?
Edit: I ran a filesystem check using a desktop machine, and it found some corruption.
$this->bbcode_second_pass_code('', '
$ fsck.ext4 -cfty -C 0 /dev/sdf2
e2fsck 1.43.1 (08-Jun-2016)
Checking for bad blocks (read-only test): done
/dev/sdf2: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found. Fix? yes
Inode 427222 was part of the orphaned inode list. FIXED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdf2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdf2: 91417/1913184 files (0.4% non-contiguous), 1155677/7650048 blocks
Memory used: 1972k/0k (104k/1869k), time: 1213.32/ 0.25/ 0.04
I/O read: 78MB, write: 1MB, rate: 0.06MB/s
')