You are not logged in.

#1 2012-04-30 17:02:24

zenten
Member
Registered: 2012-03-27
Posts: 25

Is there a way to disable program sync calls for filesystem writes?

First of all I'm only 80% sure I know what I'm talking about with some of these terms regarding how the kernel handles file operations.  If I get something wrong pointing me to documentation to help me understand would be appreciated.

So I'm setting up Arch on a USB key as sort of a rescue disk/use Linux when I'm not allowed to install install Linux on the computer (like at my inlaw's house) solution.  I'm still early enough in the process that starting over is fine.  I'm going to be using this for a full Arch system, that does things like run pacman updates and a very lightweight Xorg GUI setup.

Right now I'm going with btrfs, but some other file system that's at least as stable would be fine as well.

One of the things I'm wanting to have for this is to have as few rewrites to the USB key as possible, while at the same time be workable on computers that have limited RAM.  I'm thinking that if I could tell the kernel to only write to the USB key when it has to, such as running out of memory, unmounting, or shutting down, then that would be one way to accomplish that.  Is there any way to do that?  I would prefer it to be something I can set when I mount a given drive, but if it has to be system wide that would be acceptable as well as long as I could still sometimes run a swap file properly on the computer's hard disk (if I'm in a situation where I am able to do so).  The important thing is that the individual programs don't actually write to the disk when they send a sync call to the kernel, because I'm thinking most programs won't be able to be configured to work the way I want them to directly.

I understand that this means I would lose everything "written" since the last flush to the drive, but that's fine by me.  Having a way to explicitly have me (as root) say "OK, now flush changes to disk" would be useful as well, but not necessary.

Offline

Board footer

Powered by FluxBB