pveurshout
December 31st, 2014, 01:17 PM
I downloaded the Ubuntu 14.04.1 .iso image and used dd to 'burn' it to a USB flash drive (which I'll refer to as sdX).
dd if=/path/to/ubuntu-14.04.1-desktop-amd64.iso of=/dev/sdX
Afterwards, I noticed that this had created two partitions on the flash drive: sdX1 and sdX2. sdX1 is mountable and contains the files that the iso image contains. I wanted to know what sdX2 was for, and found a possible explanation for this in the Community Help Wiki:
2. There may be a bug during the formatting which will cause two partitions to appear when booting from the USB flash drive. Try selecting each of them and one should work. If not, restart the computer and try booting from the USB flash drive again.
But this didn't sound like a satisfactory answer (after all, I didn't use the Startup Disk Creator, so a bug there wouldn't cause this for me), so I dug a little deeper. I noticed that sdX1 was exactly the same size as the original .iso image and sdX2 was a few MB in size. So I computed a checksum of /dev/sdX and verified it against the .iso image. Unsurprisingly, these did not match because the flash drive is much larger than the 981.0 MB Ubuntu image, so the checksum of the former is calculated over a lot of zeroes in addition to the dd'd (:)) image. What did struck me as a surprise, however, was that the sha256-checksums of the .iso image and the contents of /dev/sdX1 matched exactly. But...the .iso image did not just create sdX1, it also created sdX2 as well as a partition table for the device sdX which holds the information of the existence of sdX1 and sdX2.
I've been trying to figure out what is going on, but the following still confuses me greatly: how can dd'ing an image (to sdX, not sdX1!) have created a partition table on sdX with two partitions in it, where one of the partitions contained by it (sdX1) is an exact copy of the original image? In other words: if the information contained in the .iso image makes up the contents of sdX1, where did the information for sdX2 and a partition table for sdX come from in the first place?
I'd be very happy if someone could shed some light on this. After all, it's never a bad thing to start the new year as a slightly more knowledgeable person! :-D
dd if=/path/to/ubuntu-14.04.1-desktop-amd64.iso of=/dev/sdX
Afterwards, I noticed that this had created two partitions on the flash drive: sdX1 and sdX2. sdX1 is mountable and contains the files that the iso image contains. I wanted to know what sdX2 was for, and found a possible explanation for this in the Community Help Wiki:
2. There may be a bug during the formatting which will cause two partitions to appear when booting from the USB flash drive. Try selecting each of them and one should work. If not, restart the computer and try booting from the USB flash drive again.
But this didn't sound like a satisfactory answer (after all, I didn't use the Startup Disk Creator, so a bug there wouldn't cause this for me), so I dug a little deeper. I noticed that sdX1 was exactly the same size as the original .iso image and sdX2 was a few MB in size. So I computed a checksum of /dev/sdX and verified it against the .iso image. Unsurprisingly, these did not match because the flash drive is much larger than the 981.0 MB Ubuntu image, so the checksum of the former is calculated over a lot of zeroes in addition to the dd'd (:)) image. What did struck me as a surprise, however, was that the sha256-checksums of the .iso image and the contents of /dev/sdX1 matched exactly. But...the .iso image did not just create sdX1, it also created sdX2 as well as a partition table for the device sdX which holds the information of the existence of sdX1 and sdX2.
I've been trying to figure out what is going on, but the following still confuses me greatly: how can dd'ing an image (to sdX, not sdX1!) have created a partition table on sdX with two partitions in it, where one of the partitions contained by it (sdX1) is an exact copy of the original image? In other words: if the information contained in the .iso image makes up the contents of sdX1, where did the information for sdX2 and a partition table for sdX come from in the first place?
I'd be very happy if someone could shed some light on this. After all, it's never a bad thing to start the new year as a slightly more knowledgeable person! :-D