3

Updated TL;DR question:

I have 2 machines A and B; both are bootable from usb. When I create a stick with dd on machine A, the stick is neither booting machine A nor machine B nor any other bootable machine. When I create a stick from the very same iso with the very same usb stick on machine B with the very same dd-command, the stick is booting machine A and machine B and any other bootable machine. What's the secret ingredient that makes a "dd-stick" actually bootable?

(TL;DR ends here.)


First off: I'm totally aware of that question and its answer: Why does 'dd' not work for creating bootable USB? - however the problem pointed out in the accepted answer (and also in the other answers) is not the one I have.

Additional Disclaimer: that answer: https://superuser.com/a/1141527/180563 is not answering this question. It assumes that different ISOs with different configurations are used on different systems. As I pointed out in the comments, this is not the case. The only thing thats differnt in my tests is the machine where the Boot-Stick was made; the rest, i.e. the ISO and the machine that should be booted is the same. Please don't upvote that answer as it is not addressing the question that has been asked and is therefore a wrong answer.

I know that its a common issue to confuse the correct device to dd to and its often that the user confuses the first partition with the whole device.

But that is not my problem! I'm using the command in a right way, i.e. I'm not copying to the first partition but to the device, like:

dd if=linux.iso of=/dev/disk3 bs=1m

(1m is correct as I'm using bsd-dd which uses lower m rather than capital M, so please no comments on that. 1M would be not even a valid parameter for my version of dd)

/dev/disk3 is the device file of the stick and not of one of its partitions.

Now although, I'm doing everything according to the documentation and even in the same way as others I know are doing it (with success), my sticks aren't bootable. So my question goes like in the other one: What is the secret ingredient that makes a dd-copied stick bootable?

Update: The same iso-File I'm using will work on anothers person's pc. Update2: This is the iso-File i'm talking about: http://cdimage.ubuntu.com/kubuntu/releases/16.10/release/kubuntu-16.10-desktop-amd64.iso A friend was able to create a bootable stick with dd from it while I am not.

Kamil Maciorowski
  • 69,815
  • 22
  • 136
  • 202
ohcibi
  • 158
  • 11
  • notice that you mistagged it.. ddwrt is a router firmware, not to be confused with the dd command that you are asking about – barlop Nov 02 '16 at 11:15
  • Maybe your friend used `unetbootin` (or `rufus` if he used Windows). Is there a reason why you want to use `dd`? – AFH Nov 02 '16 at 12:06
  • My friend is of course doing the exact same thing as me. I don't want to *use* dd, I want to know what's keeping it from working, when I do it. – ohcibi Nov 02 '16 at 12:09
  • Maybe there's something weird with block sizes. Try omitting the `bs=1m` from the command. Also maybe there's something weird with BSD securelevel or similar that prevents writing to sector 0 of a device. Make sure you are running the command as root. – LawrenceC Nov 02 '16 at 12:55
  • @AndrewMorton i don't understand why people continue to assume that I have used different hardware or isos although I repeatedly and clearly said that I didn't. The ONLY difference is the machine that creates the bootable stick as I explained multiple times! – ohcibi Jun 13 '17 at 13:11
  • @AndrewMorton I already answered those questions. You do have enough information to eliminate the usb stick as a variable. You do have enough information to eliminate the machine that should be booted as a variable. You have that information because I repeatedly (see answer below and the updates in my question) reacted to those type of questions. – ohcibi Jun 13 '17 at 13:23
  • @AndrewMorton I updated my question and tried to avoid the misunderstandings. – ohcibi Jun 13 '17 at 13:28
  • 1
    @ohcibi Thanks, that makes it perfectly clear now. So... machine A must be faulty in some way. Either the USB hardware or the USB drivers. Do you happen to have a USB port card that you could put into machine A, just to test? Or perhaps use `dd` to copy the USB stick contents back to a file so that you can compare it to "linux.iso" with `diff`. – Andrew Morton Jun 13 '17 at 13:34
  • +1. The question is clear at last. "TL;DR" is a great idea. – Kamil Maciorowski Jun 13 '17 at 13:47
  • Some BIOSes may be set to intercept and disallow HDD MBR modification, I don't know if it's possible with USB drives. In general you should read from your USB the exact amount of bytes the image has – and compare. Also [make sure your image is not corrupted](http://cdimage.ubuntu.com/kubuntu/releases/16.10/release/MD5SUMS). – Kamil Maciorowski Jun 13 '17 at 14:08

1 Answers1

2

Usually the secret ingredient is isohybrid. .iso files are really CD images – they contain an ISO 9660 filesystem (hence the name), usually with El Torito extensions to make it bootable. That's however a bit different from how regular disks boot (be they internal or USB).

(For BIOS systems, regular disks are expected to have bootcode in their 0th sector – part of the MBR. While the CD boot process tries to emulate that in some ways, its initial bootcode is still stored elsewhere.)

So many Linux distributions use isohybrid to combine various different boot images and even different filesystems (BIOS, El Torito, and UEFI; ISO 9660 and FAT) into a single image that somehow still happens to work.

But if your image hasn't been built that way, then it will have only CD bootcode, not "disk" one.

Or the image might be a hybrid one, but it might only support BIOS while your system requires UEFI, or vice versa. Or you might be trying to boot it on something that's not x86.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966