0

I am trying to flash a custom image from my SD card (mmcblk0) onto the emmc (mmcblk1) of my BeagleBone.

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT mmcblk0 179:0 0 14.9G 0 disk ├─mmcblk0p1 179:1 0 96M 0 part ├─mmcblk0p2 179:2 0 3.5G 0 part / └─mmcblk0p3 179:3 0 9.8M 0 part mmcblk1 179:8 0 3.6G 0 disk mmcblk1boot0 179:16 0 2M 1 disk mmcblk1boot1 179:24 0 2M 1 disk 

I try to run this command but it says there is no space left on my emmc -

sudo dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=4M status=progress 3825205248 bytes (3.8 GB, 3.6 GiB) copied, 306 s, 12.5 MB/s dd: error writing '/dev/mmcblk1': No space left on device 913+0 records in 912+0 records out 3825205248 bytes (3.8 GB, 3.6 GiB) copied, 306.278 s, 12.5 MB/s 

But the image I want to copy is less than 3.6GB in total -

df -h Filesystem Size Used Avail Use% Mounted on udev 10M 0 10M 0% /dev tmpfs 100M 4.2M 96M 5% /run /dev/mmcblk0p2 3.4G 2.8G 454M 87% / tmpfs 249M 0 249M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 249M 0 249M 0% /sys/fs/cgroup /dev/mmcblk0p1 96M 31M 66M 32% /boot/uboot /dev/mmcblk0p3 9.8M 18K 9.8M 1% /usb_drive 

My SD card size is almost 15GB and I guess that is the reason it says there is no space left on the device. It is trying to copy the whole of 15GB. I also tried to individually copy just the mmcblk0p2 to my mmcblk1, removed the SD card and tried to boot from the emmc using the command -

sudo dd if=/dev/mmcblk0p2 of=/dev/mmcblk1 bs=4M status=progress 

But it does not work. The User LEDs do not turn on at all. How do I get the image to boot from the emmc? Thank you.

6
  • Take a step back. The filesystem inside your mmcblk0p2 is mounted at / not as read-only. mmcblk0 includes mmcblk0p2, so copying it sequentially when the filesystem can be written to may result in a copy that is incoherent with itself; a "binary panorama fail", we may say. Commented Jan 7 at 21:56
  • mmcblk0 179:0 0 14.9G 0 disk looks much larger than 4G to me Commented Jan 7 at 23:32
  • @Jasen but the parts that make up the image (mmcblk0p1,mmcblk0p2 and mmcblk0p3) are less than 4G. I want to copy those to the internal emmc and make the BBB boot from it. Commented Jan 7 at 23:35
  • maybe you have already succeeded, maybe not it depends how the partitions are organised. Commented Jan 7 at 23:39
  • Instead of copying the whole disk, you should partition mmcblk1 similar to mmcblk0 and then copy the (read only mounted) partitions one by one. Then you probably have to mess with uboot uEnv.txt fstab so that they all point to the target disk, preferably by UUID not by device name which changes... and it might be a good idea to change the uuid's too. Commented Jan 8 at 2:29

1 Answer 1

0

Use fdisk to confirm that the partitions are located at the start of the mmcblk0. possibly you will need to use gparted to rearrange them to make this so.

mount / read-only so that you don't end up with an inconsistent copy of it.

Use a size-limited dd that covers the portion of mmcblk0 that contains the partition table and the partitions, or just let it hit the end.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.