ubimkvol killed and kernel crashed

Sri Charan Chalasani sricharan.chalasani at yahoo.com
Thu Dec 6 02:23:11 EST 2012


Hi all,

We are basically trying to mount our inbuilt NAND flash device and write some files onto it using UBI/UBI-FS.

After running some of the following steps successfully, the linux kernel crashed after running ‘ubimkvol’.

Please help me if I am doing something wrong in any of the steps below which is causing ubimkvol to be killed.  


Flash Size                            :    800 MB
Linux Kernel Version              :    3.1.14
Page size                             :    8192
Physical Erase Block Size    :    1MiB ( We are taking)


These are the steps we are following:

1. Create ubifs image by using mkfs.ubifs command

 #mkfs.ubifs -v -r rootfs -o ubifs.img -m 8192 -e 1032192 -c 788

 Description:

 We are taking Physical Erase Block (PEB) size as 1048576 bytes(1MiB)

        -e -- Erase Block Size

         e = (1048576 - 2 * 8192) = 1032192 bytes

        -c --The maximum size, in LEBs, of this file system

         c = 788(see the below calculation)

         PEB Size (SP) = 1048576

         LEB Size (SL) =  1048576 - 2 * 8192 = 1032192

         Total Flash Size = 800 MiB

         Total number of PEBs on the MTD device (P) = 800 MiB/1048576 = 800

         Number of PEBs reserved for bad PEB handling(B) is 1% of P = 8

         The overhead related to storing EC and VID headers in bytes
                               i.e. O = SP - SL = 1048576 - 1032192 = 16384.

         UBI Overhead =  (B + 4) * SP + O * (P - B - 4)

                     =  (8 + 4) * 1048576 + 16384(800 - 8 -4)

                     =  ~24

         Available PEB's = 800 - 24 = 776 PEB's.

         Calcultion of 'c' = ((Available PEB's)*PEB)/LEB

                          = (776 * 1048576)/ 1032192

                          = ~ 788 LEB's.

2. Create ubinize.cfg file and write the contents into it

       # vi ubinize.cfg

            [ubifs]
            mode=ubi
            image=ubifs.img
            vol_id=0
            vol_size=512MiB
            vol_type=dynamic
            vol_name=rootfs
            vol_flags=autoresize

       give ubinise command

     #ubinize -o ubi.img -m 8192 -p 1MiB  ubinize.cfg -v

       m = 8192 page size.

       p = 1MiB physical erase block

3. Flash_Erase: Prepares NAND partition; MTD partition 3 needs to be erased
    and used for UBI file system.

       # flash_erase /dev/mtd3 0 0

        (0 0) - indicates erases the memory from available first LEB to last LEB

        It displays the following message :

        Erasing 1024 Kibyte @ 31f00000 -- 100 % complete

4. UBI Formatting :Flash the UBI file system image (ubi.img) to MTD partition "3"

       # ubiformat /dev/mtd3 -f ubi.img

5. Ubiattach: Attach MTD device to UBI

        # ubiattach /dev/mtd3 -f ubi.img

6. ubimkvol : Create an UBI volume - the created volume will be empty

        # ubimkvol /dev/ubi0 -N ubifs_volume -m

         It displays the following message :

         Set volume size to 813367296

         Killed

        (log of ubimkvol is attached please find it for further reference)

        The kernel crashed after running this step.

Thanks in advance,
Charan.









 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20121205/601ee20c/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ubimkvol_log.txt
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20121205/601ee20c/attachment-0001.txt>


More information about the linux-mtd mailing list