Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building a FreeBSD / ZSF NAS #78

Open
scottmuc opened this issue Jul 18, 2024 · 4 comments
Open

Building a FreeBSD / ZSF NAS #78

scottmuc opened this issue Jul 18, 2024 · 4 comments
Assignees
Labels
digital homesteading Efforts that reduce dependence on big company services

Comments

@scottmuc
Copy link
Owner

scottmuc commented Jul 18, 2024

@scottmuc scottmuc added the digital homesteading Efforts that reduce dependence on big company services label Jul 18, 2024
@scottmuc scottmuc self-assigned this Jul 18, 2024
scottmuc added a commit that referenced this issue Jul 24, 2024
scottmuc added a commit that referenced this issue Jul 24, 2024
scottmuc added a commit that referenced this issue Jul 24, 2024
scottmuc added a commit that referenced this issue Jul 24, 2024
scottmuc added a commit that referenced this issue Jul 24, 2024
scottmuc added a commit that referenced this issue Jul 24, 2024
scottmuc added a commit that referenced this issue Jul 24, 2024
@scottmuc
Copy link
Owner Author

scottmuc commented Jul 24, 2024

Using Tests as a Learning Journal

I've been spending time getting acquainted and inspired with ZFS and it's made me realize that it's very important that I develop some confidence with the tool-chain. I thought writing up the scenarios that I'm most intrigued and concerned about would be a lot of fun, and it would result in an artifact I can look back on. So far, the progress looks like this:

~/workspace/infrastructure/devices/erebor ? bin/test
..

Finished in 3.22 seconds (files took 0.0509 seconds to load)
2 examples, 0 failures

Feature: A FreeBSD ZFS NAS
  In order to run and maintain a NAS with some features that important for when
  disaster strikes, I want to document my understand of how failures can be
  recovered from so that when it actually happens, I'm not too stressed.

  Scenario: Replacing a failed drive
    Given a 3 disk raidz1 pool with data
    When one of the disks fail
    And I replace the failed drive
    Then my files are all still available

  Scenario: Adding more disk space

  Scenario: Restoring from a snapshot

3 scenarios (2 undefined, 1 pending)
4 steps (3 skipped, 1 pending)
0m0.006s

It's been a blast to revisit vagrant and cucumber. Now to start fleshing out the step definitions and find what type of fixtures I need to create.

@scottmuc
Copy link
Owner Author

Tests Passing

Having the first scenario passing gives me some idea what recovering from a failed drive looks like. Funnily enough, I found a lot of guidance from an Arch Linux docs page. This has given me a positive first impression of ZFS so far.

~/workspace/infrastructure/devices/erebor ? ./bin/test
..

Finished in 3.5 seconds (files took 0.08377 seconds to load)
2 examples, 0 failures

Feature: A FreeBSD ZFS NAS
  In order to run and maintain a NAS with some features that important for when
  disaster strikes, I want to document my understand of how failures can be
  recovered from so that when it actually happens, I'm not too stressed.

  Background:
    Given a 3 disk raidz1 pool
    And it contains some data

  Scenario: Replacing a failed drive
    Given that one of the disks has failed
    When the failed disk is replaced
    Then my files are all still available

  Scenario: Adding more disk space

  Scenario: Restoring from a snapshot

3 scenarios (2 undefined, 1 passed)
5 steps (5 passed)
0m7.920s

scottmuc added a commit that referenced this issue Jul 28, 2024
scottmuc added a commit that referenced this issue Jul 28, 2024
@scottmuc
Copy link
Owner Author

All Tests Passing

All 3 scenarios that I'm most interested in are passing. Using cucumber was a fun exercise since it's been over a decade since my last time using it. I like that the step definitions have become a bit of a command journal for me to refer to.

Overall this was a delightful experience. ZFS feels good and intuitive to me. The model of having a pool composed of storage providers organized in vdevs. That it's only 2 commands to know (zfs and zpool) makes it approachable. That being said, the resources I listed in the original issue description shows that there are many ways to compose the ZFS primitives together.

Next Steps

Look into what hardware to purchase.

@scottmuc
Copy link
Owner Author

scottmuc commented Sep 8, 2024

Hardware Research

I don't really have a budget figured out. Trying to make this as cheap as possible isn't the goal, but I don't want to spend thousands either. Some of the things decided already:

  • 3 drives in a RaidZ1 configuration
  • Will go with a DIY FreeBSD setup, and don't intend on using any of the GUI offerings

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
digital homesteading Efforts that reduce dependence on big company services
Projects
None yet
Development

No branches or pull requests

1 participant