Core issue
When you issue the show bootflash: all command in order to display information about the bootflash: file system, it only shows part of the boot flash information and at the end, the Error getting file system status (Invalid file header magic number)error message appears.
This is due to bootflash corruption. This happens sometimes when a crashinfo file written due to crash into bootflash and later on a file is copied after this crashinfo file.
In some scenarios, when you issue the dir bootflash: command, you receive this error message:
%Error calling getdents for bootflash:/ (Invalid file header magic number)
No space information available
Resolution
In order to overcome this error message, the bootflash needs to be formatted and required files needs to be copied again.
This can be done by the format bootflash: command. Then copy files from the disk in order to recover the Flash Memory.
Note: Always be careful while you format the Flash device. If the Multilayer Switch Feature Card (MSFC) is reloaded before a new image is downloaded, you must recover the MSFC with Xmodem.