Migrate single disk to mirror?

2,119 views
Skip to first unread message

Alex Wasserman

unread,
Mar 7, 2012, 5:18:16 PM3/7/12
to zfs-...@googlegroups.com
Hi,

Quick question before I embark on this road to ZFS.

I have a new 3TB HD I'm using to store my primary media data on - iTunes, iPhoto, etc. This adds up to over 1TB by itself now, and I want some headroom. I'm going to be doing a nightly backup to a Drobo, so I'm not too worried if something goes wrong, but, for added geek cred, and reliability, I'd like to add in a duplicate disk and create a mirror locally too.

So, here's my question - 

Can I install the 3TB SATA drive, create a single volume on it (zpool?) and then add in a new drive, do the same thing, and configure it as a mirror of the first all at a later data? IE. Does a mirror have to be configured at format time, or can I wait to create it?

Ideally, I'd like to get up and running with the one drive, then setup the mirror when I have time later.

Looking at Tens Complement, I'm more than happy to pay the $40 and give something back to this community, although I can't yet. They say that they're upgradable from silver to gold, just curious if that will work at a later date too.

Thanks,

Alex

Alex Blewitt

unread,
Mar 7, 2012, 5:43:07 PM3/7/12
to zfs-...@googlegroups.com
On 7 Mar 2012, at 22:18, Alex Wasserman wrote:
> Can I install the 3TB SATA drive, create a single volume on it (zpool?) and then add in a new drive, do the same thing, and configure it as a mirror of the first all at a later data? IE. Does a mirror have to be configured at format time, or can I wait to create it?

You can add a new device as a mirror to the pool after the fact, but be very careful. If you do it the wrong way then you'll end up with a raid0 kind of setup where you effectively halve your data resiliency.

zpool create mypool /dev/disk1s2
zpool attach mypool /dev/disk2s2

this should result in a mirrored mypool between disk1s2 and disk2s2 but do check this on a dummy config first of all.

If you do:

zpool add mypool /dev/diskofdoom

then you end up raid0-ing the device and it all goes horribly wrong.

> Looking at Tens Complement, I'm more than happy to pay the $40 and give something back to this community, although I can't yet. They say that they're upgradable from silver to gold, just curious if that will work at a later date too.

You'd have to ask them about that. Different levels have various different limitations and I have no idea what they have removed from each level.

Alex

Alex Wasserman

unread,
Mar 7, 2012, 6:56:51 PM3/7/12
to zfs-...@googlegroups.com
Thanks Alex.

So, it seems that the key here is to create the pool with the first disk, and attach the second disk, rather than add the second - does that sum it up?

Regards,

Alex

Jason

unread,
Mar 8, 2012, 7:09:29 AM3/8/12
to zfs-...@googlegroups.com
The only issue is initial pool creation without data vs pool expansion due to data. It's a crying shame when you mix them up. ;)

Jason
Sent from my iPad

Gregg Wonderly

unread,
Mar 8, 2012, 10:55:36 PM3/8/12
to zfs-...@googlegroups.com, Alex Wasserman
On 3/7/2012 5:56 PM, Alex Wasserman wrote:
Thanks Alex.

So, it seems that the key here is to create the pool with the first disk, and attach the second disk, rather than add the second - does that sum it up?

Yes, and when you have multiple devices, and want to pair each one, than you'll need to specify the drive you watch to attach to.  If I had two disks, without mirrors, such as created by

zpool create mypool disk1s2 disk2s2

and then wanted to have each mirrored with two more disks I had connected, I would do

zpool attach mypool disk3s2 disk1s2
zpool attach mypool disk4s2 disk2s2

to get two mirrored pairs.

Gregg Wonderly
Reply all
Reply to author
Forward
0 new messages