Everything Related To The Beaglebone SBC
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

53 lines
1.2 KiB

  1. BBB New Duplicating Image
  2. # 3-25-2020 Ken. Thank you zmatt.
  3. # For example, if the source is /dev/mmcblk0 and destination is /dev/sda
  4. # Source being SD-Card in BBB and destination being hung off USB port
  5. # ===> Boot off eMMc <===
  6. # Shrink the source:
  7. # First become superuser
  8. sudo -s
  9. e2fsck -f /dev/mmcblk0p1
  10. resize2fs -M /dev/mmcblk0p1
  11. # ^^^ It will tell you how big the filesystem now is in 4K blocks.
  12. # Divide by 1024 and round up to get the size of the filesystem in 4M blocks.
  13. echo 'start=8192,bootable' | sfdisk /dev/sda
  14. # Copy the filesystem to the destination.
  15. # Fill in the correct number of 4M blocks for COUNT from above
  16. dd if=/dev/mmcblk0p1 of=/dev/sda1 bs=4M count=.... conv=fdatasync
  17. # Expand filesystem on destination
  18. resize2fs /dev/sda1
  19. # Copy bootloader
  20. dd if=/dev/mmcblk0 of=/dev/sda skip=1 seek=1 count=8191 conv=fdatasync
  21. # If you want to continue using the old filesystem, Expand it again
  22. resize2fs /dev/mmcblk0p1
  23. # ===> Remove externally mounted SD-Card on USB adapter
  24. # Give the new filesystem a new unique identifier if needed
  25. yes | tune2fs -U random /dev/sda1
  26. # If you want to reboot off internal SD-Card use command
  27. reboot
  28. # All done