5

I just experienced data loss, so I am interested in some form of data duplication. I was thinking of mdadm and companions to raid 1 through software. However, I just want a given, not too big directory to be covered. I have no real experience with this sort of tools, however I understand that both LVM and mdadm require real block devices which therefore must be cleared of any existing data. That's not what I want. Of the 16Gb of my usb flash drive I just want to duplicate a tiny fraction, say 10Mb, possibly on a smaller usb flash drive, say 1Gb. Something that saves me to do a cron rsync. I am stuck at this point. So:

  1. Is there some other tool which will work like raid 1 but using logical directories as a backend, rather than block devices (drives, partitions etc...)?
  2. Alternatively, I could employ mdadm if only I could make look directories as block devices to the OS, reminiscent of a loop device. However, I do not want to pack the target directory inside, say, an image file, because this is clumsy (it is annoying to resize it if it grows in size) and not portable (I happen to work on many different OSes, Microsuck too: when I plug the usb flash inside a Win Os, I want to be able to access the target directory).

2 Answers2

5

The ghetto way of doing this would be to set up a cron job which rsyncs the data to a backup directory every minute.

Alternatively, you could create two normal directories, then use ChironFS with FUSE to mount a filesystem which uses them as replicas - writes through the ChironFS mount would write to both directories. That would give you exactly what you want, although it would involve installing some random software.

Tom Anderson
  • 1,008
  • Thanks, ChironFS is exactly what I fancied about in point 1) of my post. I am not proud of my googling abilities :) Now I am gonna de-orphan Chironfs Wikipedia page to better disseminate the knowledge you passed me. Solution 2) of my post would have been even cooler, though not being knowledgeable in the subject, I don't know how much feasible it is. – user495100 Jun 10 '11 at 17:37
0

This is a feature that is eventually planned for the btrfs filesystem, but for now, you are stuck with the cron sync or similar method.

psusi
  • 17,303
  • Interesting, could you elaborate on that? Or give links? Specifically, what feature are you talking about? Looping a directory or raiding a directory? Anyway if limited to btrfs, it would break portability to the average M$ pc one meets on his way. – user495100 Jun 07 '11 at 14:05
  • 1
    ZFS can do this already (since 2006, in fact), using ditto blocks. – Tom Anderson Jun 07 '11 at 16:21
  • @user495100, the ability to set different raid levels on different files/directories in the fs. Just google for btrfs and read the wiki. Yes, ZFS has had the ability, but is not a supported Linux fs, which is one of the reasons for developing btrfs. – psusi Jun 07 '11 at 17:48