繁体   English   中英

写入错误:嵌入式Linux中的设备上没有剩余空间

[英]write error: No space left on device in embedded linux

我所有的都有一块嵌入式板,运行linux OS。 我使用yaffs2作为rootfs。 我在上面运行了一个程序,但是一段时间后,出现错误“错误设备上没有剩余空间”。 但是我检查了闪光灯,仍然有很多可用空间。 我只是写一些配置文件。 配置文件很少更新。 程序将向闪存写入一些日志。 日志大小限制为2M。 我不知道为什么,以及如何解决。 请帮帮我!(我的母语不是英语,对不起。希望您能理解我的意思)

一些调试信息:

    # ./write_test 
    version 1.0
    close file :: No space left on device
    return errno 28
    # cat /proc/yaffs 
    YAFFS built:Nov 23 2015 16:57:34


    Device 0 "rootfs"
    start_block........... 0
    end_block............. 511
    total_bytes_per_chunk. 2048
    use_nand_ecc.......... 1
    no_tags_ecc........... 1
    is_yaffs2............. 1
    inband_tags........... 0
    empty_lost_n_found.... 0
    disable_lazy_load..... 0
    refresh_period........ 500
    n_caches.............. 10
    n_reserved_blocks..... 5
    always_check_erased... 0
    data_bytes_per_chunk.. 2048
    chunk_grp_bits........ 0
    chunk_grp_size........ 1
    n_erased_blocks....... 366
    blocks_in_checkpt..... 0

    n_tnodes.............. 749
    n_obj................. 477
    n_free_chunks......... 23579

    n_page_writes......... 6092
    n_page_reads.......... 11524
    n_erasures............ 96
    n_gc_copies........... 5490
    all_gcs............... 1136
    passive_gc_count...... 1136
    oldest_dirty_gc_count. 95
    n_gc_blocks........... 96
    bg_gcs................ 96
    n_retired_writes...... 0
    n_retired_blocks...... 0
    n_ecc_fixed........... 0
    n_ecc_unfixed......... 0
    n_tags_ecc_fixed...... 0
    n_tags_ecc_unfixed.... 0
    cache_hits............ 0
    n_deleted_files....... 0
    n_unlinked_files...... 289
    refresh_count......... 1
    n_bg_deletions........ 0

    Device 2 "data"
    start_block........... 0
    end_block............. 927
    total_bytes_per_chunk. 2048
    use_nand_ecc.......... 1
    no_tags_ecc........... 1
    is_yaffs2............. 1
    inband_tags........... 0
    empty_lost_n_found.... 0
    disable_lazy_load..... 0
    refresh_period........ 500
    n_caches.............. 10
    n_reserved_blocks..... 5
    always_check_erased... 0
    data_bytes_per_chunk.. 2048
    chunk_grp_bits........ 0
    chunk_grp_size........ 1
    n_erased_blocks....... 10
    blocks_in_checkpt..... 0

    n_tnodes.............. 4211
    n_obj................. 24
    n_free_chunks......... 658

    n_page_writes......... 430
    n_page_reads.......... 467
    n_erasures............ 7
    n_gc_copies........... 421
    all_gcs............... 20
    passive_gc_count...... 13
    oldest_dirty_gc_count. 3
    n_gc_blocks........... 6
    bg_gcs................ 4
    n_retired_writes...... 0
    n_retired_blocks...... 0
    n_ecc_fixed........... 0
    n_ecc_unfixed......... 0
    n_tags_ecc_fixed...... 0
    n_tags_ecc_unfixed.... 0
    cache_hits............ 0
    n_deleted_files....... 0
    n_unlinked_files...... 2
    refresh_count......... 1
    n_bg_deletions........ 0
    # 

日志和配置文件存储在“数据”中。 谢谢!!

通常,这可能是您的磁盘空间(这里是Flash),首先使用df -h(或您拥有的其他命令。.BusyBox中存在df)检查您的闪存空间。 但是,如果您的闪存空间(特别是在程序分区上)没问题,则可能是您的“ inode”(目录)空间问题,您可以使用df -i命令查看您的inode用法。
(对此的一个很好的链接: https : //wiki.gentoo.org/wiki/Knowledge_Base : No_space_left_on_device_while_there_is_plenty_of_space_available

如果不是这些原因,那么我认为您必须更深入地了解代码,尤其是在处理磁盘I / O时! 还要提一下,要注意内存和堆空间并释放函数中所有分配的空间。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM