Sunday, November 30, 2014

bootable media - Write iso files to usb sticks with dd


So far I have always succeeded at creating bootable USB, until yesterday. I tried creating a bootable USB for Arch Linux, Chakra OS, and Ubuntu this way:


Locate my USB stick:


lsblk # My drive is in /dev/sdb1

Formatting the USB stick:


sudo umount /dev/sdb1
sudo mkdosfs -F 32 /dev/sdb1

Copying the ISO image:


sudo dd if=archlinux-2014.10.01-dual.iso of=/dev/sdb1 conv=notrunc,noerror bs=4M | md5sum

Problem starts here: the checksum returned by md5sum is different from the original ISO image.
Then when I boot on the newly created bootable USB, I get a message telling there's a missing operating system".


I was told formatting the USB prior to writing the ISO file was non-sense, and that I should use Unetbootin. This tool works but even then, I need to format the USB sticks, otherwise Unetbootin won't detect it. I would like to know how to write ISO files to USB sticks, using dd please. I am confused since all tutorials I can find on the web use dd without any problem.


Answer



You do not need partition table on USB stick. You can simply copy ISO image to the raw device, like


dd if=image.iso of=/dev/sdb

Most BIOS'es will recognize it.


P.S. Why do you expect md5sum of dd output to match the sum of iso image??? dd simply prints the summary of the transfer, and this is what your md5sum will get from the pipe.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...