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.

Create UBIFS writeable

Hi,

1: ubiformat /dev/mtd8 -f ubi.img  -s 2048 -O 2048
2: ubiattach -m 8 -O 2048
3: mount -t ubifs ubi0_0 /mnt/card
4: sync

Now when I try to create a new file in /mnt/card, it fails to create the file
 cat asd > a.txt
-bash: a.txt: No space left on device

what is the reason for this ?

Thanks & Regards,
Mike
  • Hi,

    # df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/root        26G  4.6G   20G  20% /
    devtmpfs        311M     0  311M   0% /dev
    tmpfs           311M     0  311M   0% /dev/shm
    tmpfs           311M  232K  311M   1% /run
    tmpfs           311M     0  311M   0% /sys/fs/cgroup
    tmpfs           311M     0  311M   0% /tmp
    ubi0_0          110M  110M     0 100% /mnt/altroot
    #
    why does it say 100% used ? Is ubifs filesystem read-only ? can we not add files later ?

    Thanks & Regards,

    Mike

  • Mike,

    I will check this and let you know what I am able to find.

    BR
    Pavel

  • Mike,

    Here is what I have:

    Arago 2011.09 dm814x-evm ttyO0

    dm814x-evm login: root
    root@dm814x-evm:~# ls
    root@dm814x-evm:~# cd /
    root@dm814x-evm:/# ls
    bin      dev      home     linuxrc  mnt      sbin     sys      usr
    boot     etc      lib      media    proc     srv      tmp      var
    root@dm814x-evm:/# cd home
    root@dm814x-evm:/home# ls
    root
    root@dm814x-evm:/home# cd roo
    -sh: cd: can't cd to roo
    root@dm814x-evm:/home# cd root
    root@dm814x-evm:~# ls
    root@dm814x-evm:~# df -h
    Filesystem                Size      Used Available Use% Mounted on
    ubi0:rootfs             175.1M     16.3M    158.8M   9% /
    devtmpfs                  1.0M    116.0K    908.0K  11% /dev
    tmpfs                    40.0K         0     40.0K   0% /mnt/.splash
    none                      1.0M    116.0K    908.0K  11% /dev
    tmpfs                    16.0M     32.0K     16.0M   0% /var/volatile
    tmpfs                    98.6M         0     98.6M   0% /dev/shm
    tmpfs                    16.0M         0     16.0M   0% /media/ram
    root@dm814x-evm:~# cat asd > a.txt
    cat: can't open 'asd': No such file or directory
    root@dm814x-evm:~# touch sample.txt
    root@dm814x-evm:~# ls
    a.txt       sample.txt
    root@dm814x-evm:~#

    As you can see from the log, I can create both files (a.txt and sample.txt). I boot everything from NAND, here is the whole boot log: 1263.ubifs_log

    And this is how I create and flash the UBI on NAND:

    root@dm814x-evm:~# ls
    u-boot.bin       u-boot.min.nand  ubi.img
    root@dm814x-evm:~# flash_eraseall /dev/mtd9
    flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
    Erasing 128 Kibyte @ b40000 --  5 % complete flash_erase: Skipping bad block at 00b60000
    Erasing 128 Kibyte @ 19e0000 -- 12 % complete flash_erase: Skipping bad block at 01a00000
    Erasing 128 Kibyte @ c800000 -- 100 % complete
    root@dm814x-evm:~# mtdinfo /dev/mtd9
    mtd9
    Name:                           File System
    Type:                           nand
    Eraseblock size:                131072 bytes, 128.0 KiB
    Amount of eraseblocks:          1601 (209846272 bytes, 200.1 MiB)
    Minimum input/output unit size: 2048 bytes
    Sub-page size:                  512 bytes
    OOB size:                       64 bytes
    Character device major/minor:   90:18
    Bad blocks are allowed:         true
    Device is writable:             true

    root@dm814x-evm:~# ubiformat /dev/mtd9 -f ubi.img -s 512 -O 2048
    ubiformat: mtd9 (nand), size 209846272 bytes (200.1 MiB), 1601 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
    libscan: scanning eraseblock 1600 -- 100 % complete  
    ubiformat: 1599 eraseblocks are supposedly empty
    ubiformat: 2 bad eraseblocks found, numbers: 91, 208
    ubiformat: flashing eraseblock 152 -- 100 % complete  
    ubiformat: formatting eraseblock 1600 -- 100 % complete  
    root@dm814x-evm:~# sync

    pbotev@pbotev:~/mtd$ mkfs.ubifs -r ~/workdir/aragofs/ -m 2048 -e 126976 -c 1601 -o ubifs.img

    pbotev@pbotev:~/mtd$ cat ubinize.cfg
    [ubifs]
        mode=ubi
        image=ubifs.img
        vol_id=0
        vol_size=160MiB
        vol_type=dynamic
        vol_name=rootfs
        vol_flags=autoresize

    pbotev@pbotev:~/mtd$ ubinize -o ubi.img -m 2048 -p 128KiB -s 2048 ubinize.cfg

    Regards,
    Pavel