I know, the title doesn't make sense in many ways, but this trick is neat and I think not enough people know it's possible. Considering it's SO EASY, easier then setting up LVM, more people should know about it to give aufs the attention it deserves.
Everybody ends up with some old hard disk drives. Some are too small and upgraded in your workstation. Others are starting to get unreliable (SMART warnings).
An unreliable drive could work perfectly for another year, but you don't want your important data on it. However, storage is very useful in this media recording era, and media is not as important as your other files.
So if you, like me, stick all your old and unreliable drives in your Media Center, wouldn't it be nice to have them all available under a single mount point? It makes downloading, recording, target assignment and media storage assignment (inside the player) much easier.
First, I started using non-striped LVM (Logical Volume Management) for that. Seems like a good idea. A single mount point for all my stuff. But what the.. it turns out that even without striping, if one disk fails, the entire LVM volume becomes unavailable and broken! Of course, when a drive dies, the media dies with it. But that's no reason to loose all the media on the other drives that are perfectly fine!
So now I am migrating my LVM media to AUFS (Another Union File System). This is like Union File System, but better. Mounted drives (branches) are branched together under a single mount point, and it automatically uses all branches when storing data. You can do exactly the trick I was supposed to do, but now a failing drive won't affect what's stored on the other drives.
For this, you can use built-in aufs like so:
mount -t aufs -o dirs=/mnt/disk1=rw:/mnt/disk2=rw:/mnt/disk3=rw aufs /mnt/aufs
Where disk1, disk2 and disk3 are mounted /dev/sdxx partitions you want to use, and /mnt/aufs is the target branch.
You can put this in /etc/fstab like so:
none /mnt/aufs aufs dirs=/mnt/disk1=rw:/mnt/disk2=rw:/mnt/disk3=rw 0 0 (tested, works)
Be sure the proper drives are mounted first!
This way, it reads from all branches at the same time. For writing, it fills the first branch until full, then it continues on the next one and so on.
Nice, eh?
But wait, I also have some questions myself!
Aufs can do branch balancing. Storing each file on the branch that has the most free space at the time. This is convenient, when a drive dies, it doesn't have a bad luck chance of holding all the data while an empty disk survives.
How do I do this? I can find very little relevant documentation on aufs.
I have two reliable and two unreliable small disks. It would be cool to fill the reliable two up first, and when they are full, start branch-balancing between the two unreliable disks. Is thos possible?
Bookmarks