Your dd command is good. I have used the same many times over.
You do not need to flush or unmount anything, because as you already know, you are not writing to a mounted filesystem. You are writing to a raw device.
You do not have to do any kind of "save" with dd. results are immediate after the command completes.
Originally Posted by daf1kpp
Hexdump result (file mbr_check_binaryFile) is fine. But dunno what after that is going wrong because when I want to boot with this flash drive it seems that no changes were done. ... All is lost and first sector has old data.
This is where I'm confused. I think you're saying that your did the write and then verified the data with a subsequent read - proving the initial write was successful. Then you try to reboot with the newly written device, which fails. Then you re-read the MBR from the device and it is now different than it was when you did your previous verification. Is that correct? You are saying that the MBR contained XXX data before you attempted a reboot, and then after the reboot attempt, the MBR contained YYY (different) data?
p.s. - Booting from a flash drive can sometimes require you to invoke black magic. It is not a guarranteed doable thing on every system. However, despite this, I would not expect your thumbdrives MBR to change on a reboot attempt, regardless if that reboot failed or succeeded. Maybe do you have some kind of new-fangled, funky, special non-standard thumbdrive? Some thumbdrives come with a bunch of crap on them. I personally haven't run into one with a "frozen" MBR, but who knows, some manufacture could have done something like that. I haven't bought a new thumbdrive for many years. Manufacturers seem to always be farting around with them trying to make them more than just a storage device. Adding encryption, adding built-in apps, etc.