This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What happens when the file system size of boot partition is smaller than the partition size?

Other Parts Discussed in Thread: DM3730

I'm trying to make a boot partition for DM3730 on a MMC card.


I first made a loop device image and then fill files to it, so that I can have a file system image when I'm done.

When I was trying to write the image to an actual MMC card, I was wondering whethter I need to make the target partition exactly the same size as the image, and I asked this question at StackOverflow, and I was convinced that I could make the image smaller than the target partition.

http://unix.stackexchange.com/questions/227308/how-to-copy-burn-a-loop-device-image-to-a-partition/227326#227326

However, after I write the image to the target MMC partition, my DM3730 board won't boot. Then I came across this wiki page

http://elinux.org/Panda_How_to_MLO_%26_u-boot

The test program at the end suggests that, if size of the file system size(BPB value) does not equal to partition size(MBR value), then the rom code won't bootthe CPU.

In my case, when boot partition size is 40141KB and file system size is 40000 size, then it won't boot. But if they are both 40141KB, then it boots.

Is this a feature in the DM3730 boot rom code that it checks those two values as a indication of file system corruption?

  • Hi,

    In my case, when boot partition size is 40141KB and file system size is 40000 size, then it won't boot. But if they are both 40141KB, then it boots.
    Is this a feature in the DM3730 boot rom code that it checks those two values as a indication of file system corruption?

    Not able to boot means, you are not getting any prints from bootloader or not able to mount filesystem ?
    Sorry, I am not able understand the boot partition and filesystem.
    Typically we have booting binaries like UBL/MLO/SPL & u-boot will be present in "boot partition" and filesystem contents like "rootfs"will be in "rootfs"partition.
    But here, you are talking boot partition with filesystem.
    Can you please elaborate a bit on this and draw a picture for this partition information ?

    Also can you please change the size of the filesystem size to 30000KB and boot partition size to >=30000KB and try.

    I have worked with legacy DM355 processor, there we need booting binaries in binary format on SD card and not with FAT partition as most of the processors doing now.
  • By "not booting" I mean nothing shown on the screen. From my experience that means booting sequence failed before u-boot was started.

    My MMC card has exactly the same layout as you have described, but the way I make it is different.

    My MMC card has a "boot partition" in FAT32 format, that contains MLO/u-boot/uImage/boot.scr, and a "rootfs" ext3 partition that contains the root file system to be mounted by the kernel.

    For I need to make the MMC card in a "production" way, I'm trying to archive the "boot partition" and "rootfs partition" as partition images, and write those images to a MMC card when needed, much like how a .iso DVD images of PC Linux distros are written to a USB thumb drive.


    What I'm having problem now is the "boot partition". The image for this partition is 40000KB. I write this image to a MMC card partition by doing `cat ./boot.img > /dev/sdc1` where`boot.img` is the image and `sdc1` is the first partition of the MMC card.

    After this, `/dev/sdc1` will have a fat32 file system the exactly the same as if `boot.img` were mounted as a loop device, by command like `mount -t vfat -o loop ./rootfs.img  /tmp_root `.


    The problem happens when `/dev/sdc1` is larger than 40000KB, in my case, 40131KB, the then booting sequence would fail.


    I can either shrink `/dev/sdc1` to exactly 40000KB, or grow `boot.img` to 40131KB, they should both work. I tried the latter, and it did.

  • Hi,
    Thanks for the detailed explanation. Understood.
    I think, RBL was not able to read that image if size will be more than 40MiB.
    Can you please decrease the size from 40MiB (=< 40000KB) and check the same.
    It may has some CRC check when you create as image (.img).