linux - 写入错误 : No space left on device in embedded linux

标签 linux system embed

全部 我有一个嵌入式板,运行 linux 操作系统。我使用 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
    # 

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

最佳答案

一般来说,这可能是您的磁盘空间(此处为闪存),首先使用 df -h(或您拥有的其他命令……df 存在于 BusyBox 中)检查您的闪存空间。但是如果你的闪存空间(特别是在你的程序分区上)没问题,这可能是你的“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! 还值得一提的是,请注意内存和堆空间,并释放函数中所有分配的空间。

关于linux - 写入错误 : No space left on device in embedded linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35033856/

相关文章:

linux - 如何通过带有参数的 ssh 执行远程命令?

firefox - Soundcloud 在 Firefox 中嵌入失败

c++ - 在 Linux 上管理共享库的常用方法是什么?

linux - 带有特殊字符的 sed

android - 如何获取Android系统颜色?

c++ - 如何获取 C++ 中的包版本? (Linux)

c# - 错误 : Help D: System. IO.IOException:进程无法访问该文件,因为它正被另一个进程使用

C# 在你的 winforms 中嵌入 youtube/videos

html - 如何在 <object> Embed 上获得 height=100%

linux - 如何指定 sshfs 的 key 文件?