Re: Mounting KVM image

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 11, 2010 at 03:45:39PM -0400, Alex wrote:
> Hi,
> 
> >> Another option is guestfish: http://libguestfs.org/
> 
> I have to migrate the image to a remote system because I don't have
> all the tools there to run this. Do you know if guestfish requires a
> kvm kernel and processor, or can it be done with an older processor?
> When I try and mount the image, I see this:
>
> # guestfish -a systmp-img.img -m /dev/hda1 /bin/ls

You don't need to be root to use libguestfs tools, provided your
normal user has permissions to at least read the image file.

> open /dev/kvm: No such file or directory
> Could not initialize KVM, will disable KVM support
> libguestfs: error: mount_options: mount_options_stub: /dev/hda1: No
> such file or directory

Take it a step at a time:

  guestfish -a systmp-img.img --ro
  ><fs> list-devices
  ><fs> list-partitions
  ><fs> lvs

You can then mount the partition(s) that contain data you want to
read, for example:

  ><fs> mount /dev/vda1 /

or:

  ><fs> mount /dev/some_vg/some_lv /

[There is also a separate command, virt-list-filesystems, which takes
an arbitrary image and lists out the names of the filesystems in that
image that you could mount.]

To make this easier, you can have virt-inspector do all the hard work
of examining your image and finding out how partitions are arranged,
and then get it to mount them up for you.  Just do:

  guestfish -i systmp-img.img --ro

To extract the data, I suggest you use the guestfish tgz-out command
(see the guestfish(1) man page).

If you want to actually mount the partition(s) as filesystems on the
host, you need to use another command, guestmount.  This uses FUSE and
will let you mount the filesystem(s) on a local directory, root
permissions also not needed.  Eventually we'll modify virt-manager so
you can double click on an image and it'll appear mounted, but in the
meantime you'll need to read the manual page guestmount(1).

> I suspect it's because the processor isn't kvm-capable, but it allowed
> me to install and upgrade all the necessary packages...

You don't need KVM, although libguestfs is a lot faster if KVM is
available.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux