Cloning Beaglebone fails running out of space

After backing up eMMC contents to SD card and then restoring via method similar to mentioned in http://elinux.org/BeagleBone_Black_Extracting_eMMC_contents, booting from a SD card and using dd to write to eMMC I have issue with failed write with error “Out of disk space” being reported.

Firing up two Rev C cards, one from Mouser and one from Element14 show following differences running fdisk /dev/mmcblk0

`
Disk /dev/mmcblk0: 3925 MB, 3925868544 bytes
4 heads, 16 sectors/track, 119808 cylinders, total 7667712 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 198655 98304 e W95 FAT16 (LBA)
/dev/mmcblk0p2 198656 7553023 3677184 83 Linux

Disk /dev/mmcblk0: 3867 MB, 3867148288 bytes
4 heads, 16 sectors/track, 118016 cylinders, total 7553024 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 198655 98304 e W95 FAT16 (LBA)
/dev/mmcblk0p2 198656 7553023 3677184 83 Linux
`

Now as luck would have it (and I actually do consider failure at this point as good luck) I created the image on BBB reporting larger disk size.

Now maybe I am misinterpreting error message and disk sizes but it does tie up with error message.

Does anyone have any experience with this or suggested solution? While it would be ideal if all 4GB flash memories were the exact same size I assume this is not possible and one would have to build some buffer in and reduce/truncate the image size without destroying data integrity.

Appreciate any help/suggestions.
Colin

One's probally Micron, other Kingston...

You can try resizing the *.img manually with gparted and other tools.

This is why i prefer the rsync approach vs dd...

Regards,

Thanks Robert, I assume when using rsync method that you boot the BBB’s eMMC that you want to clone and then run the “beaglebone-black-make-microSD-flasher-from-eMMC.sh” script as opposed to executing script after booting up from a SD card - is this correct?

If so, what about any changes to ‘source’ files while running rsync? Can this not be an issue as you are syncing a live system - this is one of the reasons why I thought it best to boot from a SD card first.

I do like the idea rsync vs dd for exact issue I am experiencing.

~Colin

Yes, we originally did run into some issues if the source was
changing.. (May 2014 bb.org debian release)

All current eMMC flasher's do it in single user mode now

https://github.com/RobertCNelson/boot-scripts/blob/master/tools/eMMC/init-eMMC-flasher-v3.sh

(this was changed mid 2014)..

If your image (cat /etc/dogtag) is after Sep 2014, just do:

cd /opt/scripts/tools/eMMC/

git pull

./beaglebone-black-make-microSD-flasher-from-eMMC.sh

If you look at the script close enough:

https://github.com/RobertCNelson/boot-scripts/blob/master/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh#L366

There's a few things you can all tune/override via "/boot/SOC.sh"

Regards,

Much appreciated, thanks!

I haven’t dug in yet but when trying to execute git pull from within /opt/script/tools/eMMC I get the following error message:

root@mydevice:/opt/scripts/tools/eMMC# git pull error: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none while accessing https://github.com/RobertCNelson/boot-scripts/info/refs fatal: HTTP request failed

/etc/dogtag shows:

`
root@BioChargerNG:~# cat /etc/dogtag
BeagleBoard.org Debian Image 2015-03-08

`

~C

odd? is your clock up-to date? (systemd-timesyncd) should be taking care of it..

github hasn't mentioned anything...

https://status.github.com/messages

Regards,

Date and time are definitely correctly and just checked again. I am still getting the same error if running git pull from /opt/scripts/tools/eMMC but if I run from /opt/scripts it works.

Should I be running git pull from eMMC directory or from scripts directory?

~C

I will create another BBB from scratch and check, but after running git pull from /opt/scripts I can now run it from /opt/scripts/tools/eMMC??

Maybe it’s just been too long of a week…