0

I use dd to "burn" an ISO file to USB stick:

dd bs=4M if=/mnt/media/ISO/Fedora-Workstation-Live-x86_64-31-1.9.iso   of=/dev/sdd conv=fdatasync  status=progress

Now I can see several partitions has been created:

sdd      8:48   1   1.9G  0 disk 
├─sdd1   8:49   1   1.8G  0 part /run/media/alex/Fedora-WS-Live-31-1-9
├─sdd2   8:50   1  10.6M  0 part 
└─sdd3   8:51   1  22.2M  0 part 

Why only sdd1 matches the ISO checksum, not an entire drive? I checked files on other partitions, they contain this ISO related files..

Alex
  • 103
  • 3

3 Answers3

0

It's not clear to me what you are trying to accomplish.

You appear to be writing a file to a raw device. Unless the file is a disk image appropriate for that kind of device, this makes no sense to me.

The Fedora-Live ISO is a SquashFS file system, not a binary or raw image suitable for dumping to a raw device.

Since this is a Fedora-Live ISO, I'm guessing that you want to create a bootable USB vice the bootable DvD you'd get from simply burning the ISO to a DVD. There are standard tools for doing that such as: Unetbootin

          ****** edit *****

OK, I pulled down the ISO file and did an fdisk of the ISO.

fdisk Fedora-Workstation-Live-x86_64-31-1.9.iso

Command (m for help): p

Disk Fedora-Workstation-Live-x86_64-31-1.9.iso: 1.8 GiB, 1929379840 bytes, 3768320 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x6f869649

Device Boot Start End Sectors Size Id Type

Fedora-Workstation-Live-x86_64-31-1.9.iso1 * 0 3768319 3768320 1.8G 0 Empty

Fedora-Workstation-Live-x86_64-31-1.9.iso2 172 21887 21716 10.6M ef EFI (FAT-12/16/32)

Fedora-Workstation-Live-x86_64-31-1.9.iso3 888 67407 45520 22.2M 0 Empty

The ISO defines 3 partitions of which 1 & 3 are Type 0 Empty.

user10216038
  • 7,552
  • 2
  • 16
  • 19
  • I am comparing the checksums of ISO and /dev/sdd, and they don't match, that's the issue. However /dev/sdd1 does match, which is surprising to me. About whether this method of creating a bootable device works, it'll test and let you know, thanks – Alex Dec 08 '19 at 21:26
  • This is useful, thank you. If they are empty, why do I see some EFI files when I mount them? – Alex Dec 10 '19 at 16:50
  • They are not _empty_ they are **Partition Type 0 Empty**. Partition type 6 is _FAT16_ and type 7 is HPFS/NTFS/exFAT. I don't know why it's called "Empty". – user10216038 Dec 11 '19 at 19:09
0

DD copies the image byte by byte onto the USB drive, It creates an exact clone.It creates one partition that holds the image, that's why only the partition that contains the image file has a matching checksum. I'm not entirely sure about the particulars of Fedora but, In typical Linux Distributions when DD command is used to create a bootable USB drive, the two partitions are:

  1. The partition that contains the Image (checksum match)
  2. The EFI partition (contains file required to boot your os, link=https://en.wikipedia.org/wiki/EFI_system_partition).

The remaining space on the drive is left as Unallocated free space. If you provide more details about the files in the other partitions, I might be able to give a better answer

Gaurav J
  • 1
  • 1
  • okay thanks for the input, but what about the nest two partitions, where they came from, why contain Fefora-31 related files? – Alex Dec 09 '19 at 11:54
0

Unless /dev/sdd is exactly the same size of the ISO file (which is unlikely), then /dev/sdd will contain unallocated empty spaces which contains either old deleted data or zeros. Even if they contain zeros, they will still affect the checksum.

You may have to use head -c <number of bytes> /dev/sdd when reading from /dev/sdd to remove the padding at the end of the device when calculating its checksum.

Lie Ryan
  • 31,089
  • 6
  • 68
  • 93
  • This is also useful, thank you, at first they didn't match, maybe I mounted as `rw` and something changed, I ran dd again, and now the checksum match, however it's still not clear why sdd1 matches, if there are some EFI files on "empty" partitions... – Alex Dec 10 '19 at 17:00