ZFS ZFS mirror with external USB hard disks

Tim Dowd

New Member


Messages: 3

Hello everyone

This is a real newbie question and I apologize if it's dumber than I think it is.

I need to set up a home NAS server, and I have a budget of exactly $0 for this. I do have a spare PC and two older 3TB external USB hard drives and I'm trying to decide how to leverage them.

My thoughts were that I'd set up a ZFS mirror on the computer running FreeBSD and then share it using NFS with the one Mac and 2 Debian computers that need to access it regularly.

This blog post gave me hope
https://blogs.oracle.com/constantin/entry/opensolaris_home_server_zfs_and

but it is 8 years old and I can't find anything newer about using cheapo hardware to do this.
I know it isn't ideal, but is there any reason that it's an absolutely terrible idea?

If it is, do you have any better suggestions for these 2 drives and old computer to accomplish some form of hard drive redundancy and network home folders?

All files on the zpool will be backed up to another 4TB drive that lives at a different location

Many thanks

Tim
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,315
Messages: 38,835

I have an external USB disk using ZFS. Never tried a mirror though but I see no reason why it wouldn't work. It may not be fast (due to the limitations of USB) but it should work.
 

tingo

Son of Beastie

Reaction score: 638
Messages: 2,543

Also, don't forget: where is your backup? It should be somewhere else than on your mirrored disks fileserver.
 

phoenix

Administrator
Staff member
Administrator
Moderator

Reaction score: 1,289
Messages: 4,099

Using USB drives for ZFS storage works fine ... most of the time. :) Depending on the USB controller and the version of FreeBSD (newer versions work better), doing lots of IOps can cause a USB disk to be dropped from the controller, or lock up the controller. Neither are particularly fatal to the ZFS pool itself, but can cause some in-flight data to be lost (what's on disk is fine, what's in the process of being written will be gone). Just something to watch for.

If possible, use separate USB controllers for each disk (some PCs include multiple controllers). It's a matter of plugging devices in to each port, and watching /var/log/messages and dmesg(8) output until things are setup the way you want.

Oh, and put your OS onto a separate disk, preferably one on a SATA disk, so that when the USB disks do drop off, you can still access the system remotely for fixing. :) Don't put / or /usr or /var onto the pool (/home is fine).
 
OP
T

Tim Dowd

New Member


Messages: 3

Just as an update on this... it hasn't been going great, partly because of the problems phoenix lists above and partly because one of my 3TB hard drives died during the initial filling up with data. That meant that I needed to resilver, and this is where the USB connection dropping randomly becomes an issue, you get stuck in an endless loop of getting like 3/4 of the way done and then having it randomly start over.

I'm shuffling hard drives around to try and find some extra space so I can reduce the size of the filesystem because I keep getting like 1.7TB out of 2.01 TB before it crashes and maybe if I have less to do it will work. I'll report back. Given how slow USB transfers go, that will probably be a few days from now.

The one surviving hard disk has performed very well through all this so I think if I can get a mirror for it then this all might work out fine. But it's had a lot asked of it with all the resilvering so I am starting to seriously worry about its health.
 
Top