If performance is very important together with redundancy, it is possible to create a persistent RAM disk. Getting immense speed and keeping data after system reboot is the advantage. Linux has support for exposing a portion of the RAM memory by using the /dev/ram devices. This kind of block device can be used together with a regular disk partition (e.g. /dev/sdb1) when creating a RAID volume. The RAM disk gives the speed and the other disk gives persistence. What’s important is that the array’s primary device is the RAM disk, otherwise the speed boost isn’t achieved. The primary device is the device that at a given point in time defines what data the other disk should replicate (the first device specified to the mdadm tool below).
The default RAM disk size in Linux is 4096 kB. That is too small so it needs to be changed in the kernel. I tested this with a 1000MB RAM disk (1024000 kB). The kernel option CONFIG_BLK_DEV_RAM_SIZE can be found here:
Device Drivers —> Block devices —> Default RAM disk size (kbytes)
Creating the persistent RAM disk (assuming /dev/ram0 and /dev/sdb1 have the same size): mdadm --create /dev/md1 --level=raid1 --raid-devices=2 /dev/ram0 /dev/sdb1
After reboot the RAM disk is blank. This means that the array needs to be started with only a single member. Then when adding the RAM disk to the array the system restores its data. To get the order right (to get proper speed), the regular disk is removed making the RAM-disk the primary. Finally it is added back again and becomes a secondary device.
The –run option to mdadm tells the tool to start the array even if only a single device is specified: $ mdadm --assemble --run /dev/md1 /dev/sdb1
$ mdadm /dev/md1 --add /dev/ram0
$ sleep 60 # wait for the RAM disk device to become active in the raid
$ mdadm /dev/md1 --fail /dev/sdb1
$ mdadm /dev/md1 --remove /dev/sdb1
$ mdadm /dev/md1 --add /dev/sdb1
[^] # Re: FUSE
Posté par warwick . En réponse au message Déléguer une requête à un driver pré-existant. Évalué à 2.
Pour appuyer la chose, sans aller jusqu'au noyau cependant, il semble y avoir une solution purement userspace avec mdadm:
(http://www.technotes.se/?p=1732)