The cardinfo script is for a sdcard connected directly to the microcontroller side. On the Yun the sdcard is connected to the linino side.
http://arduino.cc/en/Reference/YunFileIOConstructor gives info on how to use the sdcard from the microcontroller part of the Yun.