LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mount qemu image (https://www.linuxquestions.org/questions/linux-software-2/mount-qemu-image-541263/)

secretlydead 03-28-2007 05:39 AM

mount qemu image
 
Qemu is a virtual machine program. You can use it to make and mount, for example, a windows image.

If you want to mount your .img, type the following command:

id <username>

It will reply with your uid=* - you'll need that for the next step.

As root, type:

mkdir /mnt/<dir name>

and then
mount -o loop,offset=32256 -o uid=* /path/to/image.img /mnt/<dir name>


That should mount your image and make it writable by you in konqueror.

If you have any questions, let me know.

If anyone knows how to make this command into a desktop clicky, it'd be a nice addition to this thread.

(keywords)
windows.img win.img win2000.img

mwadoublestar 06-23-2009 11:46 PM

I tried it but i got the error message below

# mount -o loop,offset=32256 -o uid=Administrator /root/Documents/hd.img /mnt/qemu_C/
mount: wrong fs type, bad option, bad superblock on /dev/loop1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

i have tried administrator with single quote dbl quotes, and also changed the case but didnt worked.

secretlydead 06-24-2009 01:05 AM

uid stands for a NUMBER, not your username.

do this command:
id Administrator

and use the number that command returns.

for example, on my system:
$ id root
uid=0(root) gid=0(root) groups=0(root)

so, my mount command would be:
mount -o loop,offset=32256 -o uid=0 /path/to/image.img /mnt/<dir name>

poiuiop316 07-18-2009 05:23 PM

okay so, i'm 13 so could you "stupify" that for me?

linus72 07-18-2009 05:26 PM

LOL
does that work on a partitioned qemu-img too?
or just a qemu-img where the whole device is 1 partition?

secretlydead 07-20-2009 11:31 PM

Quote:

Originally Posted by poiuiop316 (Post 3612129)
okay so, i'm 13 so could you "stupify" that for me?

youth doesn't explain ignorance, nor does age imply knowledge.

Don't let anyone look down on you because you are young...
1 Timothy 4:12 NIV

not exactly sure what your question is, so i'll try to explain as much as possible:

linux has something called uid's and gid's. this stands for UserID and GroupID. each group and user also has a name.

linux has something called a terminal. you can open this and type different commands. the simplest terminal you can bring up on KDE is by hitting alt-F2. then you can type a command into that terminal. if you have KDE, you probably also have konsole. you can open that by hitting 'alt-f2' then typing konsole.

now you have a consol (i guess that's a terminal window, i'm not too sure) where you can type commands.

try this one:
ls -l
that should bring up some file names like this:
-rw-rw-r-- 1 dan dan 23164 2009-06-15 17:33
the first thing is permissions, and the two that say 'dan' 'dan' on my screen are the group and user that owns the files.
then you can try this one:
ls -n
that should bring up some files like this:
-rw-rw-r-- 1 500 500 56757 2008-12-19 17:55
in place of the username and group name, you see gid's and uid's. so, user dan is the same as uid 500 (on my system, at least.)

this is what i meant when i said:
"uid stands for a NUMBER, not your username."

then i said:
do this command:
id Administrator

i just mean type 'id Administrator' in the terminal/console (konsole, maybe). my system has no 'administrator' - so, i might type 'root' or 'dan'
id root
gives me back:
uid=0(root) gid=0(root) groups=0(root)

that tells me the uid, gid, and what groups root belongs to. (i think, but i'm not really sure. when this happens, i can always say 'command --help' or 'man command' - this will tell me everything i need to know about a command. in this case, i would type: 'man id' or 'id --help' to find out more.)


and that's where the rest comes from:

and use the number that command returns.

for example, on my system:
$ id root
uid=0(root) gid=0(root) groups=0(root)

so, my mount command would be:
mount -o loop,offset=32256 -o uid=0 /path/to/image.img /mnt/<dir name>


so, if you're baffled by this explanation... well, just remember that we're not exactly dealing with changeable parts here. if you asked me how to tighten your head bolts on your car, i could say, "turn it to a torque of 215 lbs and then use a serpentine drive belt remover to turn it by another 3/4 turn" - i'd probably be wrong when i told you that, and it'd probably be more helpful for me to tell you how to use a torque wrench and how to find the torque of your engine's head bolts...

emmytun 05-14-2010 06:53 AM

hi
i'm trying to mount a partition named hhdshare.img and i have this error, could some one help me please

debian:/opt/argos/images# mount -o loop,offset=32256 -o uid=1000 hddshare.img /mnt/point
mount: you must specify the filesystem type
debian:/opt/argos/images# mount -t vfat -o loop,offset=32256 -o uid=1000 hddshare.img /mnt/point
mount: wrong fs type, bad option, bad superblock on /dev/loop1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

linus72 05-14-2010 06:59 AM

hey emmytun!
Welcome to LQ!

I now use kpartx to mount partitioned qemu img files
see this how to here
http://panoskrt.wordpress.com/2009/0...in-image-file/

what distro are you using?

emmytun 05-14-2010 07:22 AM

thinks linus72 for your help
i'm using Debian lenny if i understand your question :)

i checked the link that you posted and when i tried to mount the partition i get this error msg :

" No entry for device-mapper found "

linus72 05-14-2010 07:31 AM

did you install kpartx?

sudo apt-get install kpartx

emmytun 05-14-2010 08:35 AM

yes i did

apt-get install kpartx

then

kpartx -a /path/to/image/hddshare.img

and i got this

/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
Incompatible libdevmapper 1.02.27 (2008-06-25)(compat) and kernel driver
device mapper prerequisites not met

jefro 05-14-2010 04:12 PM

Already all over the web.

http://wiki.archlinux.org/index.php/...ard_disk_image

http://how-to.wikia.com/wiki/How_to_...Linux-based_OS


All times are GMT -5. The time now is 07:43 AM.