marsadm: make device detection more robust