Loop back mount a VMDK flat image on a Linux Box

13,162

For some reason this has worked

losetup /dev/loop0 <vmdk file>
kpartx -av /dev/loop0
mount /dev/mapper/loop0p1 /mount/point

I have no idea why this worked and not the above method. If you have any explanation, please let me know.

Share:
13,162

Related videos on Youtube

user301916
Author by

user301916

Updated on September 18, 2022

Comments

  • user301916
    user301916 almost 2 years

    I am trying to loop mount a VMDK flat image generated by VMware fusion. The VMDK file has the -flat extension. I am trying to use kpartx

    kpartx -av /path/to /my/vmdk
    

    but I get

    llseek error
    device-mapper: resume ioctl on loop0p1 failed: invalid argument
    create/reload failed on loop0p1
    add map loop0p1 (0:0): 0 18872320 linear /dev/loop0 2048
    

    I also tried to convert the vmdk into raw and I got the same error

    Any idea what's wrong?

    • TheFiddlerWins
      TheFiddlerWins almost 9 years
      Do you already have loop0p1 used? it does not release them automatically - even if the mount command fails.
    • user301916
      user301916 almost 9 years
      No it is not used
  • zymhan
    zymhan about 8 years
    You can (and should) accept your own answer if it solved your problem.