Fix a bug in previous commit, strip out the log / cache devices
on a line-by-line basis now