Live data from Hacker News

3-Way Disk Mirrors with ZFS on Linux

bhoey.com

1–10 of 15 posts

Re: 3-Way Disk Mirrors with ZFS on Linux

#2
A much easier way to test ZFS configurations is to use files instead[0]:

  $ mkfile 128m /home/user/disk1
  $ mkfile 128m /home/user/disk2
  $ mkfile 128m /home/user/disk3
  $ zfs create tank mirror /home/user/disk1 /home/user/disk2 /home/user/disk3
[0]: https://flux.org.uk/tech/2007/03/zfs_tutorial_1.html

Re: 3-Way Disk Mirrors with ZFS on Linux

#3
post #2

A much easier way to test ZFS configurations is to use files instead[0]: $ mkfile 128m /home/user/disk1 $ mkfile 128m /home/user/disk2 $ mkfile 128m /home/user/disk3 $ zfs create tank mirror /home/user/disk1 /home/user/disk2 /home/user/disk3 [0]: https://flux.org.uk/tech/2007/03/zfs_tutorial_1.html

[deleted]

Re: 3-Way Disk Mirrors with ZFS on Linux

#4
post #3
post #2

A much easier way to test ZFS configurations is to use files instead[0]: $ mkfile 128m /home/user/disk1 $ mkfile 128m /home/user/disk2 $ mkfile 128m /home/user/disk3 $ zfs create tank mirror /home/user/disk1 /home/user/disk2 /home/user/disk3 [0]: https://flux.org.uk/tech/2007/03/zfs_tutorial_1.html

[deleted]

Yes they would. But you should never use this in production. Only for the purpose of learning/testing ZFS.

Re: 3-Way Disk Mirrors with ZFS on Linux

#5
post #4
post #3

Earlier quoted context omitted.

[deleted]

Yes they would. But you should never use this in production. Only for the purpose of learning/testing ZFS.

Sorry, I deleted my comment about the same time you replied to it. I realized both you and TFA were discusing testing setups, not actual hard drive redundancy setups.

Re: 3-Way Disk Mirrors with ZFS on Linux

#6
post #2

A much easier way to test ZFS configurations is to use files instead[0]: $ mkfile 128m /home/user/disk1 $ mkfile 128m /home/user/disk2 $ mkfile 128m /home/user/disk3 $ zfs create tank mirror /home/user/disk1 /home/user/disk2 /home/user/disk3 [0]: https://flux.org.uk/tech/2007/03/zfs_tutorial_1.html

Author here, thanks for the heads up. It doesn't look like mkfile is included with the Jessie base system I was using to test. For those wishing to use this method it looks like the xfsprogs package contains xfs_mkfile which operates the same as parent's example.

Re: 3-Way Disk Mirrors with ZFS on Linux

#7
post #6
post #2

A much easier way to test ZFS configurations is to use files instead[0]: $ mkfile 128m /home/user/disk1 $ mkfile 128m /home/user/disk2 $ mkfile 128m /home/user/disk3 $ zfs create tank mirror /home/user/disk1 /home/user/disk2 /home/user/disk3 [0]: https://flux.org.uk/tech/2007/03/zfs_tutorial_1.html

Author here, thanks for the heads up. It doesn't look like mkfile is included with the Jessie base system I was using to test. For those wishing to use this method it looks like the xfsprogs package contains xfs_mkfile which operates the same as parent's example.

mkfile is standard on Solaris. On Debain use fallocate:

  $ fallocate -l 128MB /home/user/disk1

Re: 3-Way Disk Mirrors with ZFS on Linux

#8
One thing to note: the '-o ashift' option is a per-drive (vdev) attribute according to the manual. So, when replacing a vdev, be sure to specify this option again if you do not use the default:

zpool replace -o ashift=12 old new.

Re: 3-Way Disk Mirrors with ZFS on Linux

#9
post #7
post #6

Earlier quoted context omitted.

Author here, thanks for the heads up. It doesn't look like mkfile is included with the Jessie base system I was using to test. For those wishing to use this method it looks like the xfsprogs package contains xfs_mkfile which operates the same as parent's example.

mkfile is standard on Solaris. On Debain use fallocate: $ fallocate -l 128MB /home/user/disk1

there is also 'truncate'. Especially nice about truncate is the ability to create sparse files. So if you want to test how big a pool would be with three 1TB disks without actually using 3TB of allocated space: 'truncate -s 1T file1.img'. voila, a 1tb file that only takes kilobytes upon creation of a zpool.

Re: 3-Way Disk Mirrors with ZFS on Linux

#10
Another nice property of ZFS mirroring is the read performance. Since data integrity is verified by checksums rather than by reading the data back from all disks and comparing it, the disks within a ZFS mirror are able to serve read requests in parallel.
Post reply on HN