[Top][All Lists]

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

mv not safe - deletes moved file too soon

From: Ryan Duffy
Subject: mv not safe - deletes moved file too soon
Date: Mon, 8 Nov 2004 08:33:13 -0500 (EST)

System requirements to observe this bug:

a large file to move (e.g. 700Meg ISO image).
large amounts of RAM available for file caching.
2 separate disks of significantly different speed (e.g. one fast internal HDD, 
one fairly slow external HDD).

When I mv the file from the fast disk to the slow one, it is easy to observe 
that the read operation (from the fast disk) can finish a long time in advance 
of the write (to the slow disk). 
When mv has finished reading the file, the file is deleted from the original 
location. However, it is often the case that the write operation continues for 
a long time (even minutes!) after this occurs, as the data to be written is 
held in RAM cache.

This leaves a large window of opportunity for data loss if anything bad happens 
before the file is completely written.
Surely the original file should not be removed until it has been safely and 
completely written to the new location?

Join Excite! - http://www.excite.com
The most personalized portal on the Web!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]