All times are UTC-06:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Creating .IMG Files
PostPosted: Tue Jan 17, 2012 11:56 am 
Offline

Joined: Sat Nov 05, 2011 9:59 am
Posts: 59
Location: Bloomington, IL
What tool is best to create .img files of file systems? I've been trying to use dd, but having no luck with it.

~Jeff


Top
   
 Post subject:
PostPosted: Tue Jan 17, 2012 12:15 pm 
Offline
Genesi

Joined: Mon Jan 30, 2006 2:28 am
Posts: 409
Location: Finland
Hi.

Using 'dd' is the best option, at least if you're attempting to create an image of an SD card. Could you clarify where you're having problems?


Johan.

_________________
Johan Dams, Genesi USA Inc.
Director, Software Engineering

Yep, I have a blog... PurpleAlienPlanet


Top
   
 Post subject:
PostPosted: Tue Jan 17, 2012 7:02 pm 
Offline

Joined: Sat Nov 05, 2011 9:59 am
Posts: 59
Location: Bloomington, IL
Well for instance, dd creates an image as large as the SD card. Meaning even though I only have 1.2 GB worth of files, I'm creating a 4 GB image. Is there a way to make the image only as larger as the files needed?

~Jeff


Top
   
 Post subject:
PostPosted: Wed Jan 18, 2012 6:45 am 
Offline
Genesi

Joined: Mon Jan 30, 2006 2:28 am
Posts: 409
Location: Finland
Hi.

You could use GParted to re-size the partition to something about as big as the actual data content before using dd.


Johan.

_________________
Johan Dams, Genesi USA Inc.
Director, Software Engineering

Yep, I have a blog... PurpleAlienPlanet


Top
   
 Post subject:
PostPosted: Wed Jan 18, 2012 11:31 am 
Offline

Joined: Sat Nov 05, 2011 9:59 am
Posts: 59
Location: Bloomington, IL
Can dd copy multiple partitions with copying the entire disc? Right now I simply do:
Code:
dd if=/dev/mmcblk0 of=myfile.img
But this copies the entire space, even blank space. Can I have multiple if inputs some how so I only mmcblk0p1 and mmcblk0p2?

~Jeff


Top
   
 Post subject:
PostPosted: Wed Jan 18, 2012 10:31 pm 
Offline
Genesi

Joined: Mon Jan 30, 2006 2:28 am
Posts: 409
Location: Finland
Hi.

No, what you should do is make sure the partitions are scaled down and then 'dd' only up until a certain limit, e.g.:
Code:
dd if=/dev/sdb of=image.img bs=2048 count=1M
This will read the first 2GB from an SD card which could be 8GB in total size.

Johan

_________________
Johan Dams, Genesi USA Inc.
Director, Software Engineering

Yep, I have a blog... PurpleAlienPlanet


Top
   
 Post subject:
PostPosted: Wed May 16, 2012 4:44 am 
Offline

Joined: Tue Apr 24, 2012 10:41 am
Posts: 5
Hi,
I need save my customized ubuntu maverick (desktop background, same script, ecc..) to img using dd command (on external SD card).
Can I creating image from running system target?
How Can I do?
Thanks,
Michele


Top
   
 Post subject:
PostPosted: Wed May 16, 2012 5:05 am 
Offline
Site Admin

Joined: Fri Sep 24, 2004 1:39 am
Posts: 1589
Location: Austin, TX
Quote:
Hi,
I need save my customized ubuntu maverick (desktop background, same script, ecc..) to img using dd command (on external SD card).
Can I creating image from running system target?
How Can I do?
Thanks,
Michele
You cannot take an image from a running system target. You must boot some other way, mount the target drives in that other operating system, and make your image that way.

If you're using the internal PATA SSD to set up your image, you can boot from SDHC card to do this, if you use the Maverick installer image it will drop you into a shell if you hit "N" when it asks you to destroy the system. The username and password are in the manual (oem/oem). The great thing about the Maverick installer card is it's only 2GB in size, so if you have a 16GB SDHC you can back up all of PATA onto a 14GB partition;
Code:
(logged in as oem:)
sudo parted /dev/mmcblk0
(in parted:)
mkpart primary 2GiB 100%
print
quit
(in shell:)
sudo mkfs.ext4 /dev/mmcblk0p3
sudo mount /dev/mmcblk0p3 /your-mount-point
Simply dd it to your new filesystem. I would not recommend trying to compress it on the Efika, it will take forever with a decent compression tool and you lose accurate accounting of just how long it would take. I believe I installed dcfldd on the installer card, so you can do this:
Code:
sudo dcfldd if=/dev/sda of=/your-mount-point/myssd.backup bs=4M status=on statusinterval=4
And it will give you progress on how many 4M chunks it has done so far (4M just happens to be an ideal transfer size for the SSD or SD card alike)

Just take it to another Linux box and compress it there from the SD card to somewhere safe.

However, I would actually not bother making DD images of your system as they are not flexible and you WILL take filesystem errors with you in the disk image (something a fsck before imaging might fix) and you will also take every "unallocated" block that has random data in it, making your images huge and uncompressable. It is much safer to use a tar archive from the mounted image, and all these scripts are in /home/oem on the Maverick SD card. This is how we install the system (from tar.xz file) so in actual fact you could replace the tar.xz on the SD card with your backup and you will have a custom installer card that will install your nice, configured system. /home/oem/oem-installer is the script to look at to edit for the filenames, and /home/oem/maketarball.sh should make your tarball from the PATA SSD, it has some fairly reasonable arguments, WILL give you a progress bar, and WILL use a selectible compression :)

The reason we provided that stuff was to help people to do exactly what you want to do.

_________________
Matt Sealey


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
PowerDeveloper.org: Copyright © 2004-2012, Genesi USA, Inc. The Power Architecture and Power.org wordmarks and the Power and Power.org logos and related marks are trademarks and service marks licensed by Power.org.
All other names and trademarks used are property of their respective owners. Privacy Policy
Powered by phpBB® Forum Software © phpBB Group