Raid Z2 help
from a_fancy_kiwi@lemmy.world to selfhosted@lemmy.world on 23 Feb 19:14
https://lemmy.world/post/43497457

tldr: I’m going to set up raid z2 with 4x8TB hard drives. I’ll have photos, documents (text, pdf, etc.), movies/tv shows, and music on the pool. Are the below commands good enough? Anything extra you think I should add?

sudo zpool create mypool raidz2 -o ashift=12 /dev/disk/by-id/12345 ...

zfs set compression=lz4 mypool #maybe zstd?
zpool set autoexpand=on mypool
zpool set autoreplace=on mypool #I might keep this off. I can see myself forgetting in the future
zpool set listsnapshots=on mypool

With ai raising hard drive prices, I over spent on 3x10TB drives in order to reorganize my current pool and have 3 hard drives sitting on a shelf in the event of a failure. My current pool was built over time but it currently consists of 4x8TB drives. They are a mirrored stripe so a usable 16TB. If I understand it correctly, I can lose 1 drive for sure without losing data and maybe a second drive depending on which drive fails. Because of that, I want to move to raid z2 to ensure I can lose 2 drives without data loss. I’m going to move data from my 4x8TB drives, to the 3x10TB, reconfigure the 4x8TB, and move everything back. I run Immich, plex/jellyfin, and navidrome off the pool. All other documents are basically there for long term storage just in case. What options should I use for raid z2 when setting it up?

I know I can look this stuff up. I have been and continue to do so, I was just hoping for some advise from people that are more knowledgeable about this than me. The move from the 4x8TB drives to the 3x10TB is going to take ~3 days so I really don’t want to mess this up and have to start over 😅

#selfhosted

threaded - newest

avidamoeba@lemmy.ca on 23 Feb 19:34 collapse

I do:

sudo zpool create \
   -o ashift=12 -O acltype=posixacl -O compression=lz4 \
   -O dnodesize=auto -O normalization=formD -O relatime=on \
   -O xattr=sa \
   mypool \
   raidz2 \
   wwn-0x5000cca284c06395 \
   wwn-0x5000cca295e115f3 \
   wwn-0x5000cca2a1ef9c90 \
   wwn-0x5000cca295c03910 \
   wwn-0x5000cca29dd216b0

I’m then going to optimize recordsize depending on the workload in datasets. E.g. Immich db might use 8K or 16K recordsize while the library dataset where the files are might be larger so that search is faster. Etc.

a_fancy_kiwi@lemmy.world on 23 Feb 19:37 collapse

Thank you for this

avidamoeba@lemmy.ca on 23 Feb 20:35 collapse

The acl, norm, xattr, dnodesize options are all to make ZFS behave like a Linux filesystem and are pretty standard for using ZFS on Linux. They aren’t default because ZFS’ defaults are for Unix.