LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-06-2009, 11:02 AM   #1
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
How to mount/extract a .img ?


So, I got debian live usb .img
I don't wanna dd my usb as I already know what needs to be done to install it myself

But, how do I mount the .img file?
I tried mount -o loop name.img
and it says define fs type?
so, mount -o loop -t ext2 name.img or what?
 
Old 08-06-2009, 11:11 AM   #2
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
Is it a CD image? If so, try -t iso9660
You will need to specify the fstype, so the best thing to do is find out what that is.
 
Old 08-06-2009, 11:12 AM   #3
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Bullseye
Posts: 1,508

Rep: Reputation: Disabled
Linus,

The second post in this thread suggests a possibility:

http://www.linuxforums.org/forum/lin...nting-img.html

See what you think.
 
Old 08-06-2009, 11:18 AM   #4
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
OK
here's what "file debian.img" says

Code:
root@PartedMagic:/media/hda6/home/bz/Desktop# file debian.img
debian.img: x86 boot sector; partition 1: ID=0x83, active, starthead 0, startsector 1, 946175 sectors, code offset 0x31
that's wild huh?

here's mount -t ext2 -o loop debian.img mnt

Code:
root@PartedMagic:/media/hda6/home/bz/Desktop# mount -t ext2 -o loop debian.img mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop3,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
what else can I try?
mounting it according to offset?
I'm stuck...

there's a few dindows apps that can do this
it must be doable in linux too...
 
Old 08-06-2009, 11:27 AM   #5
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
OH

Quote:
"Why do you wanna do this Linus72?"
Quote:
"'Cause I have 2 partitions on usb, one live-rw for remastering/persistency
'cause I already know what dd'ing it does: it labels it DEBIAN_LIVE,installs syslinux, and
copies debian live to usb"
and, it also makes my 2gb usb into a 300+mb usb??!
 
Old 08-06-2009, 11:33 AM   #6
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Bullseye
Posts: 1,508

Rep: Reputation: Disabled
Did you try the first command from the link?

Code:
mount -o loop ./<filename>.img /mnt/<some folder>
 
Old 08-06-2009, 11:35 AM   #7
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
see it as a block device with a partition inside

so you need to make a device file and mount it the usual way
 
Old 08-06-2009, 11:37 AM   #8
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
How?
I tried mount /dev/debian.img /mnt/debian
Quote:
mount: /dev/debian.img is not a block device
what should I do?
 
Old 08-06-2009, 11:39 AM   #9
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
Quote:
Originally Posted by the trooper View Post
Did you try the first command from the link?

Code:
mount -o loop ./<filename>.img /mnt/<some folder>
Yes this should work for most usb or floppy images
 
Old 08-06-2009, 11:42 AM   #10
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Quote:
root@PartedMagic:/media/hda6/home/bz/Desktop# mount -o loop ./debian.img /mnt/debian
mount: you must specify the filesystem type
I tried that too
 
Old 08-06-2009, 11:48 AM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Since the image includes the MBR and partition table you will need to use the offset option.
Using the dd command will recreate the image byte for byte. The drive will now appear to be the same size as the image which as you have indicated is 300mb.

http://www.andremiller.net/content/m...ns-using-linux
 
Old 08-06-2009, 11:49 AM   #12
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
awesome
check this out too

http://lj4newbies.blogspot.com/2007/...-files-in.html
 
  


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
extract files from img file mbvo Linux - Software 4 10-16-2008 04:35 AM
trying to mount iso or extract img, not working hedpe Linux - Software 10 10-02-2008 09:26 PM
extract .img file cccc Linux - General 3 06-02-2008 03:04 AM
how to extract a .img? SlipAway172 Linux - Newbie 6 07-04-2005 03:45 PM
Extract *.img file? teodavinci Linux - Newbie 1 08-24-2004 03:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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