Using an IMG instead of an ISO to put Debian on a USB Flash drive

| | Comments (2) |

Now that I have a laptop that boots from USB, I've been using IMG images instead of ISOs when I can to test new Linux and BSD systems because they're so easy to deal with.

I built an IMG of Debian Sid in IMG form with the custom-build portion of the better-then-ever Debian Live site. They're in the usb-hdd/ directory when you're on the site looking for images to download.

Putting the IMG on a USB Flash driver is easy using the dd command in Unix/Linux. I got the easy instructions from the Debian Live manual, but it's just easy to turn to that most helpful of Linux distros, Arch, for easier-to-digest instructions. (I've gotten so much help from the Arch Linux community over the last couple of years — I can't thank them enough. From forums to wikis, they've pulled me out of countless jams in Ubuntu, Debian and Fedora.)

Arch's wiki has the user running the dd operation in his/her own shell. But in Fedora 13 I needed a root shell (or I could have used sudo).

First figure out where your USB Flash drive is in the /dev hierarchy. I generally do this by running the command dmesg and looking for the output that corresponds to my flash drive.

$ dmesg

This is the relevant output:

[    6.728884] scsi 2:0:0:0: Direct-Access     A-DATA   USB Flash Drive  0.00 PQ: 0 ANSI: 2
[    6.729496] sd 2:0:0:0: Attached scsi generic sg2 type 0
[    6.732117] sd 2:0:0:0: [sdb] 15771759 512-byte logical blocks: (8.07 GB/7.52 GiB)
[    6.732623] sd 2:0:0:0: [sdb] Write Protect is off
[    6.732627] sd 2:0:0:0: [sdb] Mode Sense: 00 00 00 00
[    6.732630] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[    6.735373] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[    6.735416]  sdb: sdb1
[    7.105693] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[    7.105736] sd 2:0:0:0: [sdb] Attached SCSI removable disk

So my flash drive is at /dev/sdb

I've already downloaded my .img file from either Debian or whatever project happens to be offering their distributions/projects in that format.

In Fedora, as I said above, I need rootly privileges to do this. In your system you may be able to do this as a user. In this example I'm using the IMG file from a daily build of Debian Squeeze as the .img file and my particular flash drive as the target. In your case use the name of your .img and location in /dev of your flash drive:

# dd if=debian-live-squeeze-amd64-gnome-desktop.img of=/dev/sdb

In this case dd is copying a lot of bits, so it will take awhile for the job to complete.

Once it does you can reboot your machine and boot from your newly created bootable USB Flash drive running, in this case, Debian Squeeze.

It's a great way to test out new releases (or daily builds, or anything in this format) without needing to burn a CD/DVD or use an app such as unetbootin or Fedora's liveusb-creator to put an image on a USB drive. You just go straight from downloading an .img file to copying it to the drive and then booting from it. Every Unix/Linux system has dd, and it's nice to put it to good use.


2 Comments

gagy said:

Thank you. This is very interesting. You have tickled my curiosity. I have never try IMG, but I must be more adventurous.
As for the dd command, it is indeed very powerful.
I'm using a Dell Inspiron 11z with Linux, although I could only buy it with Windows 7 (which quickly went by the wayside). Since it does not have a CD/DVD reader, and because I am often on the move, I have been using the dd command to copy, using an external reader, movies bought on DVD. There are always two or three things to watch on the hard drive.
It’s great.

twitter said:

You have to love Unix, where everything is a file, and free software, where all the tools are just what they should be, and Google for indexing it all. An ISO is simply an image specifically formatted for a CDROM. You can mount the files and modify them the same way you can mount an image file or a CDROM.

A nifty trick is to make an image of your working computer. You do this by booting off a CD or USB key then using dd to copy the working system drive to another USB key or a file on an external hard drive. There are whole distros for doing this but dd is the essential tool and any distro will do if you have the time for the whole copy. This trick is particularly useful for netbooks, which have small drives. Once you have your image, you can mount it or boot it to make the changes to files like needed to make it run. A surprising amount of hardware will run off an image made this way and it is always nice to have a backup.

Thanks for the article, I keep meaning to look into Debian Live.

Leave a comment

Tech Talk column

Steven Rosenberg's weekly Tech Talk column, which appeared Saturdays in the Los Angeles Daily News through about October 2009, is available on the Daily News Technology page.

About this blog






