Re: SYNC Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Price Technology wrote:

I had posted a while back asking about writing data immediately to a removable drive, and SYNC was indeed the answer. Thanks to whomever it was that jogged my brain on that one.

My question now is a two parter;

1. Is there a setting that will cause the sync operation to happen automatically at every disk write without me having to enter the command each time ??


Only at the application level. You can use fsync() or open the file O_DIRECT when you write files.

2. Am I cutting my own throat by doing such a thing ?? (ie would it cause performance problems, increase the chance of data corruption, that sort of thing)


Performance will suck. Big time. I mean really really suck. A write will take thousands of times longer to complete. Especially if this is a slow removable disk. It will be slow. Your disk will die of physical exhaustion. Well, maybe not that one, but it will be painful.

To be honest, not everything is finally commited to disk and the disk marked clean until you unmount it. Before you remove any removable device you need to unmount it and then everything gets written back to the disk. If you leave the disk idle for any length of time (say, 30s) then everything except the clean flag will have been written back (which will force an fsck or journal replay next time you mount it).

I missed the earlier part of the thread, but if you need synchronous writes then my guess is that you're either looking for transaction support (which is fair enough) or you're doing something wrong. Sorry if I'm barking up the wrong tree.

Any input much appreciated.

Joebewan








-- Shrike-list mailing list Shrike-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux