Why must I sync?

Discussion in 'OT Technology' started by Peyomp, Mar 29, 2006.

  1. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Round about Linux kernel 1.1, I once ran into a problem with a file copy not actually completing. The inodes weren't updated. Something. I can't even remember. But I read about sync.

    And I started using it at the end of every set of commands I issued from the command line. From the virtual terminals that I haven't used in years. Maybe it was from the glowing green AT&T dumb terminal in my parents' basement with the lights off and tin-foil over the windows so no light got in, and from which I never emerged. Sync fixed my problem. Some point 10 years ago it become pointless. But I can't let go.

    Now, I don't feel complete if I don't sync. I HAVE to sync. It makes me feel satisfied that my operations are complete. No sync, no satisfaction.

    But there's no point anymore. It does nothing for me. But I still do it. I'm compelled. Its my favorite fucking command. I love it. I can't let go. Why must I sync?
     
  2. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    NAME
    sync - commit buffer cache to disk.
    SYNOPSIS
    #include <unistd.h>

    void sync(void);
    DESCRIPTION
    sync first commits inodes to buffers, and then buffers to disk.
    CONFORMING TO
    SVr4, SVID, X/OPEN, BSD 4.3
    SEE ALSO
    bdflush(2), fsync(2), fdatasync(2), update(8), sync

    NAME
    fsync, fdatasync - synchronize a file's complete in-core state with that on disk
    SYNOPSIS
    #include <unistd.h>

    int fsync(int fd);

    int fdatasync(int fd);
    DESCRIPTION
    fsync copies all in-core parts of a file to disk, and waits until the device reports that all parts are on stable storage. It also updates metadata stat information. It does not necessarily ensure that the entry in the directory containing the file has also reached disk. For that an explicit fsync on the file descriptor of the directory is also needed.

    fdatasync does the same as fsync but only flushes user data, not the meta data like the mtime or atime.
     
  3. bandwagon

    bandwagon Copy/Paste

    Joined:
    May 27, 2005
    Messages:
    1,501
    Likes Received:
    0
    Its over. Let it go.
     
  4. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Like I said, I can't.
     
  5. EvilSS

    EvilSS New Member

    Joined:
    Jun 11, 2003
    Messages:
    5,104
    Likes Received:
    0
    Location:
    STL
  6. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    You mean I'm and obsessive compulsive syncer?
     
  7. EvilSS

    EvilSS New Member

    Joined:
    Jun 11, 2003
    Messages:
    5,104
    Likes Received:
    0
    Location:
    STL
    Yes, but there is treatment. You can be cured!
     
  8. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    I don't wanna be cured. I love sync. You should try it sometime you know... its pretty damned good. The first time is free.
     
  9. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    You're addicted to the comfort 'sync' gives you, every time you use it, that you won't lose something important if the power goes out. It's kind of like how some people are with Jesus vs. death.
     
  10. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Or some people with crack.
     
  11. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Yeah, but being on crack only protects them against not being on crack. That's why I didn't use the drug comparison. Your addiction is much worse, because there's actually a justifiable reason for having started in the first place.
     

Share This Page