I get

invalid magic number

When booting to CentOS bootable USB. The way I made the USB (on Ubuntu 17) is:

  1. Download CentOS-7-x86_64-DVD-1708.iso
  2. dd if=CentOS-7-x86_64-DVD-1708.iso of=/dev/sdc status=progress
  3. Booted to the boot menu, chose the USB drive, then chose Install Centos 7

How do I do this?

2 Answers 2


Your command seems okay, just try few things, double check device name, make sure device is not mounted while writing and at the end try running sync command.

 dd if=CentOS-7-x86_64-DVD-1708.iso of=/dev/sdc ; sync 

  • +1 for reminding that all partitiions on the target drive should be unmounted and of sync to flush the buffers before unplugging .
    – sudodus
    Oct 26, 2019 at 6:40

I was chasing this same error and it turned out that the USB flash drive I was using was bad. I found this out by running an immediate verify after creating it. Here's an example of what a successful verify would look like:

 # sha256sum CentOS-7-x86_64-DVD-1804.iso
 506e4e06abf778c3435b4e5745df13e79ebfc86565d7ea1e128067ef6b5a6345  CentOS-7-x86_64-DVD-1804.iso

 # dd if=CentOS-7-x86_64-DVD-1804.iso bs=1024k of=/dev/sdz oflag=sync
 4263+0 records in
 4263+0 records out
 4470079488 bytes (4.5 GB) copied, 1022.82 s, 4.37 MB/s

 # dd if=/dev/sdz bs=1024k count=4263 | sha256sum
 506e4e06abf778c3435b4e5745df13e79ebfc86565d7ea1e128067ef6b5a6345  -

Since the USB device could be slightly larger than the original ISO, it's important to limit the amount of data read to the same data that was written. ("count=")

On my broken USB, after a couple hundred blocks I got an I/O error on read even though it was just written without error.

  • +1 for the way to check with dd using count and piping to the checksum program.
    – sudodus
    Oct 26, 2019 at 6:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .