LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 06:30 PM   #1
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
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, 06:58 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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, 07:12 PM   #3
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
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, 07:39 PM   #4
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
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, 07:51 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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, 08:17 PM   #6
crions
LQ Newbie
 
Registered: May 2005
Location: Home
Distribution: slackware/ubuntu
Posts: 17

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 02:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration