LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-23-2009, 05:30 PM   #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
Does anyone know how to create an ".img" file for floppy/usb?


I am asking how to create the .img file like in alot of floppy images and usb.img files-are they the same and how are they made-is their a similar script like "make_iso.sh", except it would be "make_img.sh?
thanks.
 
Old 03-23-2009, 05:58 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look at the mtools package for formatting floppies. For usb drives, they are more like hard drives, so you can create any filesystem you want for them. Simply create an empty file of the size you need, and then format the file using the filesystem you will be using, such as fsck.vfat for example. Then you can mount the file using the loop device and use it normally.

If you want a bootable usb device, you can simply use grub-install and write to the MBR of the usb device.

On some distro's you can install to a directory (e.g. SuSE) to install a Linux system there. A distro designed to run off a pendrive may be bettter for this. For example, for pendrives, use ext2 instead of ext3. Journaling results in more writes to the device. Don't have a swap partition or file on a solid state device.
 
Old 03-23-2009, 06:12 PM   #3
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-what I'm saying is-how to create/make an ".img" file-like a ".iso" file.
For example-archlinux has a "archlinux-2009.02-2-ftp-i686.img"
How is this file type made??
 
Old 03-24-2009, 06:39 PM   #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-I figured it out, an ".img" file is basically the same as a ".iso" file.
To make one, take any iso-let's say goblinx-2.7-Micro.iso, extract the iso contents to a folder-right-click on iso-select "extract here", a folder named goblinx-2.7-micro will appear. Now, go into the folder and then into the "goblinx" folder. here you will find a script called "make_iso.sh", move or copy this script into the "boot" folder(otherwise it won't work). Now, right-click on the make_iso.sh and select "properties", then select "permissions", check the box that says-"allow executing file as program".
Now, double left click on make_iso.sh, a box will appear that says "run in terminal/display/run", choose run in terminal, a terminal will appear asking you for the name of the iso
Code:
Target ISO file name [ Hit enter for /home/bz/Desktop/boot.iso ]:
instead of naming it myiso.iso, name it myiso.img and a .img file will be made.
Actually I just figured out that just renaming an iso file to .img changes it-der?
 
Old 03-24-2009, 06:51 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
An ISO file tends to mean it is an image of a CDROM. It uses the iso-9660 filesystem. The ISO is commonly used as a truncated form of ISO-9660. This is different than what a floppy image would be or a usb pendrive.

A floppy usually uses the fat-16 filesytem.

The extension is mostly a convenience. Don't rely on it. Also extensions often have several different definitions. You can use the "file" command to determine what a file actually is. For devices you can use "sudo fdisk -s /dev/<device_node>" to determine the filesystem. ( or udevinfo -q env -n /dev/<device_node> ). Pay attention to what you are working with as much or more than what the extension is.
 
Old 03-24-2009, 07:17 PM   #6
crions
LQ Newbie
 
Registered: May 2005
Location: Home
Distribution: slackware/ubuntu
Posts: 20

Rep: Reputation: 1
To create from USB/CD/FD

# dd if=/dev/devicetoclone of=isoedfile.iso


To create your own ISO:

# mkisofs -R -o <name_new.iso> <directory_where_the_files_are>

Most important Options:
-posix-H Follow sylinks encountered on command line
-posix-L Follow all symlinks
-posix-P Do not follow symlinks (default)
-o FILE, -output FILE Set output file name
-R, -rock Generate Rock Ridge directory information
-r, -rational-rock Generate rationalized Rock Ridge directory info
-J, -joliet Generate Joliet directory information
-print-size Print estimated filesystem size and exit
-udf Generate UDF file system
-dvd-video Generate DVD-Video compliant UDF file system
-iso-level LEVEL Set ISO9660 level (1..3) or 4 for ISO9660 v 2
-V ID, -volid ID Set Volume ID
-graft-points Allow to use graft points for filenames
-M FILE, -prev-session FILE Set path to previous session to merge
 
  


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
how can I "cat" or "grep" a file to ignore lines starting with "#" ??? callagga Linux - Newbie 7 08-16-2013 06:58 AM
Red hat Install: "No valid devices found on which to create new file systems" Lucky_69 Linux - Software 1 02-06-2007 09:19 PM
how to extract .img file to create a "DUD" on a floppy diskette dojiep Linux - Newbie 4 05-23-2006 08:31 AM
Writing to "/dev/usb/hiddev*" and to "/proc/bus/usb/00B/00S" throw an arror EI stpg Programming 0 07-14-2004 05:44 AM
"mkdir: cannot create directory `foo': Read-only file system" on FAT32 maddes Linux - Hardware 1 11-26-2003 06:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:39 AM.

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