On Fri, Aug 01, 2014 at 11:18:47AM -0400, Assaf Gordon via Digitalmars-d wrote: > Sorry to hijack the thread, but: > > On 07/31/2014 09:27 PM, Walter Bright via Digitalmars-d wrote: > > > >If you're brave and want to have some fun, fill up your hard disk so > >it is nearly full. Now run your favorite programs that read and write > >files. Sit back and watch the crazy results (far too many programs > >assume that writes succeed). Operating systems also behave > >erratically in this scenario, hence the 'brave' suggestion. > > > > If anyone is interested in simulating I/O errors and nearly-full file > system on Linux, I can suggest the following scripts: > > http://git.savannah.gnu.org/cgit/datamash.git/tree/build-aux/create_corrupted_file_system.sh > > http://git.savannah.gnu.org/cgit/datamash.git/tree/build-aux/create_small_file_system.sh > > The scripts create two ext3 images which can be mounted, and simulate > I/O errors. > One simulate file system with corrupted files (so "open" and the first > "read" will succeed, but later "read" will fail with EIO), > and the other simulate a tiny filesystem, so that the first few > "writes" will succeed, but "write" of >40KB will fail with ENOSPC. > > The scripts themselves don't require root, but you'll need root to > mount the images. > > As Walter said, it's alarming how many programs fail to handle such > cases (though D is pretty solid in that regard). [...]
Very nice! Thanks for sharing. I will keep this in mind next time when I want to stress-test my program. :-) T -- Век живи - век учись. А дураком помрёшь.
