Tuesday, January 3, 2017

mount - Use hard disk image like a regular hard disk on Linux


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.)


Answer



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


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...