We want to use lvm to build raid0 array using amazon ebs, and we are worrying about the data safety. We have known that we need to halt the vm to backup. But we still want to know what will happen when the vm crash, it does could happen. Will the raid0 array survives from a system crash?
2 Answers
If you want safety then don't use RAID 0, software RAID 0 will survive system crash. More important question is how file system integrality will look like after crash, for example under default configuration ext4 with journal and write barriers is quite safe. During unexpected reboot it's possible that you will lose not committed data (so called dirty pages in RAM). Usually its 5-60 seconds of work.
It's hard to predict behavior when we don't know mount options and file system in use.
- 1,461
- 1
- 11
- 24
-
Everything you mention about ext4 is unrelated to the underlying RAID. It would behave just the same on RAID-1. – kasperd Jun 11 '15 at 06:31
-
Yes, but as You know, the safety of the file system depends of the underlying RAID subsystem. I'd say that RAID 0 for backup can be accepted in this scenario. – Michal Sokolowski Jun 11 '15 at 06:56
That depends on what you mean by system crash. If you abruptly reboot the machine running a RAID-0 array disk that is properly set up in mdadm.conf
and fstab
, it will resume work like any other disk, it will be assembled and the partitions will likely be run through a journal replay and/or a fsck
mechanism. If on the other hand you take any one of the component disks from the RAID-0 array and make it unusable, the entire array will be unusable.
- 1,575
- 11
- 17