0

I've noticed that the latest version of Rufus comes with a potentially useful extra option: Create a disk image of the selected device. However, in the resulting dialogue I get this:

enter image description here

Rufus seems to be calling a .vhd file a DD Image, despite my own research indicating that there are differences and that it wouldn't be possible to use dd to write a .vhd image to a disk without some prior conversion.

Is there a particular reason Rufus does this?

Can the .vhd file it outputs be used by dd to write the resulting image to a device without any prior conversion?

Hashim Aziz
  • 11,898
  • 35
  • 98
  • 166
  • They probably wanted to use HDD for "Hard Disk Drive Image", then realized people may have solid state drives, and wanted to cover both, so I'm betting it simply stands for "Disk Drive Image". – LawrenceC Oct 15 '18 at 19:41
  • 1
    Interestingly it looks like the "fixed hard disk image" version of the VHD format would work fine with `dd` - since the extra data is at the end of the hard drive data. `dd` would terminate with an error once it hits the end of the device but that would be OK since you don't want the extra data written anyway. Reference: https://en.wikipedia.org/wiki/VHD_(file_format) – LawrenceC Oct 15 '18 at 19:42

2 Answers2

4

Rufus developer here. This is because the save option is only for uncompressed VHD images, and uncompressed VHD images are just the same as DD images with an extra 512 byte footer added.

So, for all purposes, you can use DD to write the VHD image created by Rufus, and it will work just fine (with either the extra 512 byte footer being ignored as random data, if you use a larger sized disk, or being dropped, if using same exact same size disk).

Ergo, what Rufus creates when you click the save button is essentially a DD image since it can very much be used as such.

PS: For those who wonder why Rufus doesn't compress the VHD images it saves this is primarily due to the compression algorithm being used by Microsoft being very poor (IMO) and therefore not worth spending time implementing support for. This is also part of the reason why save as DD image is only available when clicking the advanced options.

Akeo
  • 6,461
  • 4
  • 29
  • 32
1

Although it is true that .vhd images aren't directly writable via dd (or for that matter cp or cat) to an internal or removable disk, the only practical difference is that they are compressed (or sparse) images. But once you have a reader (decompressor) for the format, you can recover the disk's raw contents and write them without further changes to the output disk.

Or in short, .vhd images are just compressed "dd images".

This is in contrast with ISO images, whose contents are meant specifically for CDs – e.g. using ISO-9660 instead of FAT32, and the El Torito boot format instead of DOS MBR – and Rufus has to actually transform certain parts of the contents in order to make the thing boot off a non-CD disk. (For example, it doesn't copy the ISO-966 filesystem raw, but extracts the individual files onto a new FAT32 filesystem. It doesn't always copy the bootloader as-is, but sometimes replaces it with its own version of syslinux.)

(Yes, technically ISO files are just "DD images" of a CD disc. That doesn't change the main point.)

Analogy: BMP files contain a [mostly] raw bitmap. PNG files contain heavily compressed data, but it still represents a raw bitmap when decompressed. On the other hand, DOC files don't contain anything like a bitmap and additional conversion steps are needed.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • This was informative, but it seems to me highly misleading to call the output a “DD image” file if using DD on it as is would simply result in a broken file. – Hashim Aziz Oct 15 '18 at 21:30