I have a computer with 2 hdds, which I want to use for data storage. Initially I wanted to create mirrored zfs pool, but not so much data needs to be stored so safely. So, if I create zfs pool with raid0 vdev and set copies=2 on specific datasets (for example, on which I am going to store family photos or similar), will that be same as having two pools, one mirrored for more critical data, one raid0 for standard data?
1 Answers
No, copies=2 does not give you device redundancy! Do not use copies=2 instead of a mirror vdev!
If a device that is its own vdev (as in RAID 0) fails, you cannot import your pool. All your data would be gone.
There is no benefit at all to using copies=2 instead of a mirror vdev. There are only downsides:
- Slower write performance due to double writes and fragmented seeks.
copies=2doesn't even protect your data that well. Here is an experiment that shows that if a random 0.1% of the disk is corrupted in a pool 85% full, files are still lost.
What should you do instead? You should set up your disks in a mirror (RAID 1) and have a backup to a different pool somewhere else. The backup would be for your extra important files like the family photos you mentioned. Never forget that RAID is not backup.
If your budget really is just two hard drives, I would create two individual pools made of the individual disks and zfs send | zfs receive the important files between the two. This is a bit of a hassle, which is why I only suggest it if you have no other options. It sure is safer than RAID 0 with copies=2.
- 19,971