LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > 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
  Search this Thread
Old 05-01-2005, 05:51 AM   #1
username-inuse
LQ Newbie
 
Registered: Apr 2005
Location: Kent, England, UK
Distribution: Red Hat 9, Knoppix HD install, Gentoo (Just about installed :P)
Posts: 12

Rep: Reputation: 0
mounting a .img file...


Well, I have installed QEMU and installed Windows NT on it. I have got the NT installation on a disk file (.img) and I would like to mount it so it appears as a real partition.

I have tried...

Code:
losetup /dev/loop0 winNT.img
mount -t fat /dev/loop0 /mnt/winNT
I get errors about it notbeing supported. It has a wrong block to be vfat (when I try -t vfat) and it isnt -t msdos. I know it is a FAT filesystem becuase I checked.

Thanks in advance
 
Old 05-01-2005, 06:14 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Try -t auto which will try to auto-detect the filesystem.

-t vfat supports FAT12, FAT16 and FAT32, so if it has the wrong block type then it looks like the contents of your .img file are not a FAT filesystem; possibly it has additional meta-data. How did you create the file? What does this command report the file as:?
Code:
file winNT.img
You might also try -t ntfs if it's an NTFS filesystem; note that this only gives you read support and the ability to append to files IIRC.
 
Old 05-01-2005, 01:41 PM   #3
username-inuse
LQ Newbie
 
Registered: Apr 2005
Location: Kent, England, UK
Distribution: Red Hat 9, Knoppix HD install, Gentoo (Just about installed :P)
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by rjlee
Try -t auto which will try to auto-detect the filesystem.

-t vfat supports FAT12, FAT16 and FAT32, so if it has the wrong block type then it looks like the contents of your .img file are not a FAT filesystem; possibly it has additional meta-data. How did you create the file? What does this command report the file as:?
Code:
file winNT.img
You might also try -t ntfs if it's an NTFS filesystem; note that this only gives you read support and the ability to append to files IIRC.
The command

Code:
file winNT.img
returns...

Quote:
nt4_ie6.img: x86 boot sector, DR-DOS MBR, version 7.01 to 7.03
I suppose thats becuase its bootable...

The -t auto tells me I must specify a filesystem...
 
Old 05-01-2005, 02:46 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
The MBR isn't on the partition; which suggests that you've taken an image of the entire hard disk (/dev/hda), not just the FAT partition (/dev/hda1).

You will need to pass the -o bytes option to losetup to skip over the MBR header.

Alternatively, you can make a copy of the image file, cutting out the MBR, to get at the actual partition data:

Code:
dd if=winNT.img of=part.img bs=1024 skip=n
Replacing n with the size of your MBR in kilobytes (bs bytes).

You should then be able to mount the new image with -t vfat.

Unfortunately, I don't know exactly how big the MBR is; I think it's a few kilobytes but it may be less than this. You may want to try and find this out before dd-ing copies of the file.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting .img files iamharpreet Linux - Newbie 16 07-07-2012 04:11 PM
Mounting a .img file? RoaCh Of DisCor Linux - Newbie 2 07-12-2005 02:49 PM
Mounting IMG file on suse 9.3 fireedo Linux - General 3 05-23-2005 03:05 AM
mounting a img file kudos Slackware 2 04-30-2003 02:54 PM
Mounting and unmount of lnx4win.img mauritzv Linux - Newbie 0 01-16-2002 11:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:31 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