Beagle Bone Black .img File Size

Beaglebone Black related support

Beagle Bone Black .img File Size

Postby NullDev » 25 Feb 2014, 20:22

I have successfully flashed the .img file to a uSD and booted without much difficulty. However, I'd like to install the .img file to the onboard eMMC flash, but it seems the image file is just slightly too large. I performed the flash using the following command:

Code: Select all
dd if=RuneAudio_bbb_0.2-beta.img of=/dev/mmcblk1 bs=1M


The correct image size should be 1,923,088,384 bytes or less, but instead I find it is 2,041,577,472 bytes. Anything I can do to squeeze a square into a round hole?
NullDev
 
Posts: 16
Joined: 25 Feb 2014, 20:10

Re: Beagle Bone Black .img File Size

Postby NullDev » 25 Feb 2014, 21:40

Well, I guess I should have waited to ask the question for a few hours because I finally solved the .img file size issue. For those that wish to put Rune on the onboard eMMC flash on a BeagleBone Black, follow the steps below:

1. There are 2 scripts which are intended for RPi images, but both seem to work OK for BBB images as well. The script opens the .img file and resizes the root partition to its minimal size (leaving no free space). For what it's worth, I used the 2nd script which created an .img file which is 1,223,225,856 bytes long and can easily fit. Here's a link to either script 1 & script 2.

2. Boot off of a uSD card and burn the image to onboard eMMC flash with the following command (make sure to use the new smaller .img filename):

Code: Select all
dd if=RuneAudio_bbb_0.2-beta.img of=/dev/mmcblk1 bs=1M


3. Linux doesn't much care to run with 0% free space, so we need to expand the onboard / (root) partition to use all available space. There are lots of HOWTO guides on this as most people want to expand images to fit large SD cards. Just remember to modify the instructions to ensure you are operating on the onboard flash and not your uSD card! I followed the instructions here This left 591MB (38%) free on the root partition.

4. You are now free to wipe your uSD card and use it for song storage or remove it all together.

NOTE: In theory you could boot from uSD one last time and do:

Code: Select all
dd if=/dev/mmcblk1 of=RuneAudio_bbb_0.2-beta-correct.img bs=1M


This would generate a correctly sized .img file for future posterity. If I had the ability, I'd host the file myself to save everyone the headache.
NullDev
 
Posts: 16
Joined: 25 Feb 2014, 20:10

Re: Beagle Bone Black .img File Size

Postby ACX » 25 Feb 2014, 22:37

Hi NullDev, thank you for your contribution. We plan to include an easy and one click way to install RuneAudio in the internal memory via RuneUI. In the meanwhile your instructions will be useful for everyone who wants to do it.
User avatar
ACX
RuneAudio co-founder
 
Posts: 1692
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Beagle Bone Black .img File Size

Postby Midnight » 26 Feb 2014, 12:26

Hi NullDev,

it does not matter if the dd command aborts because the image file is to big, as long as the root partition is completely written to the onboard memory. Running cfdisk /dev/mmcblk1 verifies that this is the case.

[root@runeaudiobbb ~]# dd if=/mnt/pub/RuneAudio_bbb_0.2-beta.img of=/dev/mmcblk1 bs=1M
dd: error writing ‘/dev/mmcblk1’: No space left on device
1833+0 records in
1832+0 records out
1920991232 bytes (1.9 GB) copied, 314.464 s, 6.1 MB/s


Code: Select all
     Name           Flags          Part Type    FS Type               [Label]            Size (MB)
 -----------------------------------------------------------------------------------------------------
                                    Pri/Log     Free Space                                    1.05     
     mmcblk0p1      Boot            Primary     vfat                  [boot]                 67.11
     mmcblk0p2                      Primary     ext4                  [root]               1343.23
                                    Pri/Log     Free Space                                  509.61


There is still 509.61 MB free space left.
User avatar
Midnight
Moderator
 
Posts: 141
Joined: 19 Feb 2014, 14:46

Re: Beagle Bone Black .img File Size

Postby NullDev » 27 Feb 2014, 13:49

Thinking back on it, I guess that makes sense since the end of the partition is (hopefully) just zeros and shouldn't matter if it is truncated. The IT guy in me just tends to freak a bit when my command line tools dump errors. Thank you for the insight.
NullDev
 
Posts: 16
Joined: 25 Feb 2014, 20:10

Re: Beagle Bone Black .img File Size

Postby miero » 27 Feb 2014, 21:29

The last image for BBB has following issues:
- the 2nd partition size is much smaller than real ext4 filesystem (1311744 blocks in partition table)
- image is too big for my microSD card (3911680 512-byte logical blocks: (2.00 GB/1.86 GiB))

I had to decrease 2nd partition by resize2fs and fix the partition table.
miero
 
Posts: 2
Joined: 27 Feb 2014, 21:24

Re: Beagle Bone Black .img File Size

Postby miero » 27 Feb 2014, 21:30

NullDev wrote:Thinking back on it, I guess that makes sense since the end of the partition is (hopefully) just zeros and shouldn't matter if it is truncated. The IT guy in me just tends to freak a bit when my command line tools dump errors. Thank you for the insight.


False. Data seems to be in the last sector too.

You can try the following:
Code: Select all
losetup /dev/loop0 RuneAudio_bbb_0.2-beta.img -o $((133120*512))
e2fsck -f /dev/loop0
resize2fs /dev/loop0 452352
losetup -d /dev/loop0
dd if=RuneAudio_bbb_0.2-beta.img of=RuneAudio_bbb_0.2-beta.fixed.img bs=512 count=$((133120+8*452352))
fdisk RuneAudio_bbb_0.2-beta.fixed.img
# delete partition 2
# create new partition 2; confirm default values; fdisk creates partition occuping whole available space
# save & exit


Final size will be 133120*512 + 452352*4096 = 1920991232
miero
 
Posts: 2
Joined: 27 Feb 2014, 21:24

Re: Beagle Bone Black .img File Size

Postby alvin.chee » 10 Oct 2014, 15:45

Just got BBB Rev C loaded with Rune Audio 0.2beta on uSD card.
Renamed the MLO and u-boot.img to something else in eMMC (via laptop connect to BBB via USB mini) to prevent it from booting eMMC so it boots Rune Audio from uSD right away.

Awaiting ACX to release 0.3b for BBB for ease of getting Rune Audio img write into eMMC by UI button!

Cheers !
alvin.chee
 
Posts: 1
Joined: 17 Aug 2014, 11:26

support RuneAudio Donate with PayPal


Return to Beaglebone Black

Who is online

Users browsing this forum: Google [Bot] and 0 guests