Steven Rosenberg aims to learn what he does not know. He writes about it here.



About this Entry

This page contains a single entry by Steven Rosenberg published on October 29, 2010 3:00 AM.

Caption test was the previous entry in this blog.

Debian totally flies (rant on the general state of Linux and my laptop included) is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Recent Comments

twitter on Using an IMG instead of an ISO to put Debian on a USB Flash drive: You have to love Unix, where everything is a file, and free software, ...

gagy on Using an IMG instead of an ISO to put Debian on a USB Flash drive: Thank you. This is very interesting. You have tickled my curiosity. I ...

Powered by Movable Type 4.25

Search this blog

Loading

LXer

Links

Life, the Universe and Debian
Simplify
Daily News technology
LXer
Distrowatch
Linus' Blog
David Pogue
BoingBoing
Linux Today
TuxRadar
Linux.com
Linux Planet
The Open Road
Linux Outlaws podcast
Dan Lynch
Fabian Scherschel
The VAR Guy
Larry the Free Software Guy
Chess Griffin
Linux Reality podcast
Desktop Linux
Practical Technology
Linux Devices
ZDNet
ZDNet's Storage Bits
ZDNet U.K.
iTWire
CNet News
Webware
Beyond Binary
TechCrunch
The Register
Ars Technica
Reg Developer
Computerworld
Computerworld blogs
Steven J. Vaughan-Nichols at Computerworld
Debian
Planet Debian
Debian Forums
Debian News
debianHELP
debiantutorials.org
The Debian User
Wolfgang Lonien
Debian-News.net
Debian Administration
Debian Admin
Debian Weather
Aaron Toponce
Ubuntu
Xubuntu
Kubuntu
Edubuntu
Planet Ubuntu
Ubuntu Forums
Ubuntu Geek
Works With U
OMG! Ubuntu!
I' Been to Ubuntu
Tanner Helland
Dustin Kirkland
Ubuntu UK Podcast
Ubuntu Linux Help
Popey
Linux Mint
CrunchBang Linux
OpenBSD
OpenBSD Journal
OpenBSD Ports
OpenBSD 101
Planet.OpenBSD.nu
jggimi's OpenBSD live CD
DaemonForums
BSDanywhere
Marc Balmer
Denny's OpenBSD blog
Polarwave's OpenBSD Tips and Tricks
Binary Updates for OpenBSD
Puppy Linux
Damn Small Linux
Tiny Core Linux
Lucky 13's Linux blog (lots of Tiny Core)
Lucky 13's BSD blog
PCLinuxOS
Mandriva
Red Hat
Red Hat News
Red Hat Blogs
Red Hat: Truth Happens
Red Hat Magazine
CentOS
Planet CentOS
Fedora
Planet Fedora
Fedora Forums
Fedora Docs
Join Fedora
Paul Frields
Slackware
Slackbuilds
Robby's Slackware Packages
Slackblogs
dropline GNOME for Slackware
GNOME Slackbuild
GWARE - GNOME for Slackware
Wolvix
Zenwalk Linux
Vector Linux
Slax
Splack Linux — Slackware for Sparc
Nonux
How to Forge
marc.info BSD and Linux mailing list archive
FreeBSD
FreeBSD, the Unknown Giant
A Year in the Life of a BSD Guru
NetBSD
hubertf's NetBSD Blog
PC-BSD
Daemon Forums
FreeBSD Forums
Planet FreeBSD
Evilcoder.org
miwi's Privat Blog
DragonFlyBSD
DragonFlyBSD Digest
DesktopBSD
BSD Talk podcast
BSD Magazine
Rhyous
OpenSolaris
MilaX
BeleniX
DeLi Linux
Linux Loop
Electronista
The Tech Report
Engadget
Gizmodo
Phoronix
xkcd – A webcomic of romance, sarcasm, math and language
Nixie Pixel
Technology for Mortals
Thoughts on Technology
ZaReason
System 76
Tiger Direct
NewEgg
DealExtreme

Advertisement

Other blogs

Estimated stats from spring game in Inside UCLA with Jon Gold
Missing Person in Inside USC with Scott Wolf
Mohammad House opens in The Sausage Factory
How royally screwed are Kings fans without Miller and Fox narrating this playoff fun run? in Farther Off the Wall
SOFTBALL: Oaks Christian's Ackermann reaches milestone in Daily News High School Spotlight