Page 1 of 1

Create ZFS with single disk, add second after for mirroring.

Posted: 23 Dec 2015 14:42
by icoleman.uk
Hi,

Here's my situation:

I have 2 identical 3TB drives. One has data that I do not want to lose and don't have anywhere else to store it. The other is blank.

I want to create a mirrored ZFS filesystem and was trying to achieve the following:

1. Create ZFS filesystem with a single disk using the blank disk.
2. Copy the data from the other disk to the new ZFS filesystem.
3. Blank the other disk and add it to the ZFS filesystem as part of a mirrored set.
4. Let it "rebuild" and relax knowing I now have a bit of redundancy.

The problem:
I am unable to create a ZFS vdev with a single disk. NAS4Free states it needs at least two (which makes sense for mirrored set but doesn't suit my situation).

To be honest I haven't done much with ZFS in the past and am more familiar with RAID (both software and hardware).

Any help would be appreciated. :)

Re: Create ZFS with single disk, add second after for mirroring.

Posted: 23 Dec 2015 15:06
by kenZ71
If you have a 3rd disk, it can be any size but must be empty you can try this hack:

1) Create the empty pool with one 3TB and one old disk, say a old 500GB drive

2) copy data to the pool but you are limited to the smallest drive

3) unplug the source drive and verify the data is in the pool

4) take a break then come back and verify again your data is in the pool

5) when absolutely certain all data is in the pool pull the old 500GB drive & replace with the source 3TB

Would suggest putting some tape with a label on the source drive and clearly label as SOURCE

Also, sounds like you don't have a backup copy, might be best to get that sorted first

Finally above hack will only work if your smallest drive can hold all data.

Re: Create ZFS with single disk, add second after for mirroring.

Posted: 23 Dec 2015 15:22
by icoleman.uk
Hi,

Thanks for the reply - I'll have a dig around and see if I can come up with a drive that can store my data. I do have a backup of sorts but recovering it would take quite a while so copying from local disks would be preferred.

Am I to assume that it is impossible to create a vdev with only one disk and add another later?

Cheers for your help :)

Re: Create ZFS with single disk, add second after for mirroring.

Posted: 23 Dec 2015 16:10
by raulfg3
select stripe to create a one disk ZFS.

then google a bit to convert one single stripe ZFS disk on a ZFS disk mirror.

Re: Create ZFS with single disk, add second after for mirroring.

Posted: 23 Dec 2015 16:14
by raulfg3
https://blogs.oracle.com/gjl/entry/conv ... fs_pool_to

The correct way is to attach a new device to existing vdev e.g.

# zpool attach -f yourzfspoolofasingledisk ada0 ada1


please keep in mind that command is ilustratice only.