Linux: Mount and edit kvm images.

Posted: June 3, 2013 in kvm, linux, mount, ubuntu
Tags: , ,
    losetup /dev/loop0 image_file.img
    kpartx -av /dev/loop0
    mount /dev/mapper/loop0p1 /mnt
    # now go to /mnt and make the change you want and unmount as below
    umount /mnt
    kpartx -dv /dev/loop0
    losetup -d /dev/loop0

References :

http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/how-to-mount-a-kvm-image-file-787557/

http://blog.dustinkirkland.com/2008/10/mounting-kvm-disk-image.html

http://blog.dustinkirkland.com/2008/10/mounting-kvm-disk-image.html

Advertisements
Comments
  1. Run “losetup -d /dev/loop0” to release the loop.

  2. Hi,
    Yep I misses that part, now it is added to the post. Thanks for pointing out.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s