How can I check if a bootloader (i.e. grub2) is installed on a block device (e.g. CF card)? I know I can mount the device and peek some files but how can I be sure the bootloader is installed without having to test it (try to boot it on some device) Thanks in advance
This can be achieved quite easily by using the dd(1) command and copying the first 512 bytes from a given medium. Like:
Then check if that file contains the hex signature ``0xAA55'' (don't forget to account for endianess of the machine). See [1] for more details.
[1]http://mirror.href.com/thestarman/asm/mbr/GRUB.htm