6

If you have a hard disk image (including partition table, multiple partitions,...), is it possible to let Linux treat it as a regular hard disk?

By "regular hard disk" I mean I would like to have the image show up as, for instance, /dev/hdx and its partitions as /dev/hdx1,...

(I know I can mount one of the partitions in the image using "mount -o loop,offset=x ..." but I don't really like this option.)

Hennes
  • 65,804
  • 7
  • 115
  • 169
mtvec
  • 413

2 Answers2

6

kpartx will generate multiple device files from the partitions within the file which you can then loopmount to get at the contents.

1

+1 for kpartx.

For command line fans, partx does the same job.

CJBrew
  • 221