Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-27-2008, 04:01 AM   #1
LQ Newbie
Registered: Nov 2008
Posts: 3

Rep: Reputation: 0
Copy 128Mb img to 1Gb


I'm trying to copy a 128Mb img file to a 1Gb sd card. I want to expand the image so that it fills the card properly. When I use
dd if=file.img of=/dev/sda
it copies it across but does not work correctly when trying to run it.
What can I do to make the 128Mb img file expand to a 1Gb img file?
Thanks in advance.
Old 11-27-2008, 04:10 AM   #2
Registered: Apr 2008
Posts: 267

Rep: Reputation: 30
At least not trying to put 1G img file into 128m. Try cp for copy?
Old 11-27-2008, 04:33 AM   #3
LQ Newbie
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
The img is a disk img containing the operating system for the card. That is why I was told to use the dd command. Is this not correct?
Old 11-27-2008, 06:05 AM   #4
Registered: Jul 2006
Distribution: Debian, Ubuntu, openSUSE, CentOS
Posts: 147

Rep: Reputation: 19
I think you need to partition the usb and create a file system in it first.

If it is already partitioned then write the image to /dev/sda1 rather than /dev/sda.

Someone else should be able to answer it better who has more experience than me :-)
Old 11-27-2008, 07:50 AM   #5
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Welcome to LQ!!

So far, you may have received some incorrect or misleading answers.

First, I assume that your "img" file is an image of a disk partition--or of a whole disk. Please confirm this and tell us how the file was made.
Also, please give details on what does not work correctly....

When you use dd to copy something onto a drive, you do not need to have the drive partitioned or formatted---dd is a byte level copy and will duplicate exactly what the low-level data was on the source device (or image file).

It is important to note the difference between copying a disk image and a partition image. The disk image will include the partition table, and the partition image will not. Thus, if your img file was from a partition, and you copied to the device (sda), you would wind up with no partition table.

Finally, what do you mean by the "operating system for the card"? From the context, it sounds like you meant filesystem, which is what gets installed when you format a drive or partition.
Old 11-27-2008, 08:43 AM   #6
LQ Newbie
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Hi pixellany!

It's an image I have taken of a 128Mb CF card (the complete card). This card is attached to hardware and is running as an linux operating system i.e. it boots up in the normal fashion.
Unfortunately I don't have my notes with me, but as much as I could recollect I copied the image of the card by:
(sda is the card)
dd if=/dev/sda of=/card.img
I can successfully use the dd command to put the image onto a 128Mb CF card. But when I put it on a 1gb card some functionality of my program that is running on the card doesn't work. And I was told that when using the dd image to move the image across onto a bigger card the image on the card only takes that space, so the rest of the space on the card isn't used. I'm not sure if this is correct, it is only what I've been told.
Does this help in any way?


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
Where can I find "boot.img" to copy to my diskette? zahrul Linux - Newbie 9 01-02-2010 04:10 AM
Add new cciss driver module to initrd.img ,stage2.img kunalroy2002 Linux - Software 4 09-25-2007 12:09 AM
using dd to copy 512M drive to 1GB drive DavidHB Linux - Hardware 1 12-12-2006 11:34 AM
[php]Reading url [img] and [/img] hylke Programming 13 08-23-2004 01:58 PM
.img burner or way to boot from a .img American Psycho Linux - Software 4 03-24-2004 06:40 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:31 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration