Partition size when flashing from eMMC to sd

Hello!

I write the eMMC with the command beagle-flasher to sd card, to flash another BeagleBone Black with this sd card.
I made a copy from the sd card as .img to my PC, for a backup.

Querstion: It seems it used always the full sd card (currently 128GB). But the eMMC has just around 4GB. Is there a way to set the partition on the sd card to the size of the eMMC?
I found this here:

But it’s 4 years old. So how is this with the current version?

Thank you!

The script doesn’t check or handle partition system size differences.. it just uses rsync to ‘try’ to copy the data.. so if your used size is less then 4, should be fine.. newer images use a fat, swap and rootfs partition, so it’s harder to squeeze that back down to 4gb

At the moment I’m trying to shrink the partition on a 128 GB SD card.

From what I understand, the script currently creates a partition that uses the full size of the SD card, so I end up with a 128 GB partition. However, the actual content that needs to be stored (copied from the eMMC) only requires about 5 GB.

Is there a way to set a smaller partition size on the SD card instead of automatically using the full capacity?

I’d like the SD card to have only a ~5 GB partition, since that’s enough for the data.

Boot on another device and resize the ext4 partition. Really all you need is the files on the partition, not the partition, could be another way to backup…

This would have to be done offline…

e2fsck -f /dev/sda1
resize2fs /dev/sda1 [new_size]
1 Like

ok, I thought the script create the partition. Shrink is done. Thank you