I have tried to mount a virtual disk image on my Fedora host using the command

qemu-nbd -c /dev/ndb0 rawhide.img

and then detecting the LVM logical volumes and mounting the one I wanted. Obviously, the virtual machine is not running - I'm not stupid. However, because I have found this to be unreliable (nbd dies after a while), and also slow, I have decided to just copy the filesystem into a subdirectory of my home directory:

cp -a /mnt/rawhide .

However, I can't even get nbd to stay alive long enough to do the copy! It just died after less than one minute!

I can't use the fast offset= technique (at least, not as stated) from this page because the filesystem is inside LVM on the virtual disk image. I think there was some utility to calculate the offset for you, but I can't remember what it was called, or whether it works with LVM?


Use guestfish instead:

$ mkdir rawhide
$ sudo guestfish -i rawhide.img

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

Operating system: Fedora release 17 (Rawhide)
/dev/vg/lv_root mounted on /
/dev/vda2 mounted on /boot
><fs> glob copy-out /* rawhide

Warning: That actually misses out the hidden files contained in /, but I don't really care about them for my purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.