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?


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 


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.