I have this zpool:
bash-3.2# zpool status dpool
pool: dpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
dpool ONLINE 0 0 0
c3t600601604F021A009E1F867A3E24E211d0 ONLINE 0 0 0
c3t600601604F021A00141D843A3F24E211d0 ONLINE 0 0 0
I would like to replace both of these disks with a single (larger disk). Can it be done? zpool attach allows me to replace one physical disk, but it won't allow me to replace both at once.
No, I don't think this is possible in the manner you're describing.
You can, however, create a new pool with the single disk and copy your ZFS filesystems to the new pool using a simple zfs send/receive process.
You should be able to
zpool attach
the new and larger drive, wait for the mirroring to be completed, and thenzpool detach
the old drives.Edit: I had misread your question, and I was quite sure that you were running them as a mirror.
I agree that the best course of action is to create a new pool and recursively send all datasets to the new pool, but if you really cannot do that, then you could still follow the steps I'm outlining, provided that you partition the new, larger disk, into two partitions, each as least as large as the disk that it is meant to replace.
I recommend against this, mainly because (1) management becomes more complex, and (2) you won't be able to take advantage of the drive's write cache.
I'll paste here the sequence as performed on a recent Illumos box. Please note that I'm creating empty files to show this, instead of using whole disks and slices/partitions, as I can't juggle physical devices on that box. The files are named
aa1
,aa2
andaa3
.Prepare the devices.
aa3
is 200M large, whileaa1
andaa2
are 100M only:Create our test pool:
Check that everything went smoothly:
Set the
autoexpand
property:Attach the new device:
Is everything still fine?
Yes, it is.
Detach the first two devs:
Finally, let's check the pool again:
It has correctly grown to 200MB.