3

I saved an image of a USB stick using Win32 Disk Imager, which produced only a .bin file of the same size as the drive.

Is it possible to read this .bin file as if it were a drive? I have access to Windows, macOS, Linux.

What I've tried

  • Mounting it with Daemon Tools (it refuses without a .cue file) and macOS Disk Utility (cannot select .bin files)
  • Found tutorials about creating a .cue file by hand (no customization whatsoever, just "paste this text into a new file and rename it to xyz.cue"). I don't understand how that could possibly work since that would then suggest that .cue files are superfluous. It didn't work (Daemon Tools), obviously.
  • Following instructions to use it as a loop device on linux, i.e. losetup -p /dev/loop0 win-usb.bin and expecting at least one partition to show up as /dev/loop0pX in order to mount it — it didn't. Did I misunderstand something here?
  • Also briefly tried looking at it with the allegedly superseded kpartx -l win-usb.binloop1p1 : 0 62533294 /dev/loop1 3 but not really sure what it tells me.

  • Reading up on .bin .img .iso getting none the wiser. Did Win32 Disk Imager create a raw image of my drive, or some magic format? I've been assuming the former.

The drive only had a Windows To Go installation for BIOS. Do I just have to mount my /dev/loop0 with some magic numbers? I'm unsure about how to reason my way to those numbers.

So far the only option I know of to actually read the contents of my image is to find another USB drive and use Win32 Disk Imager to restore the .bin.

References

  • Loop device answers one, and two that didn't work all the way. Please note that this question is specifically about the kind of .bin files produced by Win32 Disk Imager and not about an .img from dd.
Andreas
  • 633
  • 10
  • 28
  • 1
    I’d guess that Win32 Disk Imager and dd both create raw images. Loop-mounting images with partitions sometimes doesn’t work right away. What you want is `losetup -P`, by the way: with an uppercase `-P` (=`--partscan`). – Daniel B Sep 13 '18 at 15:16
  • @DanielB Thanks, you're right that it's -P — I'll have to double check whether I made that typo in the terminal or just here on SE. – Andreas Sep 13 '18 at 15:46
  • @DanielB I had used the -P properly in the terminal. If you know a way to make the loop device method work feel free to write an answer – Andreas Sep 13 '18 at 22:03

1 Answers1

6

You should be able to mount it as a RAM disk using OSFMount, and you shouldn't need a .cue file.

With that installed click "Mount new..", make sure "Image file" is selected and browse to the .bin file and select it. You can then choose to mount either all or only one partition from the image and choose the drive letter you want to mount it as (and whether you want it to be readonly or not).

motosubatsu
  • 570
  • 2
  • 11
  • Could you add some of the neccessary steps to mount it instead of mostly just linking to software? – confetti Sep 13 '18 at 14:35
  • 1
    @confetti - added a few more details, apologies I was a little distracted when i wrote the initial answer. – motosubatsu Sep 13 '18 at 14:59
  • 2
    Your initial answer was enough for me. That has to be the most straightforward application of its kind I've ever used. Solved the problem in under one minute. It also mounted a .VHD from inside the mounted partition with no problem (except that it only managed read-only VHDs). – Andreas Sep 13 '18 at 15:42
  • @Sirap yep.. after using that you wonder how on earth everyone else seems to make it so complicated. It's a little limited in dealing with some of the VM disk formats (as you've discovered with the VHD) but otherwise I can't fault it - especially not at the price point of "Free". If you're all sorted now could you mark my answer as accepted? – motosubatsu Sep 13 '18 at 15:57
  • @motosubatsu Sure, but I usually wait a day or two before accepting an answer to let it get some more exposure – Andreas Sep 13 '18 at 16:38