shrink emmc for backup

Hello!

Based on different eMMC chips I have the problem that dd backup can´t restore on new BBB.

Is it possible to shrink the partition on the eMMC? Maybe for 50MB?

After this, dd Backup and restore?

If yes, has maybe someone can help how I have to do this?

Thank you!

Can you clarify? Do you want to decrease the size of the partition that is created by the flasher script or do you want to shrink the size of the partition of a running eMMC. Also, can you clarify that you mean the onboard chip or a miniSD card?

Hello Joe,

I need to backup eMMC from BBB1 and restore it on eMMC on BBB2.
I have 2 BBB. One of the BBB has a different eMMC Chip and can´t copy the image from BBB1 to BBB2, because of insufficient space on BBB2.

So I want to decrease the Image of BBB1.

But not sure if it work with dd ?

It would be helpful to know how far you are off. That is, can you just
resize the partition or do you need to remove some content first? If
you really need to do a block-by-block copy, the debian resize2fs tool
can be used to shrink the partition ahead of updating the partition
table.[2] You'd need a bootable microSD card (non-flasher!!) to
perform the resize operation.

Typically, if you are working from an image that has
/opt/scripts/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh[1],
then you'd simply want to run that script on BBB1 to write the image
to a microSD card and then boot that microSD card on BBB2 to write to
the eMMC. This copies the appropriate files, but partitions and
formats the destination eMMC rather than doing a block-by-block copy
that could be why your image doesn't fit.

[1] https://github.com/RobertCNelson/boot-scripts/blob/master/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh
[2] http://lmgtfy.com/?q=shrink+partition+resize2fs

I’d just use tar . . .

Hello William,

how I has to use tar?
Maybe you can give me an example?

Thank you!

Hello Jason,

when I use resize2fs … will the image with dd smaller?
Or did dd always backup the complete eMMC? Because then it doesn´t helps to shrink the partition.

OK, it is DONE!

I followed this site:
https://www.howtoforge.com/linux_resizing_ext3_partitions#-shrinking-an-ext-partition

And was able to shrink the partition … then backup with dd and was able to restore on new BBB.

Thank you to all!