LinuxQuestions.org
Have you heard the LinuxQuestions.org Podcast?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Thread Tools
Old 10-26-2005, 06:07 PM   #1
Valhalla
Member
 
Registered: Dec 2004
Location: Atlanta
Distribution: Gentoo 2005.1, Ubuntu 5.10
Posts: 267
Thanked: 0
Question Mounting a qemu created root disk image


[Log in to get rid of this advertisement]
I'm planning on installing Windows using qemu, since there are a few programs that require it, and it bothers me always having to reboot. Anyway, I was wondering, if I have windows format my disk image as FAT, will I be able to mount the disk image as a loopback device while qemu is not running?
Valhalla is offline     Reply With Quote
Old 10-26-2005, 07:20 PM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545
Blog Entries: 4
Thanked: 0
Maybe. It'd depend what format you had qemu make the image (not filesystem, image format). Qemu can run from ISO files and they can be mounted as loopbacks so I guess it could be possible.
cs-cam is offline     Reply With Quote
Old 10-26-2005, 09:06 PM   #3
madluther
Member
 
Registered: Aug 2004
Distribution: LFS
Posts: 349
Thanked: 0
Its is possible if your disk image is in raw format.

as root run fdisk on your raw image file
Code:
fdisk -l win2k2.img
this should produce something like this

Code:
Disk win2k2.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System
win2k2.img1   *           1        1304    10474348+   c  W95 FAT32 (LBA)
Partition 1 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(1303, 254, 63)
The file system usually starts at track 1. You can mount it by using the offset option in losetup
The offset is one track or 63 sectors * 512 = 32256 bytes

Code:
losetup -o 32256 /dev/loop0 win2k2.img
mount /dev/loop0 /mnt

HTH

Mad.
madluther is offline     Reply With Quote
Old 10-26-2005, 09:26 PM   #4
Valhalla
Member
 
Registered: Dec 2004
Location: Atlanta
Distribution: Gentoo 2005.1, Ubuntu 5.10
Posts: 267
Thanked: 0

Original Poster
So this is what I get from fdisk -l

Code:
You must set cylinders.
You can do this from the extra functions menu.

Disk c.block: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start         End      Blocks   Id  System
c.block1   *           1         636     5108638+   b  W95 FAT32
But it automatically always starts at 1 track from the start?
Valhalla is offline     Reply With Quote
Old 10-26-2005, 09:34 PM   #5
madluther
Member
 
Registered: Aug 2004
Distribution: LFS
Posts: 349
Thanked: 0
Yes, so use the same offset 32256
madluther is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
qemu create disk image nocturna_gr Linux - General 3 11-29-2005 11:49 AM
mounting a hard disk image as user? zero79 Debian 2 05-05-2005 08:12 PM
problem mounting a disk image zero79 Debian 2 05-03-2005 03:15 PM
Mounting floppy disk without becoming root ctux Linux - Hardware 2 08-01-2004 11:49 AM
Gnu Parted Boot Disk: No Root Image ghborrmann Linux - General 2 05-16-2004 05:43 PM


All times are GMT -5. The time now is 07:54 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration