6GB image of 8GB uSD card?

Hello all;

I have an 8GB uSD card with an ~6GB file system on it (boot +rootfs).

What I want to do is just image the 6GB portion that is actually formatted and used.

I tried the windows tool and it didn’t work. It imaged the entire disk.

Is there a switch in Linux “DD” or some other way to image just the 6GB portion of the card ?

Thanks;

Bill

“No one could make a greater mistake than he who did nothing because he could do only a little.”

“All that is necessary for the triumph of evil is that good men do nothing” Edmond Burke (1729 - 1797)

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book

Hi Bill,

Thanks Dave;

Sounds like I need to read up a bit on ‘DD’ .

I assume that is what you were talking about ?

Bill

“No one could make a greater mistake than he who did nothing because he could do only a little.”

“All that is necessary for the triumph of evil is that good men do nothing” Edmond Burke (1729 - 1797)

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book

Thanks Dave;

Sounds like I need to read up a bit on ‘DD’ .

I assume that is what you were talking about ?

are you asking about doing something like this? dd if=/dev/YOUR_DEVICE of=myBackup.img bs=1M count=6144 assuming its actually 6GB

I still think using tar is better for this situation. Or perhaps I’m misunderstanding something ? Something like this . . .

Your rootfs partition seems to be 6GB in size. Then you want to fill up the remainder of the SD card after the initial boot partition gets what it needs. You create both partitions with fdisk, making the boot partition 48M, 64M, whatever size you need / want. After this, you instruct fdisk to create a second partition that fills up the rest of the space.

Once that is done, you need to use parted to mark the boot partition as the active boot partition. Format the boot partition as FAT16 or FAT32, and the rootfs partition as ext2,3 or 4. Then you can move all your boot files like MLO, uboot.img, uEnv.txt, and am335x-boneblack.dtb over to this partition into their respective places. HOWEVER, for the boot partition, it may be easier to just use dd.

http://www.debianhelp.co.uk/ddcommand.htm

Now then we need to take care of the rootfs, which is fairly straight forward, and where I think using tar is best. The reason is simple. The media space left will not matter, so long as it can fit the rootfs image you’re trying to move over. As long as we told fdisk to take up the remainder of the space left after the boot partition.

http://www.aboutdebian.com/tar-backup.htm

Also Bill, have a look at my “USB boot” bog post here: http://www.embeddedhobbyist.com/debian-tips/beaglebone-black/beaglebone-black-usb-boot/

The example use case I give at the bottom shows how I use tar to copy, and duplicate and already existing rootfs. If its not very clear feel free to ask me what you’re unsure of, and I’ll do my best to answer.

Thanks Don;

Basically I created two partitions just like in the various tutorials.

Made the first one a FAT16, made it bootable, etc.

Then when it came time to make the EXT3 partition, instead of using the default, which would have been the entire card

I gave it a size of 6000MB instead of using the default.

So the partition with the rootfs on it is 6GB plus the boot partition which is the standard 0 – 4095.

Does that answer your question ?

Are you asking about doing something like this?
dd if=/dev/YOUR_DEVICE of=myBackup.img bs=1M count=6144

assuming its actually 6GB

Bill