LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 12-27-2009, 12:36 PM   #1
sd||
Member
 
Registered: Oct 2009
Distribution: Arch Linux
Posts: 89

Rep: Reputation: 18
unable to Mount hdisk image as "loopback" device


Hi,

I am working on Ubuntu 9.10 and QEMU emulator,

but i was trying to move files from host system to harddisk image created by qemu.

i used "mount" program to mount the disk image as a "loopback" device.
but i am facing following problem!!

Quote:
root@sd-laptop:/home/sd# mount -o loop hdisk.qcow /mnt/disk/
mount: you must specify the filesystem type
i even tried it by renaming hdisk.qcow to hdisk.iso, but the error remains same!!! as far as i know, mounting a loopback device dosnt need a filesystem type!!!!! where i am getting wrong!!

Last edited by sd||; 12-27-2009 at 12:44 PM.
 
Old 12-27-2009, 12:52 PM   #2
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Try converting the qcow image to a raw image then try to loop mount the raw image.
 
Old 12-27-2009, 12:58 PM   #3
sd||
Member
 
Registered: Oct 2009
Distribution: Arch Linux
Posts: 89

Original Poster
Rep: Reputation: 18
if covert the image to RAW image format then will i be able to boot the image in qemu. :?
 
Old 12-27-2009, 02:19 PM   #4
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
you can use kpartx
its available in synpatic

http://www.forensicswiki.org/wiki/Mounting_Disk_Images

http://panoskrt.wordpress.com/2009/0...in-image-file/
 
Old 12-27-2009, 02:56 PM   #5
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Chances are your image is that of the entire drive including boot sector etc. You need to mount a partition within the drive image, not the drive itself.

While in the directory containing the image, run this command to find the offset (starting position) of the partition you want to access: sfdisk -l -uS hdisk.qcow
Most often if it's the first partition you want to access, it's offset is usually at 63.

Mount with this command for a partition at offset 63: mount -oloop,offset=32256 hdisk.qcow /mnt/disk/ (32256 = 63 x 512, and assuming /mnt/disk exists)

This should work if your image is bit for bit like a dd image, if your image is compressed and only containing allocated space, this probably won't work. You may want to convert to raw.

Last edited by Brains; 12-27-2009 at 03:23 PM.
 
Old 12-28-2009, 09:23 AM   #6
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
try libguestfs - that's exactly what it was made for
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Inappropriate ioctl for device" on loopback after rebuild mk27 Linux - Kernel 2 12-02-2009 06:11 PM
"Unable to mount compressed loopback" error during installation of Mandriva 2007 Free keith11 Mandriva 1 12-29-2006 02:30 PM
How to create a multi-file-image and mount it as a loopback device (on xbox debian) El_Oy Linux - Software 1 06-14-2006 02:05 AM
Common problems explained: "kernel panic - not syncing", "unable to mount..." sundialsvcs Linux - Newbie 2 03-01-2006 12:17 PM
"Unable to open USB device "usb://hp/LaserJet%201000": No such device" lordshipmayhem Mandriva 2 08-08-2004 04:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 03:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration