To protect data and recover data in case of failures, Linux operating system has built-in MD device that implements RAID architectures. Such device can recover data in case of single hardware failure among multiple disks. But it cannot recover data that were damaged by human errors, virus attack, and disastrous failures. In this paper, we present an implementation of a device driver that is capable of recovering data to any point-intime in case of various failures. A simple mathematical model is used to guide the optimization of our implementation in terms of space usage and recovery time. Extensive experiments have been carried out to show that the implementation is fairly robust and numerical results demonstrate that the implementation is optimal.