teh fear

10 Oct

lomount – easy mounting of partitioned loop images

Mounting a loop file that is a filesystem is no problem
losetup /dev/loop0 my_loop_image
mount /dev/loop my_mount_point

or
mount -o loop my_loop_image my_mount_point

BUT, what if my loop image has partitions?

Well, one way would be to access it from within a xen virtual machine – as far as I am aware, if you want to run programs like e2fsck on the filesystem within a partition within a loop file, this is the easiest way.

You can calculate how far into the image the start of the partition lies and then use the calculated offset when setting up the loop device
losetup /dev/loop0 my_loop_file -o <offset value>
or, if you have lomount on your system, simply specify the partition number
lomount -t ext3 -diskimage my_loop_file -partition 1 my_mount_point

Leave a Reply

© 2010 teh fear | Entries (RSS) and Comments (RSS)

Powered by Wordpress