5

I've searched, and I think I understand, but just want to verify that I have the right concept.

I am building a new PC, and want to set up the old one as a file server. Ultimately, I would like two "drives" (volumes? pools?), both with redundancy. One for the OS, and the rest for the media.

Drives:

  • 5 x 1.0TB
  • 2 x 1.5TB
  • 1 x 2.0TB

Can I partition like this:

  • 1.0TB
  • 1.0TB
  • 1.0TB
  • 1.0TB
  • 1.0TB
  • 1.0TB + 0.5TB
  • 1.0TB + 0.5TB
  • 1.0TB + 0.5TB + 0.5TB

Then:

  1. Combine all 1.0TB partitions into a single raid-z with 7.0TB usable capacity
  2. Combine two 0.5TB partitions into two mirrors, with 0.5TB usable each
  3. Pool the 7.0TB raid-z with a 0.5TB mirror for 7.5TB usable
  4. Use the remaining 0.5TB mirror for the OS

Is my thinking correct? Is there a better way of doing this?

I know that, assuming this method is optimal, I wouldn't create a mirror using both 0.5TB partitions on the single 2.0TB drive. I would need to use one for each mirror, or I'd be defeating the purpose of a mirror :)

0

1 Answer 1

6

The thing that strike me most in your case is the partitioning. That is a disk might be used by more than one vdev (aka group), which is of course a major risk, but I understand perfectly that this is an old PC giving a new life as a NAS (I have one at home as well).

There is no major loophole in your schema, except that:

  • a pool can be composed of different type of vdev but it is not recommended (at all)
  • raidz2 should be used starting with 6 disks. Either you divide your data pool into 2x 4-disks raidz or you go for 1x 8-disks raidz2
  • you need to be extra-careful in assigning the disks into the vdev ;)

Here are some best practices (details here) regarding the building of groups:

  • Start a single-parity RAIDZ (raidz) configuration at 3 disks (2+1)
  • Start a double-parity RAIDZ (raidz2) configuration at 6 disks (4+2)
  • Start a triple-parity RAIDZ (raidz3) configuration at 9 disks (6+3)
  • The recommended number of disks per group is between 3 and 9. If you have more disks, use multiple groups (vdev).

If I may add, keep in mind as well that your system will eventually evolve. You might want to be able to replace disks by bigger ones which would only be possible if your group are not too big (or you'll end up in having to get 8 new disks before being able to get some more space from your data pool).

You may as well consider forcing zfs to use 4k sectors (ashift= 12) even if in your case there is good chance that 512b sectors (ashift= 9) would be the default setting. Again, for later upgrade as you really, really don't want to mix ashift in a pool.

Edit: mixed vdev in a pool is possible, but not recommended (thanks @bahamat) and warning about "ashift".

2
  • Very informative. Thanks a lot. I'll need to rethink my strategy but I'll feel a bit more confident setting it up. Thanks again!
    – Jorsher
    Feb 5, 2014 at 5:57
  • 2
    Mixing vdev types in a single zpool is perfectly valid, though not recommended. Also not recommended is RAID-Z. Always use mirroring if possible.
    – bahamat
    Feb 5, 2014 at 10:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .