익명 20:53

Why does ZFS RAIDZ2 only use 2GB of data when I create a 1GB File

Why does ZFS RAIDZ2 only use 2GB of data when I create a 1GB File

I have created a ZFS RAIDZ2 / Raid 6 file system, which from what I believe will store parity on 2 disks.

root@zfs-demo:/data# zpool status
  pool: data
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        data        ONLINE       0     0     0
          raidz2-0  ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sde     ONLINE       0     0     0

errors: No known data errors

I have a 1GB file

root@zfs-demo:/data# ls -alh
total 1023M
drwxr-xr-x  2 root root    3 Dec 17 18:22 .
drwxr-xr-x 19 root root 4.0K Dec 17 18:10 ..
-rw-r--r--  1 root root 1.0G Dec 17 18:22 1GB.bin

I thought the two disks of parity would mean I was storing the file itself + two lots parity = 3 GB of storage in total for a 1 GB File, but only 2GB is allocated.

root@zfs-demo:/data# zpool list
NAME   SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
data  39.5G  2.01G  37.5G        -         -     0%     5%  1.00x    ONLINE  -


Top Answer/Comment:

With two out of four disks for redundancy, you can simply double the user data: two disks store the original data and the same space is used for redundancy data on the two other disks. Parity is actually distributed across all disks using striping, but that doesn't change the space that's taken up.

With the amount of disks you could use RAID 1/mirroring with the same space efficiency but better throughput efficiency (and less resilience, as Romeo Ninov has commented). RAID-Z2 or RAID 6 become more efficient with more disks: with a total of ten disks, eight can effectively be used for data and still only two are for redundancy.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다