Help - Search - Members - Calendar
Full Version: Linux caching of files
Linuxhelp > Support > Technical Support
I understand that when I write files to a DVD, they are not necessarily written directly to the DVD but cached somewhere, and when I unmount the DVD then that will force the files to be actually written to the DVD. But I *believe* that sometimes Linux will write from the cache to the DVD before I do the unmount itself.

My problem is that I am sometimes writing very large zip files to the DVD and when Linux does decide to commit them to the DVD from cache, it seems that the i/o takes over much of the system to the detrement of other running processes.

So I am trying to find out as much as I can about how Linux caches the files and what affects how much it will want to cache and what affects when it will decide to flush the files from cache to the DVD (apart from unmount). For example does the mechanism care about how many files there are vs how large the files are.

I am hoping to find out if there is a way to tweak some Linux settings or change how/what files I write soas to better meter out getting the files written to DVD without Linux having to suddenly commit so much resource to the i/o to make that happen.

Appreciate any links, insights, etc others can share.

FWIW, I am using the UDF filesystem when I mount the DVD.
What distribution / version of linux are you running?
Are you using an application or basically dragging / dropping files into the DVD directory.
What type of DVD writer i.e. DVD-RAM, DVD+/-RW etc. Does this drive have hardware packet writing capabilities? Is this an InCD or DirectCD formatted disk?

Yes, linux caches disk writes and during idle times will actually write to the physical device. Umounting will force a buffer flush and write anything pending. I ask all of these questions because typically linux does not have drag / drop write capability to CDs or DVDs. I do not know what the latest is on packet writing capabilities with the latest kernels. cdrecord is typically the backend writer for many GUI apps like k3b. You can add the sync option when mounting to force writing.
I am using Suse 2.4.20-4GB.
I am running a java app that is using buffered file i/o to read a file from the HD and writing it to the DVD. The DVD was formatted using mkudffs and mounted with the UDF fs.

The DVD drive itself it a DVD RAM/R and the media is a DVD-RAM Type II 4.7GB single sided.
I dunno about whether the drive supports packet writing.

I have also found that besides using unmount, I can use mount with the -o remount option which will remount the fs on the drive, forcing the buffer flush without having to actually unmount the drive.

Again, trying to find out if there is anything I can do programming wise or Linux OS setting wise to influence how much file caching is or isn't done, or if its completely out of my hands ..
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.