.IMG file help!!!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers .IMG file help!!!
# 1  
Old 12-21-2010
.IMG file help!!!

I've been trying to create an IMG file for the past week with no success. I've tried using:

Code:
dd if=/dev/zero of=myimage.img bs=512 count=2880
mke2fs myimage.img
mkdir /media/mount_point
mount -o loop myimage.img /media/mount_point
cp -aR <file> /media/mount_point
umount /media/mount_point

and it completes without errors or anything of the sort, but then when I mount "myimage.img" nothing is in it. Smilie
So can anyone tell me what I'm doing wrong or what I could possibly do to create an IMG file on ubuntu?

thanks in advance

Last edited by DukeNuke2; 12-23-2010 at 02:19 PM..
# 2  
Old 12-21-2010
Please explain exactly what you are trying to do. What do you plan to do which the image file once you have created it?
# 3  
Old 12-21-2010
I plan to boot from it using "qemu". I'm actually following the steps given here to generate the image but these don't work for me either. I'm assuming it's because I don't have a floppy drive.
# 4  
Old 12-22-2010
Your problem has nothing to do with not having a floppy drive.

What operating system and distribution are you actually using to create the image.

Are you literally typing:
Code:
cp -aR <file> /media/mount_point

or is <file> replaced with something else?

If so what is the actual command you are typing?
# 5  
Old 12-22-2010
I'm running ubuntu and I'm replacing <file> with the files I want to copy. The actual command is:

Quote:
cp -aR /home/neur0n/L4/* /media/mount_point
# 6  
Old 12-22-2010
it works absolutely fine for me. I suspect your file actually isn't being mounted.

Check that mount works right. When it's mounted you should be able to run df -h and see a line like
Code:
$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             9.9G  653M  8.8G   7% /
udev                   10M  376K  9.7M   4% /dev
/dev/sda6              15G  8.3G  5.9G  59% /usr
/dev/sda7              15G  311M   14G   3% /var
/dev/sda9             233G   39G  183G  18% /home
shm                   1.9G     0  1.9G   0% /dev/shm
/dev/loop0            1.4M   20K  1.3M   2% /home/monttyle/test/media
$

# 7  
Old 12-22-2010
If Corona is correct in his theory, the copied files should exist at /media/mount_point and be visible when no file system is mounted on /media/mount_point.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remount .img as rw and repack

Hi fellas! I make a sh script which the following: sudo mkdir Temp sudo mount -o loop output.img Temp The command mounts the img.Thats fine.But it moun s it as read only.But I need to edit/delete some files inside it and repack it as ext4 using this command: sudo ./mkuserimg.sh -s Temp... (3 Replies)
Discussion started by: vijai
3 Replies

2. Web Development

HTML/PHP show IMG based on location

HI guys/gals, I like to add some personal touches to a welcome image on our mediawiki site, and have the welcome be displayed in the, presumed, language of the visitor. Standard would be English, but if the IP or browser or OS is set to be in India, I want to display the message in Urdu for... (5 Replies)
Discussion started by: lawstudent
5 Replies

3. UNIX for Advanced & Expert Users

Could I get the initrd.img file without recompile the kernel?

Hi, all: The vmlinuz-3.0.4.old is a kernel previous to the current running kernel vmlinuz-3.0.4 which is compiled the most currently. Could I get the initrd.img-3.0.4.old without recompile under the condition that the config-3.0.4.old, System.map-3.0.4.old and vmlinuz-3.0.4.old exist? if it... (1 Reply)
Discussion started by: liklstar
1 Replies

4. Ubuntu

WGET in Ubuntu( vistual img ) vs Red Hat

Hi I need to fetch a file using wget command. In read Hat I have the file I need without any problem while in Ubuntu ( installed on a virtual image ) it doesn't work. More precisely my wget need to fetch a page from a web site with secure authentication so teh syntax I am using is wget... (7 Replies)
Discussion started by: manustone
7 Replies

5. Red Hat

Fedora installation getting stuck in initrd.img

I have a 80GB hard disk with WinXP already installed.I had tried installing Fedora 10 earlier without creating new partitions(real foolish and ignorant of me :o:o ) and tried creating partitions using Fedora10 bootable.It didnt work.Then I created a free partition and again tried installing... (4 Replies)
Discussion started by: ganesh.k28
4 Replies

6. Solaris

Read/View .img files from SunOs 5.8

We use imaging software from a cardiology clinic on SunOS 5.8 and I want to be able to see these image files (.img extension) on Windows XP. Can this be done? If so, with what software (on Windows XP)? On Windows XP, I've used software like Ulead PhotoImpact and Corel PhotoPaint but I've had no... (16 Replies)
Discussion started by: sreyes27
16 Replies

7. UNIX for Advanced & Expert Users

.DSK to .IMG ?

Hi, I have a windows emulator that I am wanting to try out, but my Windows 3.1 files are split up over 6 .DSK images, and I need to convert them to an .IMG that I can actually mount on my system (so that the emulator can see it). Is there a way to do this? thanks. -patrick (0 Replies)
Discussion started by: patrick99e99
0 Replies

8. Programming

getting img url

hey, i just found this forum...how cool. question: does anybody know code or know where i can get the code to get a certain image URL from user? say user input URL from shell prompt when run the program. What is the code to take that URL open internet and download the image. thanks alot. (2 Replies)
Discussion started by: bb00y
2 Replies
Login or Register to Ask a Question