Results 1 to 5 of 5

Thread: dd'ing the Ubuntu .iso image creates two partitions on USB startup disk

  1. #1
    Join Date
    Jun 2008
    Location
    The Netherlands
    Beans
    150
    Distro
    Ubuntu 10.10 Maverick Meerkat

    dd'ing the Ubuntu .iso image creates two partitions on USB startup disk

    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).

    Code:
    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:

    Quote Originally Posted by https://help.ubuntu.com/community/Installation/FromUSBStick
    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!

  2. #2
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: dd'ing the Ubuntu .iso image creates two partitions on USB startup disk

    When you use dd to copy the ISO image it is copying a DVD which does not have partitions like a standard drive.

    Do the partitions look like normal partitions?

    I have seem where very strange partition appear. I believe the random data that DVD has written into the first sector is close enough that then partition tools try to read that data as partitions.

    The info on partition table is just a few entries in the MBR.
    Info on MBR
    http://www.dewassoc.com/kbase/hard_d...oot_record.htm
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #3
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: dd'ing the Ubuntu .iso image creates two partitions on USB startup disk

    Does your USB drive boot properly? There is an iso9660 file system, which is read-only. Don't worry about the other things, as long as it works.

    But you should worry about using dd, nicknamed 'disk destroyer', because there are no safely checks. I made mkusb to wrap security around dd. See this link https://help.ubuntu.com/community/mkusb

  4. #4
    Join Date
    Oct 2014
    Beans
    32

    Re: dd'ing the Ubuntu .iso image creates two partitions on USB startup disk


  5. #5
    Join Date
    Jun 2008
    Location
    The Netherlands
    Beans
    150
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: dd'ing the Ubuntu .iso image creates two partitions on USB startup disk

    Quote Originally Posted by Ko_Char View Post
    Thanks, this clears it up! I'll mark the thread as solved.

    Quote Originally Posted by sudodus View Post
    Does your USB drive boot properly? There is an iso9660 file system, which is read-only. Don't worry about the other things, as long as it works.

    But you should worry about using dd, nicknamed 'disk destroyer', because there are no safely checks. I made mkusb to wrap security around dd. See this link https://help.ubuntu.com/community/mkusb
    Yeah, the install worked just fine I was just afraid that if something had gone wrong while creating the disk, it might've corrupted something that wouldn't have turned up until later (i.e., after a seemingly successful install). (And, also, I was curious .)

    Quote Originally Posted by oldfred View Post
    When you use dd to copy the ISO image it is copying a DVD which does not have partitions like a standard drive.

    Do the partitions look like normal partitions?

    I have seem where very strange partition appear. I believe the random data that DVD has written into the first sector is close enough that then partition tools try to read that data as partitions.

    The info on partition table is just a few entries in the MBR.
    Info on MBR
    http://www.dewassoc.com/kbase/hard_d...oot_record.htm
    Great and comprehensive read, thanks for the tip!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •