Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8355915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:00:37+00:00 2026-06-09T10:00:37+00:00

I have an embedded Linux app that writes to a file at a fairly

  • 0

I have an embedded Linux app that writes to a file at a fairly slow rate (50 bytes/s or so). The file is on a hard drive, XFS filesystem. The file is being written to by calling write(), not fwrite().

If I power-cycle the system and check the file, over a minute’s worth of data is missing. I thought the default Linux behaviour was to sync the disk cache every 5s (I can tolerate 5s worth of missing data so they’d be no problem with this). What should I be checking to see why it isn’t getting synced for a long time? /proc/sys/vm/dirty_writeback_centisecs is 500. Are there other changeable things I should be checking? It definitely looks to be a disk cache issue – if i ls -l the file, the size is as expected, and after the power cycle it is less than before.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:00:40+00:00Added an answer on June 9, 2026 at 10:00 am

    Mmm, I’m not sure about the 5s as “default in Linux”. As far as I know the delay is filesystem dependant, although maybe I’m mistaken. I believe the maximum delay for cache sync on XFS is (or at least was a while ago) 30 seconds. That figure of 5 seconds was true for some older filesystems (ext2 and ext3 I believe) and it doesn’t hold true for ext4, if I recall correctly.

    In conclusion, what is happening to you is the expected behaviour.

    If you want to surpass the cache, I believe you will need to use fsync, O_SYNC or O_DIRECT. Or apply the ‘sync’ option when mounting the filesystem, which should solve the problem globally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several embedded linux systems that I want to write a 'Who's Online?'
I have a SAM9 based board running embedded linux. I had a JFFS2 file
I have an application that runs on embedded linux (older kernel, 2.6.18). I'm using
So I have an embedded Linux device that is connected to a motor controller
I have a flash drive device (/dev/sda1) mounted to /mnt on an embedded linux
I have an system running embedded linux and it is critical that it runs
I have application running for hours in embedded Linux, when suddenly the OOM Killer
I have a Node.js web server running on an embedded Linux system. For authentication
Background of project -> I have to upgrade the Linux embedded system remotely. This
I have embedded a JTextArea on a JScrollPane and am using that JTextArea for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.